[GRADLE-2167] FindBugs plugin runs into command line length limit on Windows Created: 13/Mar/12  Updated: 04/Jan/13  Resolved: 02/Apr/12

Status: Resolved
Project: Gradle
Affects Version/s: 1.0-milestone-8
Fix Version/s: 1.0-rc-1

Type: Improvement
Reporter: Gradle Forums Assignee: René Gröschke (Inactive)
Resolution: Fixed Votes: 1


 Description   

Similar to the mailing list thread at [1]http://gradle.1045684.n5.nabble.com/G... – I'm unable to run the findbugs task on my code due to this error in JDK 1.7:

[ant:findbugs] java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_02\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long

Or, with JDK 1.6:

[ant:findbugs] java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe": CreateProcess error=87, The parameter is incorrect

I'm using this version of gradle:

------------------------------------------------------------
Gradle 1.0-milestone-8
------------------------------------------------------------

Gradle build time: Monday, February 13, 2012 11:53:32 PM UTC
Groovy: 1.8.4
Ant: Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Ivy: 2.2.0
JVM: 1.6.0_21 (Sun Microsystems Inc. 17.0-b17)
OS: Windows 7 6.1 amd64

When I run gradle with --debug, I can extract the command it runs when it tries to start FindBugs in a new JVM. I've abbreviated it in two places below:

14:32:46.933 [DEBUG] [org.gradle.api.internal.project.ant.AntLoggingAdapter] Execute:Java13CommandLauncher: Executing 'C:\Program Files\Java\jdk1.6.0_21\jre\bin\java.exe' with arguments:
'-Dfindbugs.debug=true'
'-Dfindbugs.hostApp=FBAntTask'
'-classpath'
'C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\libs\third-party\findbugs-2.0.0.jar;C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\libs\third-party\findbugs-ant-2.0.0.jar'
'edu.umd.cs.findbugs.FindBugs2'
'-pluginList'
''
'-sortByClass'
'-timestampNow'
'-xml'
'-auxclasspathFromInput'
'-sourcepath'
(abbreviated from 120 files to 2)'C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\src\com\sri\pal\AbstractActionDef.java;C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\src\com\sri\pal\ActionDef.java'
'-outputFile'
'C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\build\reports\findbugs\main.xml'
'-exitcode'
(abbreviated from 166 files to 2)
'C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\build\classes\main\com\sri\pal\AbstractActionDef.class'
'C:\Users\chris\work\PAL-CPOF-SHELL\current\tasklearning\bridge\build\classes\main\com\sri\pal\ActionDef.class'

It seems likely that this command line is simply too long for Windows to handle.
----------------------------------------------------------------------------------------
[1] http://gradle.1045684.n5.nabble.com/Groovyc-fork-failing-on-Windows-td3357060.html



 Comments   
Comment by Szczepan Faber [ 14/Mar/12 ]

Thanks for the report. Definitely a bug we need to fix.

Comment by Dan Stine [ 02/Apr/12 ]

This issue was marked as fixed earlier today. Is the Fix Version known yet? Thanks.

Comment by René Gröschke (Inactive) [ 02/Apr/12 ]

This fix will be part of the next release (1.0-rc1) that will hopefully be available within the next two weeks. We're currently working on a snapshot of this rc1 available to be tested in the field within the next days.

Generated at Wed Jun 30 12:14:31 CDT 2021 using Jira 8.4.2#804003-sha1:d21414fc212e3af190e92c2d2ac41299b89402cf.