Skip to content

Commit

Permalink
JENKINS-32983: align on latest versions (org.jenkins-ci.plugins:plugi…
Browse files Browse the repository at this point in the history
…n:2.3)
  • Loading branch information
jcarsique committed Feb 18, 2016
1 parent 1e08175 commit 401b064
Show file tree
Hide file tree
Showing 8 changed files with 186 additions and 168 deletions.
150 changes: 79 additions & 71 deletions pom.xml
@@ -1,30 +1,31 @@
<?xml version='1.0' encoding='UTF-8'?>

<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.424</version>
<!-- which version of Jenkins is this plugin built against? -->
<version>2.3</version>
<relativePath />
</parent>

<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -43,31 +44,85 @@ under the License.
<tag>HEAD</tag>
</scm>

<properties>
<mavenVersion>3.1.0</mavenVersion>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>2.12.1</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>2.0.0</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.4</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.2</version>
</dependency>
<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
<version>1.237</version>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.jenkins-ci.main</groupId>
<artifactId>maven-plugin</artifactId>
<version>1.424</version>
<scope>compile</scope>
</dependency>
<!-- Undeclared dependencies transitively retrieved from maven-plugin because their tricky configuration and exclusions: -->
<!-- org.eclipse.sisu:org.eclipse.sisu.plexus which needs exclusions -->
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-core</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-compat</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>${mavenVersion}</version>
</dependency>
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-invoker-plugin</artifactId>
<version>1.6</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.2</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.8.3</version>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</dependency>
<dependency>
<groupId>org.kohsuke.stapler</groupId>
<artifactId>stapler</artifactId>
</dependency>
</dependencies>

<!-- get every artifact through repo.jenkins-ci.org, which proxies all the artifacts that we need -->
<repositories>
<repository>
<id>repo.jenkins-ci.org</id>
Expand All @@ -82,51 +137,4 @@ under the License.
</pluginRepository>
</pluginRepositories>

<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.85</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<systemPropertyVariables>
<java.awt.headless>true</java.awt.headless>
</systemPropertyVariables>
</configuration>

</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.3.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>

<profiles>
<profile>
<id>mvn-debug</id>
<build>
<plugins>
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.85</version>
<configuration>
<systemProperties>
<hudson.maven.debugPort>5005</hudson.maven.debugPort>
</systemProperties>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
@@ -1,4 +1,5 @@
package org.jenkinsci.plugins.maveninvoker;

/*
* Copyright (c) Olivier Lamy
* Licensed to the Apache Software Foundation (ASF) under one
Expand All @@ -24,17 +25,16 @@
import hudson.maven.MavenBuild;
import hudson.maven.MavenModule;
import hudson.maven.MavenModuleSet;
import hudson.model.AbstractBuild;
import hudson.model.Action;
import org.jenkinsci.plugins.maveninvoker.results.MavenInvokerResult;
import org.jenkinsci.plugins.maveninvoker.results.MavenInvokerResults;
import hudson.model.AbstractBuild;

import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;

import org.jenkinsci.plugins.maveninvoker.results.MavenInvokerResult;
import org.jenkinsci.plugins.maveninvoker.results.MavenInvokerResults;

/**
* @author Olivier Lamy
*/
Expand All @@ -55,33 +55,36 @@ public InvokerMavenAggregatedReport( AbstractBuild<?, ?> build )
super( build );
}

@Override
public void update( Map<MavenModule, List<MavenBuild>> moduleBuilds, MavenBuild newBuild )
{
InvokerReport invokerReport = newBuild.getAction( InvokerReport.class );

if ( invokerReport != null )
{
MavenInvokerResults mavenInvokerResults = invokerReport.getMavenInvokerResults();
if ( mavenInvokerResults != null )
MavenInvokerResults miResults = invokerReport.getMavenInvokerResults();
if ( miResults != null )
{
List<MavenInvokerResult> results = mavenInvokerResults.mavenInvokerResults;
this.mavenInvokerResults.mavenInvokerResults.addAll( results );
initTestCountsFields( this.mavenInvokerResults );
List<MavenInvokerResult> results = miResults.mavenInvokerResults;
mavenInvokerResults.mavenInvokerResults.addAll( results );
initTestCountsFields( mavenInvokerResults );
}
}
}

@Override
public MavenInvokerResults getMavenInvokerResults()
{
return this.mavenInvokerResults;
return mavenInvokerResults;
}

@Override
public Class<? extends AggregatableAction> getIndividualActionType()
{
return InvokerReport.class;
}

@Override
public Action getProjectAction( MavenModuleSet moduleSet )
{
return this;
Expand All @@ -90,6 +93,8 @@ public Action getProjectAction( MavenModuleSet moduleSet )
public static class MavenInvokerAggregatedBuildAction
extends MavenInvokerBuildAction
{
private static final long serialVersionUID = 1L;

MavenInvokerResults mavenInvokerResults;

public MavenInvokerAggregatedBuildAction( AbstractBuild<?, ?> build, MavenInvokerResults mavenInvokerResults )
Expand All @@ -101,7 +106,7 @@ public MavenInvokerAggregatedBuildAction( AbstractBuild<?, ?> build, MavenInvoke
@Override
public MavenInvokerResults getMavenInvokerResults()
{
return this.mavenInvokerResults;
return mavenInvokerResults;
}

@Override
Expand All @@ -118,6 +123,7 @@ protected Object readResolve()
public static class MavenInvokerResultComparator
implements Comparator<MavenInvokerResult>
{
@Override
public int compare( MavenInvokerResult mavenInvokerResult, MavenInvokerResult mavenInvokerResult1 )
{
if ( mavenInvokerResult.mavenModuleName == null )
Expand Down
34 changes: 13 additions & 21 deletions src/main/java/org/jenkinsci/plugins/maveninvoker/InvokerReport.java
@@ -1,4 +1,5 @@
package org.jenkinsci.plugins.maveninvoker;

/*
* Copyright (c) Olivier Lamy
* Licensed to the Apache Software Foundation (ASF) under one
Expand Down Expand Up @@ -38,6 +39,8 @@ public class InvokerReport
implements AggregatableAction
{

private static final long serialVersionUID = 1L;

private MavenInvokerResults mavenInvokerResults;

public InvokerReport( AbstractBuild<?, ?> build, MavenInvokerResults mavenInvokerResults )
Expand All @@ -46,30 +49,19 @@ public InvokerReport( AbstractBuild<?, ?> build, MavenInvokerResults mavenInvoke
this.mavenInvokerResults = mavenInvokerResults;
}

@Override
public MavenAggregatedReport createAggregatedAction( MavenModuleSetBuild build,
Map<MavenModule, List<MavenBuild>> moduleBuilds )
{

/*for ( Map.Entry<MavenModule, List<MavenBuild>> entry : moduleBuilds.entrySet() )
{
for ( MavenBuild mavenBuild : entry.getValue() )
{
MavenInvokerBuildAction mavenInvokerBuildAction = mavenBuild.getAction( MavenInvokerBuildAction.class );
if ( mavenInvokerBuildAction != null )
{
MavenInvokerResults mavenInvokerResults = mavenInvokerBuildAction.getMavenInvokerResults();
if ( mavenInvokerResults != null )
{
List<MavenInvokerResult> results = mavenInvokerResults.mavenInvokerResults;
if ( results != null )
{
this.mavenInvokerResults.mavenInvokerResults.addAll( results );
}
}
}
}
}*/
/*
* for ( Map.Entry<MavenModule, List<MavenBuild>> entry : moduleBuilds.entrySet() ) { for ( MavenBuild
* mavenBuild : entry.getValue() ) { MavenInvokerBuildAction mavenInvokerBuildAction = mavenBuild.getAction(
* MavenInvokerBuildAction.class ); if ( mavenInvokerBuildAction != null ) { MavenInvokerResults
* mavenInvokerResults = mavenInvokerBuildAction.getMavenInvokerResults(); if ( mavenInvokerResults != null ) {
* List<MavenInvokerResult> results = mavenInvokerResults.mavenInvokerResults; if ( results != null ) {
* this.mavenInvokerResults.mavenInvokerResults.addAll( results ); } } } } }
*/
InvokerMavenAggregatedReport invokerMavenAggregatedReport =
build.getAction( InvokerMavenAggregatedReport.class );
if ( invokerMavenAggregatedReport != null )
Expand All @@ -82,6 +74,6 @@ public MavenAggregatedReport createAggregatedAction( MavenModuleSetBuild build,
@Override
public MavenInvokerResults getMavenInvokerResults()
{
return this.mavenInvokerResults;
return mavenInvokerResults;
}
}

0 comments on commit 401b064

Please sign in to comment.