Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

update min Java version, Maven dependencies and plugins #92

Merged
merged 7 commits into from
Jan 10, 2018
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ language: java
sudo: false

jdk:
- oraclejdk7
- oraclejdk8
137 changes: 112 additions & 25 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ THE SOFTWARE.
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>1.625.3</version>
<version>3.0</version>
<relativePath />
</parent>

Expand Down Expand Up @@ -97,7 +97,10 @@ THE SOFTWARE.
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.build.outputEncoding>UTF-8</project.build.outputEncoding>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<jacoco.version>0.7.8</jacoco.version>
<ant.version>1.9.2</ant.version>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need a dependency on Ant now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was to fix this error, but it's probably not the best way:

[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (display-info) @ jacoco ---
[INFO] Ignoring requireUpperBoundDeps in org.kohsuke:access-modifier-annotation
[WARNING] Rule 6: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for org.apache.ant:ant:1.8.4 paths to dependency are:
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.main:jenkins-core:2.54
    +-org.apache.ant:ant:1.8.4
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.plugins:dashboard-view:2.9.11
    +-org.jenkins-ci.main:maven-plugin:2.13
      +-org.jenkins-ci.main.maven:maven-agent:1.7
        +-org.apache.ant:ant:1.8.4
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.plugins:dashboard-view:2.9.11
    +-org.jenkins-ci.main:maven-plugin:2.13
      +-org.jenkins-ci.lib:lib-jenkins-maven-embedder:3.11
        +-org.apache.ant:ant:1.9.2

<jacoco.version>0.7.9</jacoco.version>
<jenkins.version>2.54</jenkins.version>
<maven.version>3.5.2</maven.version>
<powermock.version>1.6.6</powermock.version>
</properties>

Expand All @@ -119,7 +122,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>dashboard-view</artifactId>
<version>2.1</version>
<version>2.9.11</version>
<optional>true</optional>
<exclusions>
<exclusion>
Expand All @@ -128,33 +131,50 @@ THE SOFTWARE.
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.ant</groupId>
<artifactId>ant</artifactId>
<version>${ant.version}</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any usages of commons-io in the changed code, why is the dependency necessary now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reason than ant, but not needed anymore after a new update

<artifactId>commons-io</artifactId>
<version>2.5</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Xerces dependency should not be needed since Java 7, why is it necessary here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix this error but I should find another way:

[INFO] --- maven-enforcer-plugin:3.0.0-M1:enforce (display-info) @ jacoco ---
[INFO] Ignoring requireUpperBoundDeps in org.kohsuke:access-modifier-annotation
[WARNING] Rule 6: org.apache.maven.plugins.enforcer.RequireUpperBoundDeps failed with message:
Failed while enforcing RequireUpperBoundDeps. The error(s) are [
Require upper bound dependencies error for xerces:xercesImpl:2.9.1 paths to dependency are:
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.apache.maven.reporting:maven-reporting-impl:2.3
    +-org.apache.maven.doxia:doxia-core:1.2
      +-xerces:xercesImpl:2.9.1
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.main:jenkins-test-harness:2.32
    +-org.jenkins-ci.main:jenkins-test-harness-htmlunit:2.18-1
      +-xerces:xercesImpl:2.11.0
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.main:jenkins-test-harness:2.32
    +-org.jenkins-ci.main:jenkins-test-harness-htmlunit:2.18-1
      +-net.sourceforge.nekohtml:nekohtml:1.9.22
        +-xerces:xercesImpl:2.11.0

<version>2.11.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.jacoco</groupId>
<artifactId>org.jacoco.report</artifactId> <!-- we're done with ReportMojo now, so we don't need to depend on the maven plugin anymore -->
<version>${jacoco.version}</version>
</dependency>
<dependency>
<groupId>org.kohsuke</groupId>
<artifactId>asm5</artifactId>
<version>5.0.1</version>
<artifactId>asm6</artifactId>
<version>6.0_BETA</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>5.0.1</version>
<version>6.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-commons</artifactId>
<version>5.0.1</version>
<version>6.0</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<version>3.4</version>
<version>3.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -195,34 +215,80 @@ THE SOFTWARE.
<version>3.5</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need all these Maven dependencies now? Where do we actually use functionality from them?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because of the switch to org.jenkins-ci.plugins 3.0, which defines a very strict maven enforcer configuration. If not met, the build fails. The enforcer rule causing all of this is "Require Upper Bound Dependencies".

<artifactId>maven-reporting-api</artifactId>
<version>3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.reporting</groupId>
<artifactId>maven-reporting-impl</artifactId>
<version>2.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.1.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-plugin-api</artifactId>
<version>3.3.9</version>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-artifact</artifactId>
<version>3.3.9</version>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-model</artifactId>
<version>3.3.9</version>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-repository-metadata</artifactId>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
<version>3.3.9</version>
<version>${maven.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-aether-provider</artifactId>
<version>3.3.9</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<version>1.24</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
<version>3.1.0</version>
</dependency>
<!-- Somehow we need org.w3c.dom.ElementTraversal, but do not get it from any of the dependencies
do not update to 2.x as it will not contain the class any more! -->
Expand All @@ -234,7 +300,7 @@ THE SOFTWARE.
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.1</version>
<version>4.4.8</version>
</dependency>
<dependency>
<groupId>org.jenkins-ci.plugins</groupId>
Expand All @@ -255,7 +321,7 @@ THE SOFTWARE.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>1.3.1</version>
<version>3.1.0</version>
<executions>
<execution>
<phase>insert-test</phase>
Expand All @@ -276,20 +342,20 @@ THE SOFTWARE.
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.6.0</version>
<version>3.7.0</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<version>1.9</version>
<version>1.16</version>
<configuration>
<signature>
<groupId>org.codehaus.mojo.signature</groupId>
<artifactId>java17</artifactId>
<artifactId>java18</artifactId>
<version>1.0</version>
</signature>
</configuration>
Expand Down Expand Up @@ -326,7 +392,6 @@ THE SOFTWARE.
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>${jacoco.version}</version>
<configuration>
<excludes>
<exclude>**/Messages.*</exclude>
Expand All @@ -352,7 +417,6 @@ THE SOFTWARE.
<plugin>
<groupId>org.jenkins-ci.tools</groupId>
<artifactId>maven-hpi-plugin</artifactId>
<version>1.121</version>
<executions>
<execution>
<phase>compile</phase>
Expand All @@ -361,12 +425,35 @@ THE SOFTWARE.
</goals>
</execution>
</executions>

<configuration>
<pluginFirstClassLoader>true</pluginFirstClassLoader>
<maskClasses>org.objectweb.asm.</maskClasses>
</configuration>
</plugin>
<plugin>
<artifactId>maven-enforcer-plugin</artifactId>
<executions>
<execution>
<id>display-info</id>
<phase>validate</phase>
<goals>
<goal>display-info</goal>
<goal>enforce</goal>
</goals>
<configuration>
<rules>
<enforceBytecodeVersion>
<excludes>
<exclude>org.ow2.asm:asm-commons</exclude>
<exclude>org.ow2.asm:asm-tree</exclude>
<exclude>org.ow2.asm:asm</exclude>
</excludes>
</enforceBytecodeVersion>
</rules>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
<pluginManagement>
<plugins>
Expand All @@ -385,7 +472,7 @@ THE SOFTWARE.
<artifactId>
maven-hpi-plugin
</artifactId>
<versionRange>[1.64,)</versionRange>
<versionRange>[2.0,)</versionRange>
<goals>
<goal>hpi</goal>
<goal>apt-compile</goal>
Expand Down Expand Up @@ -424,7 +511,7 @@ THE SOFTWARE.
org.codehaus.groovy.maven
</groupId>
<artifactId>gmaven-plugin</artifactId>
<versionRange>[1.0-rc-5,)</versionRange>
<versionRange>[1.0,)</versionRange>
<goals>
<goal>generateTestStubs</goal>
<goal>testCompile</goal>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@


public class ExecutionFileLoader implements Serializable {
private static final long serialVersionUID = 1L;
private final static String[] STARSTAR = {"**"};
private final static String[] ITEM_ZERO = {"{0}"};

Expand All @@ -33,10 +34,10 @@ public class ExecutionFileLoader implements Serializable {
private String[] includes;
private String[] excludes;

private ExecutionDataStore executionDataStore;
private SessionInfoStore sessionInfoStore;
private transient ExecutionDataStore executionDataStore;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment why "transient" is necessary/useful here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. It's because of the switch to org.jenkins-ci.plugins 3.0, which defines a FindBugs analysis.

private transient SessionInfoStore sessionInfoStore;

private IBundleCoverage bundleCoverage;
private transient IBundleCoverage bundleCoverage;

private ArrayList<FilePath> execFiles;

Expand Down
Loading