You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Adrian Herscu <bm...@fastmail.fm> on 2007/04/16 21:07:25 UTC

[m2] exec-maven-plugin fails because path containing spaces

Hi all,

I am trying to run Ant 1.7 from within Maven 2 using the exec-maven-plugin.

       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
         <executions>
           <execution>
             <phase>process-test-resources</phase>
             <goals>
               <goal>java</goal>
             </goals>
           </execution>
         </executions>
         <configuration>
           <mainClass>org.apache.tools.ant.Main</mainClass>
           <workingDirectory>${basedir}</workingDirectory>
           <arguments>
             <argument>-buildfile</argument>
             <argument>${basedir}/mybuild.xml</argument>
           </arguments>
         </configuration>
       </plugin>

It seems that there is a problem with Windows paths containing spaces.
Anyone knows about a decent workaround?

Thanks,
Adrian.

P.S. The error log:[[


BUILD FAILED
java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:842)
	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:585)
	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
	at org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
	at org.apache.tools.ant.Project.initProperties(Project.java:309)
	at org.apache.tools.ant.Project.init(Project.java:295)
	at org.apache.tools.ant.Main.runBuild(Main.java:663)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.Main.start(Main.java:161)
	at org.apache.tools.ant.Main.main(Main.java:250)
	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:585)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.URISyntaxException: Illegal character in path at 
index 18: file:/C:/Documents and 
Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
	at java.net.URI$Parser.fail(URI.java:2816)
	at java.net.URI$Parser.checkChars(URI.java:2989)
	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
	at java.net.URI$Parser.parse(URI.java:3021)
	at java.net.URI.<init>(URI.java:578)
	at java.net.URI.create(URI.java:840)
	... 20 more

Total time: 0 seconds
java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:842)
	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:585)
	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
	at org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
	at org.apache.tools.ant.Project.initProperties(Project.java:309)
	at org.apache.tools.ant.Project.init(Project.java:295)
	at org.apache.tools.ant.Main.runBuild(Main.java:663)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.Main.start(Main.java:161)
	at org.apache.tools.ant.Main.main(Main.java:250)
	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:585)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.URISyntaxException: Illegal character in path at 
index 18: file:/C:/Documents and 
Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
	at java.net.URI$Parser.fail(URI.java:2816)
	at java.net.URI$Parser.checkChars(URI.java:2989)
	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
	at java.net.URI$Parser.parse(URI.java:3021)
	at java.net.URI.<init>(URI.java:578)
	at java.net.URI.create(URI.java:840)
	... 20 more


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] exec-maven-plugin fails because path containing spaces

Posted by Jerome Lacoste <je...@gmail.com>.
On 4/17/07, Adrian Herscu <bm...@fastmail.fm> wrote:
> Good idea! Only problem is that "antrun" doesn't know about Ant 1.7...
> (and I need a specific feature of a specific task which is available
> only in Ant 1.7)

http://jira.codehaus.org/browse/MANTRUN-68

You can fix it yourself. You probably just need to update the pom, as
long as ant 1.7. is on ibiblio.

Jerome

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] exec-maven-plugin fails because path containing spaces

Posted by Adrian Herscu <bm...@fastmail.fm>.
Good idea! Only problem is that "antrun" doesn't know about Ant 1.7... 
(and I need a specific feature of a specific task which is available 
only in Ant 1.7)

