Skip to content
This repository has been archived by the owner on Oct 7, 2019. It is now read-only.

Failure on java 9(-ea+159): Unable to make private java.io.File(java.lang.String,java.io.File) accessible #51

Closed
chtompki opened this issue Mar 4, 2017 · 2 comments

Comments

@chtompki
Copy link

chtompki commented Mar 4, 2017

Given the environment:

$ mvn -X
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T11:41:47-05:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 9-ea, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk-9.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12.3", arch: "x86_64", family: "mac"

my commons-text build referencing org.apache.maven.plugins:maven-site-plugin:3.6, which in turn utilizes our version of the findbugs-maven-plugin, currently 3.0.0 (but I have also tried the HEAD of master, 3.0.5-SNAPSHOT), seems to fail with the following error trace:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.6:site (default-site) on project commons-text: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.6:site failed: No signature of method: java.io.File.exists() is applicable for argument types: () values: []
[ERROR] Possible solutions: write(java.lang.String), with(groovy.lang.Closure), print(java.io.PrintWriter), is(java.lang.Object), print(java.lang.Object), printf(java.lang.String, java.lang.Object)
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.6:site (default-site) on project commons-text: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.6:site failed: No signature of method: java.io.File.exists() is applicable for argument types: () values: []
Possible solutions: write(java.lang.String), with(groovy.lang.Closure), print(java.io.PrintWriter), is(java.lang.Object), print(java.lang.Object), printf(java.lang.String, java.lang.Object)
	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 java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:547)
	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.PluginExecutionException: Execution default-site of goal org.apache.maven.plugins:maven-site-plugin:3.6:site failed: No signature of method: java.io.File.exists() is applicable for argument types: () values: []
Possible solutions: write(java.lang.String), with(groovy.lang.Closure), print(java.io.PrintWriter), is(java.lang.Object), print(java.lang.Object), printf(java.lang.String, java.lang.Object)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
	... 20 more
Caused by: groovy.lang.MissingMethodException: No signature of method: java.io.File.exists() is applicable for argument types: () values: []
Possible solutions: write(java.lang.String), with(groovy.lang.Closure), print(java.io.PrintWriter), is(java.lang.Object), print(java.lang.Object), printf(java.lang.String, java.lang.Object)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap(ScriptBytecodeAdapter.java:58)
	at org.codehaus.groovy.runtime.callsite.PojoMetaClassSite.call(PojoMetaClassSite.java:49)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:117)
	at org.codehaus.mojo.findbugs.FindBugsMojo.canGenerateReport(FindBugsMojo.groovy:534)
	at org.apache.maven.reporting.exec.MavenReportExecution.canGenerateReport(MavenReportExecution.java:89)
	at org.apache.maven.plugins.site.render.AbstractSiteRenderingMojo.getReports(AbstractSiteRenderingMojo.java:267)
	at org.apache.maven.plugins.site.render.SiteMojo.execute(SiteMojo.java:115)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
	... 21 more
@PascalSchumacher
Copy link

I think this can be fixed by updating to groovy 2.4.8+

See:
http://mail-archives.apache.org/mod_mbox/groovy-dev/201612.mbox/%3Cop.yrurx4dakdkhrr%40desktop-2khsk44%3E

http://mail-archives.apache.org/mod_mbox/groovy-dev/201612.mbox/%3C5842A401.4080702%40gmx.org%3E

which discuss the problem and confirm that it is fixed in 2.4.8.

PascalSchumacher added a commit to PascalSchumacher/findbugs-maven-plugin that referenced this issue Mar 12, 2017
PascalSchumacher added a commit to PascalSchumacher/findbugs-maven-plugin that referenced this issue May 2, 2017
@PascalSchumacher
Copy link

PascalSchumacher commented Aug 21, 2017

3.0.5 with groovy 2.4.12 was released a few days ago, so this issue should be fixed.

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 a pull request may close this issue.

3 participants