problem running scalac from maven-scala-plugin for project with many java classes

10 views
Skip to first unread message

Peter Lopen

unread,
Jan 8, 2009, 9:46:23 AM1/8/09
to maven-a...@googlegroups.com
hello,

I have a following problem, while using scala-maven-plugin for project with many java source files:

lopen@LOPEN /d/devel/eai/migration
$ mvn -e -Dmaven.scala.displayCmd=true -Dmaven.test.skip=true clean install
...
[INFO] Compiling 303 source files to D:\devel\eai\migration\target\classes
[INFO] cmd:  c:\Program Files\Java\jdk1.6.0_03\jre\bin\java -classpath D:\work\m2\repository\org\scala-lang\scala-compiler\2.7.2\scala-compiler-2.7.2.
jar;D:\work\m2\repository\org\scala-lang\scala-library\2.7.2\scala-library-2.7.2.jar -Xbootclasspath/a:D:\work\m2\repository\org\scala-lang\scala-libr
ary\2.7.2\scala-library-2.7.2.jar scala.tools.nsc.Main -classpath d:\devel\eai\migration\target\classes;D:\work\m2\repository\asseco-ecm\cmapi\0.1.0\c
mapi-0.1.0.jar;D:\work\m2\repository\asseco-ecm\ecm-core\0.1.0\ecm-core-0.1.0.jar;D:\work\m2\repository\log4j\log4j\1.2.8\log4j-1.2.8.jar;D:\work\m2\r
epository\springframework\spring\2.0\spring-2.0.jar;D:\work\m2\repository\commons-logging\commons-logging\1.0.4\commons-logging-1.0.4.jar;D:\work\m2\r
epository\commons-io\commons-io\1.2\commons-io-1.2.jar;D:\work\m2\repository\commons-dbcp\commons-dbcp\1.2.1\commons-dbcp-1.2.1.jar;D:\work\m2\repository\org\scala-lang\scala-library\2.7.2\scala-library-2.7.2.jar -d D:\devel\eai\migration\target\classes D:\devel\eai\migration\src\main\scala\sk\asseco\sse\migration\cm\CompilationTest.scala `complete list of *.java files from project`
...
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] wrap: java.io.IOException: Cannot run program "c:\Program Files\Java\jdk1.6.0_03\jre\bin\java": CreateProcess error=87, The parameter is incorr
ect

[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: wrap: java.io.IOException: Cannot run program "c:\Program Files\Java\jdk1.6.0_03\jre\bin\java"
: CreateProcess error=87, The parameter is incorrect
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:583)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:499)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:478)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:330)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:291)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:142)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:336)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:129)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:287)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: wrap: java.io.IOException: Cannot run program "c:\Program Files\Java\jdk1.6.0_03\jre\bin\ja
va": CreateProcess error=87, The parameter is incorrect
        at org.scala_tools.maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:216)
        at org.scala_tools.maven.ScalaCompilerSupport.execute(ScalaCompilerSupport.java:29)
        at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:451)
        at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:558)
        ... 16 more
Caused by: java.io.IOException: Cannot run program "c:\Program Files\Java\jdk1.6.0_03\jre\bin\java": CreateProcess error=87, The parameter is incorrec
t
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:459)
        at org.scala_tools.maven.JavaCommand.run(JavaCommand.java:185)
        at org.scala_tools.maven.ScalaCompilerSupport.compile(ScalaCompilerSupport.java:125)
        at org.scala_tools.maven.ScalaCompilerSupport.doExecute(ScalaCompilerSupport.java:54)
        at org.scala_tools.maven.ScalaMojoSupport.execute(ScalaMojoSupport.java:208)
        ... 19 more
Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
        at java.lang.ProcessImpl.create(Native Method)
        at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
        at java.lang.ProcessImpl.start(ProcessImpl.java:30)
        at java.lang.ProcessBuilder.start(ProcessBuilder.java:452)

When I've removed list of *.java files, command for compilation runs correctly. Is there any other possibility to define java source files for scala compiler using scala-maven-plugin?

Thanks.
Peter Lopen

Josh Suereth

unread,
Jan 10, 2009, 2:12:47 PM1/10/09
to maven-a...@googlegroups.com, beloved, scala...@listes.epfl.ch
Peter,

I have a fix that should work for you.  You need to do the following:

1) Pull down the maven-scala-plugin source (git clone git://github.com/davidB/maven-scala-plugin.git )
2) Run [mvn install] on the maven-scala-plugin.
3) Add a <fork>false</fork>   element in the maven-scala-plugin configuration section.
4) You may need to increase the memory given to the maven process.  I believe the command is something like [set MAVEN_OPTS="-Xmx512M"]
5) You may also need to specify 2.10-SNAPSHOT as the version of your maven-scala-plugin, but you should not have to.


I was able to duplicate the error you saw by attempting to build 514 source files.   Using the above fixes, I had no issues compiling on Windows XP.   If you need me to up the number of source files I test trying to compile, I can.   I'd like to make sure it's high enough that we ensure there are no issues, but low enough that development of the plugin doesn't bog down.


davidB -

Would you mind making a release of the plugin as soon as you have the time?  I'm going to attempt to release a snapshot version so others can at least use this fix if needed.

Thanks,
-Josh

David Bernard

unread,
Jan 12, 2009, 7:09:50 AM1/12/09
to maven-a...@googlegroups.com, beloved, scala...@listes.epfl.ch
I deployed the 2.10-SNAPSHOTS on http://scala-tools.org/repo-snapshots/

/davidB

Josh Suereth

unread,
Jan 12, 2009, 8:14:00 AM1/12/09
to maven-a...@googlegroups.com, maven-a...@googlegroups.com, beloved, scala...@listes.epfl.ch
Awesome! I need to remember you have Hudson building all this!

I'm hoping we can get arnaud's scala packaging/lifecycle into the 2.10
release. Do you have anything else you'd like to see in there?

On Jan 12, 2009, at 7:09 AM, "David Bernard" <david.bernard.

Reply all
Reply to author
Forward
0 new messages