franz see wrote:
> Good day,
> 
> How about using the antrun plugin instead? ( see [1] )
> 
> Cheers,
> Franz
> 
> [1] http://maven.apache.org/plugins/maven-antrun-plugin/
> 
> 
> Adrian Herscu-2 wrote:
>> Added
>> 	<localRepository>C:\DOCUME~1\pm\M2639C~1\REPOSI~1</localRepository>
>>
>> to the M2 install settings.xml.
>>
>> But, this may require changes in other machines as well :-(
>>
>> Phill Moran wrote:
>>> Surround them in quotes or use the dos short for. For instance "program
>>> files"
>>> == "progra~1" 
>>>
>>> -----Original Message-----
>>> From: news [mailto:news@sea.gmane.org] On Behalf Of Adrian Herscu
>>> Sent: April 16, 2007 3:07 PM
>>> To: users@maven.apache.org
>>> Subject: [m2] exec-maven-plugin fails because path containing spaces
>>>
>>> Hi all,
>>>
>>> I am trying to run Ant 1.7 from within Maven 2 using the
>>> exec-maven-plugin.
>>>
>>>        <plugin>
>>>          <groupId>org.codehaus.mojo</groupId>
>>>          <artifactId>exec-maven-plugin</artifactId>
>>>          <executions>
>>>            <execution>
>>>              <phase>process-test-resources</phase>
>>>              <goals>
>>>                <goal>java</goal>
>>>              </goals>
>>>            </execution>
>>>          </executions>
>>>          <configuration>
>>>            <mainClass>org.apache.tools.ant.Main</mainClass>
>>>            <workingDirectory>${basedir}</workingDirectory>
>>>            <arguments>
>>>              <argument>-buildfile</argument>
>>>              <argument>${basedir}/mybuild.xml</argument>
>>>            </arguments>
>>>          </configuration>
>>>        </plugin>
>>>
>>> It seems that there is a problem with Windows paths containing spaces.
>>> Anyone knows about a decent workaround?
>>>
>>> Thanks,
>>> Adrian.
>>>
>>> P.S. The error log:[[
>>>
>>>
>>> BUILD FAILED
>>> java.lang.IllegalArgumentException
>>> 	at java.net.URI.create(URI.java:842)
>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 	at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> 	at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>>> a:25)
>>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>>> 	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
>>> 	at
>>> org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
>>> 	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
>>> 	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
>>> 	at org.apache.tools.ant.Project.initProperties(Project.java:309)
>>> 	at org.apache.tools.ant.Project.init(Project.java:295)
>>> 	at org.apache.tools.ant.Main.runBuild(Main.java:663)
>>> 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
>>> 	at org.apache.tools.ant.Main.start(Main.java:161)
>>> 	at org.apache.tools.ant.Main.main(Main.java:250)
>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 	at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> 	at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>>> a:25)
>>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>>> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
>>> 	at java.lang.Thread.run(Thread.java:595)
>>> Caused by: java.net.URISyntaxException: Illegal character in path at
>>> index 18:
>>> file:/C:/Documents and
>>> Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
>>> 	at java.net.URI$Parser.fail(URI.java:2816)
>>> 	at java.net.URI$Parser.checkChars(URI.java:2989)
>>> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
>>> 	at java.net.URI$Parser.parse(URI.java:3021)
>>> 	at java.net.URI.<init>(URI.java:578)
>>> 	at java.net.URI.create(URI.java:840)
>>> 	... 20 more
>>>
>>> Total time: 0 seconds
>>> java.lang.IllegalArgumentException
>>> 	at java.net.URI.create(URI.java:842)
>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 	at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> 	at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>>> a:25)
>>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>>> 	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
>>> 	at
>>> org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
>>> 	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
>>> 	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
>>> 	at org.apache.tools.ant.Project.initProperties(Project.java:309)
>>> 	at org.apache.tools.ant.Project.init(Project.java:295)
>>> 	at org.apache.tools.ant.Main.runBuild(Main.java:663)
>>> 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
>>> 	at org.apache.tools.ant.Main.start(Main.java:161)
>>> 	at org.apache.tools.ant.Main.main(Main.java:250)
>>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>> 	at
>>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>>> 	at
>>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>>> a:25)
>>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>>> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
>>> 	at java.lang.Thread.run(Thread.java:595)
>>> Caused by: java.net.URISyntaxException: Illegal character in path at
>>> index 18:
>>> file:/C:/Documents and
>>> Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
>>> 	at java.net.URI$Parser.fail(URI.java:2816)
>>> 	at java.net.URI$Parser.checkChars(URI.java:2989)
>>> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
>>> 	at java.net.URI$Parser.parse(URI.java:3021)
>>> 	at java.net.URI.<init>(URI.java:578)
>>> 	at java.net.URI.create(URI.java:840)
>>> 	... 20 more
>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>> For additional commands, e-mail: users-help@maven.apache.org
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] exec-maven-plugin fails because path containing spaces

