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

Conversation

don-vip
Copy link
Contributor

@don-vip don-vip commented Nov 11, 2017

No description provided.

@don-vip
Copy link
Contributor Author

don-vip commented Nov 11, 2017

Travis build if failing for OpenJDK7 only. Do you want to keep it, or could we drop it and keep only support of OpenJDK8+?

@don-vip don-vip changed the title update Maven dependencies and plugins update min Java version, Maven dependencies and plugins Nov 24, 2017
@@ -383,6 +384,6 @@ public void onLoad(Run<?, ?> run) {

@Override
public Collection<? extends Action> getProjectActions() {
return jacocoProjectActions;
return jacocoProjectAction != null ? Arrays.asList(jacocoProjectAction) : Collections.emptyList();
Copy link
Member

Choose a reason for hiding this comment

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

I would use Collections.singletonList() here instead of Arrays.asList()

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

@@ -33,10 +34,10 @@
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.

pom.xml Outdated
@@ -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>
<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

pom.xml Outdated
</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

pom.xml Outdated
<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

pom.xml Outdated
@@ -195,30 +215,76 @@ 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".

@@ -137,7 +131,7 @@ private static void summarize(Map<String, JacocoCoverageResultSummary> summaries

JacocoCoverageResultSummary jacocoCoverageResult = getResult(run);

String date = DATE_FORMAT.format(runDate.getTime());
String date = new SimpleDateFormat("yyyy-MM-dd").format(runDate.getTime());
Copy link
Member

Choose a reason for hiding this comment

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

Unfortunately you are mixing many different changes here, not only Java 7->8, these seem to be intended to improve concurrent behavior somehow. This makes review a bit harder, would in general be better to send separate PRs for these unrelated changes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not unrelated. Yet again caused by the switch to org.jenkins-ci.plugins 3.0 and the underlying FindBugs analysis. If not fixed, the build fails.

@don-vip
Copy link
Contributor Author

don-vip commented Dec 5, 2017

This new enforcer rule is annoying. For example, I am trying to update to parent pom 3.2, and this is what I get:

[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.ow2.asm:asm:6.0 paths to dependency are:
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.ow2.asm:asm:6.0
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.ow2.asm:asm-commons:6.0
    +-org.ow2.asm:asm-tree:6.0
      +-org.ow2.asm:asm:6.0
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.apache.maven.plugins:maven-plugin-plugin:3.5
    +-org.apache.maven.plugin-tools:maven-plugin-tools-generators:3.5
      +-org.ow2.asm:asm:6.0_ALPHA
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.apache.maven.plugins:maven-plugin-plugin:3.5
    +-org.apache.maven.plugin-tools:maven-plugin-tools-annotations:3.5
      +-org.ow2.asm:asm:6.0_ALPHA
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.main:jenkins-core:2.54
    +-com.github.jnr:jnr-posix:3.0.1
      +-com.github.jnr:jnr-ffi:1.0.7
        +-org.ow2.asm:asm:4.0
,
Require upper bound dependencies error for org.ow2.asm:asm-commons:6.0 paths to dependency are:
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.ow2.asm:asm-commons:6.0
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.apache.maven.plugins:maven-plugin-plugin:3.5
    +-org.apache.maven.plugin-tools:maven-plugin-tools-generators:3.5
      +-org.ow2.asm:asm-commons:6.0_ALPHA
and
+-org.jenkins-ci.plugins:jacoco:2.3-SNAPSHOT
  +-org.jenkins-ci.main:jenkins-core:2.54
    +-com.github.jnr:jnr-posix:3.0.1
      +-com.github.jnr:jnr-ffi:1.0.7
        +-org.ow2.asm:asm-commons:4.0
]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11.768 s
[INFO] Finished at: 2017-12-05T23:04:09+01:00
[INFO] Final Memory: 39M/130M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:3.0.0-M1:enforce (display-info) on project jacoco: Some Enforcer rules have failed. Look above for specific messages explaining why the rule failed. -> [Help 1]

@kscaldef
Copy link

kscaldef commented Jan 9, 2018

What are the prospects for moving this along? I was making a pass at updating to the newly released JaCoCo 0.8 version it appears that requiring JDK 1.7 compatibility is holding it back

@don-vip
Copy link
Contributor Author

don-vip commented Jan 9, 2018

I'm still waiting for apache/maven-plugin-tools#9 to be merged, I didn't think it would take this long.

@don-vip
Copy link
Contributor Author

don-vip commented Jan 10, 2018

OK it appears the other PR in maven-plugin-tools is not needed anymore, no need to wait for it.
@centic9 : can you please check if everything's OK now?

@centic9 centic9 merged commit d04b509 into jenkinsci:master Jan 10, 2018
@centic9
Copy link
Member

centic9 commented Jan 10, 2018

Looks good now, I expect we will release a major version due to the changes in dependencies.

@don-vip don-vip deleted the updates branch January 10, 2018 20:40
@kscaldef
Copy link

@centic9 any idea when that release will happen?

@centic9
Copy link
Member

centic9 commented Feb 18, 2018

I tried to release, but as usual the release-steps fail at some point with some permission denied. It seems I am not able to get this solved in a way that works longer than for one release, grrr.... anybody else who knows what to do?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.8.2:deploy (default-deploy) on project jacoco: Failed to deploy artifacts: Could not transfer artifact org.jenkins-ci.plugins:jacoco:hpi:3.0 from/to maven.jenkins-ci.org (https://repo.jenkins-ci.org/releases): Access denied to: https://repo.jenkins-ci.org/releases/org/jenkins-ci/plugins/jacoco/3.0/jacoco-3.0.hpi, ReasonPhrase: . -> [Help 1]

I re-created the settings.xml and checked other things, but to no avail ...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants