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

Unable to auto-detect boot classpath for JDK 9 #28

Open
simontunnat opened this issue Feb 24, 2017 · 1 comment
Open

Unable to auto-detect boot classpath for JDK 9 #28

simontunnat opened this issue Feb 24, 2017 · 1 comment

Comments

@simontunnat
Copy link

Creating a api signature for JDK 9 fails because the animal sniffer plugin can't detect the boot classpath for JDK 9.

I took the following steps:

I downloaded the JDK 9 from http://www.java.net/download/java/jdk9/archive/157/binaries/jdk-9-ea+157_linux-x64_bin.tar.gz to "/usr/lib/jvm/java-9-jdk".

I configured the following toolchain in the "~/.m2/toolchains.xml":

<toolchain> <type>jdk</type> <provides> <version>1.9</version> <vendor>oracle</vendor> </provides> <configuration> <jdkHome>/usr/lib/jvm/java-9-jdk</jdkHome> </configuration> </toolchain>

If configured the animal sniffer plugin as follows:
<plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>animal-sniffer-maven-plugin</artifactId> <executions> <execution> <id>create-signature</id> <phase>package</phase> <goals> <goal>build</goal> </goals> <configuration> <includeModuleClasses>false</includeModuleClasses> <includeJavaHome>true</includeJavaHome> <jdk> <version>1.9</version> </jdk> </configuration> </execution> </executions> </plugin>

After executing "mvn clean verify" I got the following error message:

[ERROR] Failed to execute goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.15:build (create-signature) on project jdk9-signature: Could not auto-detect java boot classpath for /usr/lib/jvm/java-9-jdk/bin/java -> [Help 1] org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:animal-sniffer-maven-plugin:1.15:build (create-signature) on project jdk9-signature: Could not auto-detect java boot classpath for /usr/lib/jvm/java-9-jdk/bin/java at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116) at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80) at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51) at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106) at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863) at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288) at org.apache.maven.cli.MavenCli.main(MavenCli.java:199) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289) at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415) at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356) Caused by: org.apache.maven.plugin.MojoFailureException: Could not auto-detect java boot classpath for /usr/lib/jvm/java-9-jdk/bin/java at org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.detectJavaClasspath(BuildSignaturesMojo.java:483) at org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.detectJavaBootClasspath(BuildSignaturesMojo.java:447) at org.codehaus.mojo.animal_sniffer.maven.BuildSignaturesMojo.execute(BuildSignaturesMojo.java:340) at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134) at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207) ... 20 more

I could also recreate the error by executing:

/usr/lib/jvm/java-9-jdk/jre/bin/java -jar [...]/java-boot-classpath-detector-1.15.jar

Which fails withe the following error message:

Cannot auto-detect boot class path 9-ea [...]/java-boot-classpath-detector-1.15.jar

@simontunnat simontunnat changed the title Could not auto-detect java boot classpath for /usr/lib/jvm/java-9-jdk/bin/java Unable to auto-detect boot classpath for JDK 9 Feb 24, 2017
@rfscholte
Copy link
Member

I would like to see signatures per module because you can't speak of THE runtime anymore. This would mean a new implementation for creating such signatures.

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

2 participants