Posted by franz see <fr...@gmail.com>.
Good day,

How about using the antrun plugin instead? ( see [1] )

Cheers,
Franz

[1] http://maven.apache.org/plugins/maven-antrun-plugin/


Adrian Herscu-2 wrote:
> 
> Added
> 	<localRepository>C:\DOCUME~1\pm\M2639C~1\REPOSI~1</localRepository>
> 
> to the M2 install settings.xml.
> 
> But, this may require changes in other machines as well :-(
> 
> Phill Moran wrote:
>> Surround them in quotes or use the dos short for. For instance "program
>> files"
>> == "progra~1" 
>> 
>> -----Original Message-----
>> From: news [mailto:news@sea.gmane.org] On Behalf Of Adrian Herscu
>> Sent: April 16, 2007 3:07 PM
>> To: users@maven.apache.org
>> Subject: [m2] exec-maven-plugin fails because path containing spaces
>> 
>> Hi all,
>> 
>> I am trying to run Ant 1.7 from within Maven 2 using the
>> exec-maven-plugin.
>> 
>>        <plugin>
>>          <groupId>org.codehaus.mojo</groupId>
>>          <artifactId>exec-maven-plugin</artifactId>
>>          <executions>
>>            <execution>
>>              <phase>process-test-resources</phase>
>>              <goals>
>>                <goal>java</goal>
>>              </goals>
>>            </execution>
>>          </executions>
>>          <configuration>
>>            <mainClass>org.apache.tools.ant.Main</mainClass>
>>            <workingDirectory>${basedir}</workingDirectory>
>>            <arguments>
>>              <argument>-buildfile</argument>
>>              <argument>${basedir}/mybuild.xml</argument>
>>            </arguments>
>>          </configuration>
>>        </plugin>
>> 
>> It seems that there is a problem with Windows paths containing spaces.
>> Anyone knows about a decent workaround?
>> 
>> Thanks,
>> Adrian.
>> 
>> P.S. The error log:[[
>> 
>> 
>> BUILD FAILED
>> java.lang.IllegalArgumentException
>> 	at java.net.URI.create(URI.java:842)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>> a:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>> 	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
>> 	at
>> org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
>> 	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
>> 	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
>> 	at org.apache.tools.ant.Project.initProperties(Project.java:309)
>> 	at org.apache.tools.ant.Project.init(Project.java:295)
>> 	at org.apache.tools.ant.Main.runBuild(Main.java:663)
>> 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
>> 	at org.apache.tools.ant.Main.start(Main.java:161)
>> 	at org.apache.tools.ant.Main.main(Main.java:250)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>> a:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
>> 	at java.lang.Thread.run(Thread.java:595)
>> Caused by: java.net.URISyntaxException: Illegal character in path at
>> index 18:
>> file:/C:/Documents and
>> Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
>> 	at java.net.URI$Parser.fail(URI.java:2816)
>> 	at java.net.URI$Parser.checkChars(URI.java:2989)
>> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
>> 	at java.net.URI$Parser.parse(URI.java:3021)
>> 	at java.net.URI.<init>(URI.java:578)
>> 	at java.net.URI.create(URI.java:840)
>> 	... 20 more
>> 
>> Total time: 0 seconds
>> java.lang.IllegalArgumentException
>> 	at java.net.URI.create(URI.java:842)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>> a:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>> 	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
>> 	at
>> org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
>> 	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
>> 	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
>> 	at org.apache.tools.ant.Project.initProperties(Project.java:309)
>> 	at org.apache.tools.ant.Project.init(Project.java:295)
>> 	at org.apache.tools.ant.Main.runBuild(Main.java:663)
>> 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
>> 	at org.apache.tools.ant.Main.start(Main.java:161)
>> 	at org.apache.tools.ant.Main.main(Main.java:250)
>> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> 	at
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
>> 	at
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
>> a:25)
>> 	at java.lang.reflect.Method.invoke(Method.java:585)
>> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
>> 	at java.lang.Thread.run(Thread.java:595)
>> Caused by: java.net.URISyntaxException: Illegal character in path at
>> index 18:
>> file:/C:/Documents and
>> Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
>> 	at java.net.URI$Parser.fail(URI.java:2816)
>> 	at java.net.URI$Parser.checkChars(URI.java:2989)
>> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
>> 	at java.net.URI$Parser.parse(URI.java:3021)
>> 	at java.net.URI.<init>(URI.java:578)
>> 	at java.net.URI.create(URI.java:840)
>> 	... 20 more
>> 
>> 
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/-m2--exec-maven-plugin-fails-because-path-containing-spaces-tf3586576s177.html#a10032789
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: [m2] exec-maven-plugin fails because path containing spaces

Posted by Adrian Herscu <bm...@fastmail.fm>.
Added
	<localRepository>C:\DOCUME~1\pm\M2639C~1\REPOSI~1</localRepository>

to the M2 install settings.xml.

But, this may require changes in other machines as well :-(

Phill Moran wrote:
> Surround them in quotes or use the dos short for. For instance "program files"
> == "progra~1" 
> 
> -----Original Message-----
> From: news [mailto:news@sea.gmane.org] On Behalf Of Adrian Herscu
> Sent: April 16, 2007 3:07 PM
> To: users@maven.apache.org
> Subject: [m2] exec-maven-plugin fails because path containing spaces
> 
> Hi all,
> 
> I am trying to run Ant 1.7 from within Maven 2 using the exec-maven-plugin.
> 
>        <plugin>
>          <groupId>org.codehaus.mojo</groupId>
>          <artifactId>exec-maven-plugin</artifactId>
>          <executions>
>            <execution>
>              <phase>process-test-resources</phase>
>              <goals>
>                <goal>java</goal>
>              </goals>
>            </execution>
>          </executions>
>          <configuration>
>            <mainClass>org.apache.tools.ant.Main</mainClass>
>            <workingDirectory>${basedir}</workingDirectory>
>            <arguments>
>              <argument>-buildfile</argument>
>              <argument>${basedir}/mybuild.xml</argument>
>            </arguments>
>          </configuration>
>        </plugin>
> 
> It seems that there is a problem with Windows paths containing spaces.
> Anyone knows about a decent workaround?
> 
> Thanks,
> Adrian.
> 
> P.S. The error log:[[
> 
> 
> BUILD FAILED
> java.lang.IllegalArgumentException
> 	at java.net.URI.create(URI.java:842)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
> 	at
> org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
> 	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
> 	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
> 	at org.apache.tools.ant.Project.initProperties(Project.java:309)
> 	at org.apache.tools.ant.Project.init(Project.java:295)
> 	at org.apache.tools.ant.Main.runBuild(Main.java:663)
> 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
> 	at org.apache.tools.ant.Main.start(Main.java:161)
> 	at org.apache.tools.ant.Main.main(Main.java:250)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.URISyntaxException: Illegal character in path at index 18:
> file:/C:/Documents and
> Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
> 	at java.net.URI$Parser.fail(URI.java:2816)
> 	at java.net.URI$Parser.checkChars(URI.java:2989)
> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
> 	at java.net.URI$Parser.parse(URI.java:3021)
> 	at java.net.URI.<init>(URI.java:578)
> 	at java.net.URI.create(URI.java:840)
> 	... 20 more
> 
> Total time: 0 seconds
> java.lang.IllegalArgumentException
> 	at java.net.URI.create(URI.java:842)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
> 	at
> org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
> 	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
> 	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
> 	at org.apache.tools.ant.Project.initProperties(Project.java:309)
> 	at org.apache.tools.ant.Project.init(Project.java:295)
> 	at org.apache.tools.ant.Main.runBuild(Main.java:663)
> 	at org.apache.tools.ant.Main.startAnt(Main.java:199)
> 	at org.apache.tools.ant.Main.start(Main.java:161)
> 	at org.apache.tools.ant.Main.main(Main.java:250)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
> a:25)
> 	at java.lang.reflect.Method.invoke(Method.java:585)
> 	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
> 	at java.lang.Thread.run(Thread.java:595)
> Caused by: java.net.URISyntaxException: Illegal character in path at index 18:
> file:/C:/Documents and
> Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
> 	at java.net.URI$Parser.fail(URI.java:2816)
> 	at java.net.URI$Parser.checkChars(URI.java:2989)
> 	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
> 	at java.net.URI$Parser.parse(URI.java:3021)
> 	at java.net.URI.<init>(URI.java:578)
> 	at java.net.URI.create(URI.java:840)
> 	... 20 more
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: [m2] exec-maven-plugin fails because path containing spaces

Posted by Phill Moran <pj...@rogers.com>.
Surround them in quotes or use the dos short for. For instance "program files"
== "progra~1" 

-----Original Message-----
From: news [mailto:news@sea.gmane.org] On Behalf Of Adrian Herscu
Sent: April 16, 2007 3:07 PM
To: users@maven.apache.org
Subject: [m2] exec-maven-plugin fails because path containing spaces

Hi all,

I am trying to run Ant 1.7 from within Maven 2 using the exec-maven-plugin.

       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>exec-maven-plugin</artifactId>
         <executions>
           <execution>
             <phase>process-test-resources</phase>
             <goals>
               <goal>java</goal>
             </goals>
           </execution>
         </executions>
         <configuration>
           <mainClass>org.apache.tools.ant.Main</mainClass>
           <workingDirectory>${basedir}</workingDirectory>
           <arguments>
             <argument>-buildfile</argument>
             <argument>${basedir}/mybuild.xml</argument>
           </arguments>
         </configuration>
       </plugin>

It seems that there is a problem with Windows paths containing spaces.
Anyone knows about a decent workaround?

Thanks,
Adrian.

P.S. The error log:[[


BUILD FAILED
java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:842)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
	at
org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
	at org.apache.tools.ant.Project.initProperties(Project.java:309)
	at org.apache.tools.ant.Project.init(Project.java:295)
	at org.apache.tools.ant.Main.runBuild(Main.java:663)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.Main.start(Main.java:161)
	at org.apache.tools.ant.Main.main(Main.java:250)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.URISyntaxException: Illegal character in path at index 18:
file:/C:/Documents and
Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
	at java.net.URI$Parser.fail(URI.java:2816)
	at java.net.URI$Parser.checkChars(URI.java:2989)
	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
	at java.net.URI$Parser.parse(URI.java:3021)
	at java.net.URI.<init>(URI.java:578)
	at java.net.URI.create(URI.java:840)
	... 20 more

Total time: 0 seconds
java.lang.IllegalArgumentException
	at java.net.URI.create(URI.java:842)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.apache.tools.ant.launch.Locator.fromURI(Locator.java:162)
	at
org.apache.tools.ant.launch.Locator.getResourceSource(Locator.java:119)
	at org.apache.tools.ant.launch.Locator.getClassSource(Locator.java:90)
	at org.apache.tools.ant.Project.setAntLib(Project.java:313)
	at org.apache.tools.ant.Project.initProperties(Project.java:309)
	at org.apache.tools.ant.Project.init(Project.java:295)
	at org.apache.tools.ant.Main.runBuild(Main.java:663)
	at org.apache.tools.ant.Main.startAnt(Main.java:199)
	at org.apache.tools.ant.Main.start(Main.java:161)
	at org.apache.tools.ant.Main.main(Main.java:250)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)
	at java.lang.reflect.Method.invoke(Method.java:585)
	at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:271)
	at java.lang.Thread.run(Thread.java:595)
Caused by: java.net.URISyntaxException: Illegal character in path at index 18:
file:/C:/Documents and
Settings/pm/.m2/repository/org/apache/ant/ant/1.7.0/ant-1.7.0.jar
	at java.net.URI$Parser.fail(URI.java:2816)
	at java.net.URI$Parser.checkChars(URI.java:2989)
	at java.net.URI$Parser.parseHierarchical(URI.java:3073)
	at java.net.URI$Parser.parse(URI.java:3021)
	at java.net.URI.<init>(URI.java:578)
	at java.net.URI.create(URI.java:840)
	... 20 more


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org