- About Scala
- Documentation
- Code Examples
- Software
- Scala Developers
windows XP, maven-scala-plugin, cmd line too large
Thu, 2009-08-27, 15:56
I'm working on a java project with a team of 4 devs and 1 QA. We were
able to sneak a single scala class into the project as it greatly
simplified a task. This is a mavenized project developed in eclipse, so
we have mixed mode editing and compilation. Now we seem to have a
problem with the maven-scala-plugin.
Our QA guy is on windows XP, and today he tried to build the project for
the first time since we added the scala deps to maven. His build failed
with this cryptic error:
"java.io.IOException: CreateProcess error=87, The parameter is incorrect"
I did some searching and found that this could be caused by excessively
large command line arguments on windows. I checked the generated cmd via
mvn -X, and sure enough, the compile command is staggeringly enormous.
It lists the full path to every jar as well as the full path to every
single source file in the project - and then it blows up.
We're using version 2.10.1 of the plugin, and have tried
false in the configuration. This results in the execution
exiting prematurely with no build status from maven. The result is that
it compile the scala file - nothing more.
I sincerely hope someone out there can suggest a fix for this. Thank you!
Sincerely,
Chris
Fri, 2009-08-28, 19:37
#2
Re: windows XP, maven-scala-plugin, cmd line too large
Thanks Josh. Switching to 2.11 (not snapshot) seemed to fix the issue.
chris
Josh Suereth wrote:
chris
Josh Suereth wrote:
55b774930908270959x1bb0ec1fha25849374a74d6e [at] mail [dot] gmail [dot] com" type="cite">I think you want to use the 2.11-SNAPSHOT (that's what we use at work). The reason being that there was a fix to how the forking is being done in this version. If you continue to run into problems, please let me know. We have an integration test that is making sure these features work on windows.
Also what version of scala are you using? If the non-forking version is dieing with no status info, it's because scalac is dieing. I've seen this in testing with non-forking versions. Regardless, 2.11-SNAPSHOT will let you fork correctly. I have some multi-module projects where we are using Scala in production (builds on windows + linux) so it's most certainly possible.
- Josh
On Thu, Aug 27, 2009 at 10:56 AM, Chris Lewis <chris [at] thegodcode [dot] net" rel="nofollow">chris@thegodcode.net> wrote:
I'm working on a java project with a team of 4 devs and 1 QA. We were able to sneak a single scala class into the project as it greatly simplified a task. This is a mavenized project developed in eclipse, so we have mixed mode editing and compilation. Now we seem to have a problem with the maven-scala-plugin.
Our QA guy is on windows XP, and today he tried to build the project for the first time since we added the scala deps to maven. His build failed with this cryptic error:
"java.io.IOException: CreateProcess error=87, The parameter is incorrect"
I did some searching and found that this could be caused by excessively large command line arguments on windows. I checked the generated cmd via mvn -X, and sure enough, the compile command is staggeringly enormous. It lists the full path to every jar as well as the full path to every single source file in the project - and then it blows up.
We're using version 2.10.1 of the plugin, and have tried <fork>false</fork> in the configuration. This results in the execution exiting prematurely with no build status from maven. The result is that it compile the scala file - nothing more.
I sincerely hope someone out there can suggest a fix for this. Thank you!
Sincerely,
Chris
Sat, 2009-08-29, 16:07
#3
Re: windows XP, maven-scala-plugin, cmd line too large
No problem! Thank David Bernard for that fix.
- Josh
On Fri, Aug 28, 2009 at 2:21 PM, Chris Lewis <chris@thegodcode.net> wrote:
- Josh
On Fri, Aug 28, 2009 at 2:21 PM, Chris Lewis <chris@thegodcode.net> wrote:
Thanks Josh. Switching to 2.11 (not snapshot) seemed to fix the issue.
chris
Josh Suereth wrote:I think you want to use the 2.11-SNAPSHOT (that's what we use at work). The reason being that there was a fix to how the forking is being done in this version. If you continue to run into problems, please let me know. We have an integration test that is making sure these features work on windows.
Also what version of scala are you using? If the non-forking version is dieing with no status info, it's because scalac is dieing. I've seen this in testing with non-forking versions. Regardless, 2.11-SNAPSHOT will let you fork correctly. I have some multi-module projects where we are using Scala in production (builds on windows + linux) so it's most certainly possible.
- Josh
On Thu, Aug 27, 2009 at 10:56 AM, Chris Lewis <chris@thegodcode.net> wrote:
I'm working on a java project with a team of 4 devs and 1 QA. We were able to sneak a single scala class into the project as it greatly simplified a task. This is a mavenized project developed in eclipse, so we have mixed mode editing and compilation. Now we seem to have a problem with the maven-scala-plugin.
Our QA guy is on windows XP, and today he tried to build the project for the first time since we added the scala deps to maven. His build failed with this cryptic error:
"java.io.IOException: CreateProcess error=87, The parameter is incorrect"
I did some searching and found that this could be caused by excessively large command line arguments on windows. I checked the generated cmd via mvn -X, and sure enough, the compile command is staggeringly enormous. It lists the full path to every jar as well as the full path to every single source file in the project - and then it blows up.
We're using version 2.10.1 of the plugin, and have tried <fork>false</fork> in the configuration. This results in the execution exiting prematurely with no build status from maven. The result is that it compile the scala file - nothing more.
I sincerely hope someone out there can suggest a fix for this. Thank you!
Sincerely,
Chris
Sat, 2009-08-29, 20:17
#4
Re: windows XP, maven-scala-plugin, cmd line too large
workaround is also applied for scala-2.8.x because the reader of args
in file of scala-2.8 seems buggy (failed if space in path).
/davidB
On Sat, Aug 29, 2009 at 16:57, Josh Suereth wrote:
> No problem! Thank David Bernard for that fix.
>
> - Josh
>
> On Fri, Aug 28, 2009 at 2:21 PM, Chris Lewis wrote:
>>
>> Thanks Josh. Switching to 2.11 (not snapshot) seemed to fix the issue.
>>
>> chris
>>
>> Josh Suereth wrote:
>>
>> I think you want to use the 2.11-SNAPSHOT (that's what we use at work).
>> The reason being that there was a fix to how the forking is being done in
>> this version. If you continue to run into problems, please let me know. We
>> have an integration test that is making sure these features work on windows.
>>
>>
>> Also what version of scala are you using? If the non-forking version is
>> dieing with no status info, it's because scalac is dieing. I've seen this
>> in testing with non-forking versions. Regardless, 2.11-SNAPSHOT will let
>> you fork correctly. I have some multi-module projects where we are using
>> Scala in production (builds on windows + linux) so it's most certainly
>> possible.
>>
>> - Josh
>>
>> On Thu, Aug 27, 2009 at 10:56 AM, Chris Lewis
>> wrote:
>>>
>>> I'm working on a java project with a team of 4 devs and 1 QA. We were
>>> able to sneak a single scala class into the project as it greatly simplified
>>> a task. This is a mavenized project developed in eclipse, so we have mixed
>>> mode editing and compilation. Now we seem to have a problem with the
>>> maven-scala-plugin.
>>>
>>> Our QA guy is on windows XP, and today he tried to build the project for
>>> the first time since we added the scala deps to maven. His build failed with
>>> this cryptic error:
>>>
>>> "java.io.IOException: CreateProcess error=87, The parameter is incorrect"
>>>
>>> I did some searching and found that this could be caused by excessively
>>> large command line arguments on windows. I checked the generated cmd via mvn
>>> -X, and sure enough, the compile command is staggeringly enormous. It lists
>>> the full path to every jar as well as the full path to every single source
>>> file in the project - and then it blows up.
>>>
>>> We're using version 2.10.1 of the plugin, and have tried
>>> false in the configuration. This results in the execution
>>> exiting prematurely with no build status from maven. The result is that it
>>> compile the scala file - nothing more.
>>>
>>> I sincerely hope someone out there can suggest a fix for this. Thank you!
>>>
>>> Sincerely,
>>> Chris
>>
>>
>
>
Sat, 2009-08-29, 20:37
#5
Re: windows XP, maven-scala-plugin, cmd line too large
I think we need to escape " if there's a space in the path. I need to make sure the ant task got fixed. I had used the same code for the maven plugin and the ant task. I like using the maven helper for command line arguments in maven, do you know if Ant has a similar class?
On Sat, Aug 29, 2009 at 3:13 PM, David Bernard <david.bernard.31@gmail.com> wrote:
On Sat, Aug 29, 2009 at 3:13 PM, David Bernard <david.bernard.31@gmail.com> wrote:
Note: since today in version 2.12-SNAPSHOT of the plugin. the
workaround is also applied for scala-2.8.x because the reader of args
in file of scala-2.8 seems buggy (failed if space in path).
/davidB
On Sat, Aug 29, 2009 at 16:57, Josh Suereth<joshua.suereth@gmail.com> wrote:
> No problem! Thank David Bernard for that fix.
>
> - Josh
>
> On Fri, Aug 28, 2009 at 2:21 PM, Chris Lewis <chris@thegodcode.net> wrote:
>>
>> Thanks Josh. Switching to 2.11 (not snapshot) seemed to fix the issue.
>>
>> chris
>>
>> Josh Suereth wrote:
>>
>> I think you want to use the 2.11-SNAPSHOT (that's what we use at work).
>> The reason being that there was a fix to how the forking is being done in
>> this version. If you continue to run into problems, please let me know. We
>> have an integration test that is making sure these features work on windows.
>>
>>
>> Also what version of scala are you using? If the non-forking version is
>> dieing with no status info, it's because scalac is dieing. I've seen this
>> in testing with non-forking versions. Regardless, 2.11-SNAPSHOT will let
>> you fork correctly. I have some multi-module projects where we are using
>> Scala in production (builds on windows + linux) so it's most certainly
>> possible.
>>
>> - Josh
>>
>> On Thu, Aug 27, 2009 at 10:56 AM, Chris Lewis <chris@thegodcode.net>
>> wrote:
>>>
>>> I'm working on a java project with a team of 4 devs and 1 QA. We were
>>> able to sneak a single scala class into the project as it greatly simplified
>>> a task. This is a mavenized project developed in eclipse, so we have mixed
>>> mode editing and compilation. Now we seem to have a problem with the
>>> maven-scala-plugin.
>>>
>>> Our QA guy is on windows XP, and today he tried to build the project for
>>> the first time since we added the scala deps to maven. His build failed with
>>> this cryptic error:
>>>
>>> "java.io.IOException: CreateProcess error=87, The parameter is incorrect"
>>>
>>> I did some searching and found that this could be caused by excessively
>>> large command line arguments on windows. I checked the generated cmd via mvn
>>> -X, and sure enough, the compile command is staggeringly enormous. It lists
>>> the full path to every jar as well as the full path to every single source
>>> file in the project - and then it blows up.
>>>
>>> We're using version 2.10.1 of the plugin, and have tried
>>> <fork>false</fork> in the configuration. This results in the execution
>>> exiting prematurely with no build status from maven. The result is that it
>>> compile the scala file - nothing more.
>>>
>>> I sincerely hope someone out there can suggest a fix for this. Thank you!
>>>
>>> Sincerely,
>>> Chris
>>
>>
>
>
Sat, 2009-08-29, 20:47
#6
Re: windows XP, maven-scala-plugin, cmd line too large
something like org.codehaus.plexus.util.cli.CommandLineUtils ?
I think you could also take a look at commons-exec ?
On Sat, Aug 29, 2009 at 21:27, Josh Suereth wrote:
> I think we need to escape " if there's a space in the path. I need to make
> sure the ant task got fixed. I had used the same code for the maven plugin
> and the ant task. I like using the maven helper for command line arguments
> in maven, do you know if Ant has a similar class?
>
> On Sat, Aug 29, 2009 at 3:13 PM, David Bernard
> wrote:
>>
>> Note: since today in version 2.12-SNAPSHOT of the plugin. the
>> workaround is also applied for scala-2.8.x because the reader of args
>> in file of scala-2.8 seems buggy (failed if space in path).
>>
>> /davidB
>>
>> On Sat, Aug 29, 2009 at 16:57, Josh Suereth
>> wrote:
>> > No problem! Thank David Bernard for that fix.
>> >
>> > - Josh
>> >
>> > On Fri, Aug 28, 2009 at 2:21 PM, Chris Lewis
>> > wrote:
>> >>
>> >> Thanks Josh. Switching to 2.11 (not snapshot) seemed to fix the issue.
>> >>
>> >> chris
>> >>
>> >> Josh Suereth wrote:
>> >>
>> >> I think you want to use the 2.11-SNAPSHOT (that's what we use at work).
>> >> The reason being that there was a fix to how the forking is being done
>> >> in
>> >> this version. If you continue to run into problems, please let me
>> >> know. We
>> >> have an integration test that is making sure these features work on
>> >> windows.
>> >>
>> >>
>> >> Also what version of scala are you using? If the non-forking version
>> >> is
>> >> dieing with no status info, it's because scalac is dieing. I've seen
>> >> this
>> >> in testing with non-forking versions. Regardless, 2.11-SNAPSHOT will
>> >> let
>> >> you fork correctly. I have some multi-module projects where we are
>> >> using
>> >> Scala in production (builds on windows + linux) so it's most certainly
>> >> possible.
>> >>
>> >> - Josh
>> >>
>> >> On Thu, Aug 27, 2009 at 10:56 AM, Chris Lewis
>> >> wrote:
>> >>>
>> >>> I'm working on a java project with a team of 4 devs and 1 QA. We were
>> >>> able to sneak a single scala class into the project as it greatly
>> >>> simplified
>> >>> a task. This is a mavenized project developed in eclipse, so we have
>> >>> mixed
>> >>> mode editing and compilation. Now we seem to have a problem with the
>> >>> maven-scala-plugin.
>> >>>
>> >>> Our QA guy is on windows XP, and today he tried to build the project
>> >>> for
>> >>> the first time since we added the scala deps to maven. His build
>> >>> failed with
>> >>> this cryptic error:
>> >>>
>> >>> "java.io.IOException: CreateProcess error=87, The parameter is
>> >>> incorrect"
>> >>>
>> >>> I did some searching and found that this could be caused by
>> >>> excessively
>> >>> large command line arguments on windows. I checked the generated cmd
>> >>> via mvn
>> >>> -X, and sure enough, the compile command is staggeringly enormous. It
>> >>> lists
>> >>> the full path to every jar as well as the full path to every single
>> >>> source
>> >>> file in the project - and then it blows up.
>> >>>
>> >>> We're using version 2.10.1 of the plugin, and have tried
>> >>> false in the configuration. This results in the execution
>> >>> exiting prematurely with no build status from maven. The result is
>> >>> that it
>> >>> compile the scala file - nothing more.
>> >>>
>> >>> I sincerely hope someone out there can suggest a fix for this. Thank
>> >>> you!
>> >>>
>> >>> Sincerely,
>> >>> Chris
>> >>
>> >>
>> >
>> >
>
>
Also what version of scala are you using? If the non-forking version is dieing with no status info, it's because scalac is dieing. I've seen this in testing with non-forking versions. Regardless, 2.11-SNAPSHOT will let you fork correctly. I have some multi-module projects where we are using Scala in production (builds on windows + linux) so it's most certainly possible.
- Josh
On Thu, Aug 27, 2009 at 10:56 AM, Chris Lewis <chris@thegodcode.net> wrote: