Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fails using Java 10: An API incompatibility was encountered #71

Closed
McPringle opened this issue Apr 8, 2018 · 6 comments
Closed
Milestone

Comments

@McPringle
Copy link
Contributor

Steps to reproduce

  • Install and activate Java 9 or Java 10 (in my case: official stable OpenJDK builds)
  • Clone this repository: git clone git@github.com:JavaMoney/jsr354-api.git
  • Enter project directory: cd jsr354-api
  • Build the project: mvn clean package

Actual result

  • Build fails

Expected result

  • Build successful

Version

openjdk version "10" 2018-03-20
OpenJDK Runtime Environment 18.3 (build 10+46)
OpenJDK 64-Bit Server VM 18.3 (build 10+46, mixed mode)

Build output

[INFO] Scanning for projects...
[WARNING] The project javax.money:money-api:jar:1.0.2-SNAPSHOT uses prerequisites which is only intended for maven-plugin projects but not for non maven-plugin projects. For such purposes you should use the maven-enforcer-plugin. See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html
[INFO] 
[INFO] -----------------------< javax.money:money-api >------------------------
[INFO] Building JSR 354 (Money and Currency API) 1.0.2-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ money-api ---
[INFO] Deleting /Users/mcpringle/GitHub/other/jsr354-api/target
[INFO] 
[INFO] --- maven-enforcer-plugin:1.3.1:enforce (enforce-versions) @ money-api ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.076 s
[INFO] Finished at: 2018-04-08T18:56:02+02:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce (enforce-versions) on project money-api: Execution enforce-versions of goal org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce failed: An API incompatibility was encountered while executing org.apache.maven.plugins:maven-enforcer-plugin:1.3.1:enforce: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.apache.maven.plugins:maven-enforcer-plugin:1.3.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/mcpringle/.m2/repository/org/apache/maven/plugins/maven-enforcer-plugin/1.3.1/maven-enforcer-plugin-1.3.1.jar
[ERROR] urls[1] = file:/Users/mcpringle/.m2/repository/org/apache/maven/reporting/maven-reporting-api/2.0.9/maven-reporting-api-2.0.9.jar
[ERROR] urls[2] = file:/Users/mcpringle/.m2/repository/org/apache/maven/doxia/doxia-sink-api/1.0-alpha-10/doxia-sink-api-1.0-alpha-10.jar
[ERROR] urls[3] = file:/Users/mcpringle/.m2/repository/commons-cli/commons-cli/1.0/commons-cli-1.0.jar
[ERROR] urls[4] = file:/Users/mcpringle/.m2/repository/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar
[ERROR] urls[5] = file:/Users/mcpringle/.m2/repository/org/codehaus/plexus/plexus-utils/1.5.8/plexus-utils-1.5.8.jar
[ERROR] urls[6] = file:/Users/mcpringle/.m2/repository/commons-lang/commons-lang/2.3/commons-lang-2.3.jar
[ERROR] urls[7] = file:/Users/mcpringle/.m2/repository/org/apache/maven/enforcer/enforcer-api/1.3.1/enforcer-api-1.3.1.jar
[ERROR] urls[8] = file:/Users/mcpringle/.m2/repository/org/apache/maven/enforcer/enforcer-rules/1.3.1/enforcer-rules-1.3.1.jar
[ERROR] urls[9] = file:/Users/mcpringle/.m2/repository/org/apache/maven/shared/maven-common-artifact-filters/1.4/maven-common-artifact-filters-1.4.jar
[ERROR] urls[10] = file:/Users/mcpringle/.m2/repository/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar
[ERROR] urls[11] = file:/Users/mcpringle/.m2/repository/org/apache/maven/shared/maven-dependency-tree/2.1/maven-dependency-tree-2.1.jar
[ERROR] urls[12] = file:/Users/mcpringle/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[13] = file:/Users/mcpringle/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[14] = file:/Users/mcpringle/.m2/repository/org/codehaus/plexus/plexus-i18n/1.0-beta-6/plexus-i18n-1.0-beta-6.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>javax.money:money-api:1.0.2-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : begin 0, end 3, length 2
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException
@atsticks
Copy link
Member

atsticks commented Apr 8, 2018

I am not sure, what the issue is. If it is the dependency on the snapshot version of the API, this will be resolved as when the 1.0.2 release is publicly available in mvn central. I plan to release the API artifacts first and the RI artifacts in a second row...

@keilw
Copy link
Member

keilw commented Apr 8, 2018

Did you try Oracle JDK 10 as well? There have been issues with OpenJDK before which never happened with Oracle JDK of the same version.

@keilw
Copy link
Member

keilw commented Apr 8, 2018

Beside it sounds mostly like a Java 10/OpenJDK 10 incompatibility with certain Maven plugins. Seen plenty of similar problems trying to build against Java 9.

@fwgreen
Copy link

fwgreen commented May 5, 2018

Has anyone tried using the latest Maven plugins? The output mentions maven-enforcer-plugin:1.3.1. The version recommended for the JPMS is 3.0.0-M1.

@keilw keilw added this to the 1.0.4 milestone Jun 4, 2018
@keilw
Copy link
Member

keilw commented Jun 4, 2018

Is this still relevant?

@McPringle
Copy link
Contributor Author

I can confirm that it now works with Java 10.0.1+9! Thank you very much!

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

No branches or pull requests

4 participants