pass string with white space using commandlineArgs in maven commandlineArgs plugin

StackOverflow https://stackoverflow.com/questions/11544581

  •  21-06-2021
  •  | 
  •  

Pregunta

Is it possible to add double quote to the commandlineArgs of the maven mojo plugin?
On the batch i have %1 - getting just first part of the string until the first white space


I tried quot: " but it didnt help
e.g. <commandlineArgs>"path"</commandlineArgs>


I tried &quot ; <commandlineArgs>&quot;path&quot;</commandlineArgs>
But i am getting:

Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec

        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>exec-maven-plugin</artifactId>
            <version>1.2</version>
            <executions>
                <execution>
                    <id>export_objects</id>
                    <phase>package</phase>
                    <goals>
                        <goal>exec</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <executable>export_obj.bat</executable>
                <commandlineArgs>###LONG PATH WITH SPACE###</commandlineArgs>   
            </configuration>
        </plugin>
¿Fue útil?

Solución

Use XML CDATA:

<commandlineArgs><![CDATA[###LONG PATH WITH SPACE###]]></commandlineArgs>

or:

<arguments><argument><![CDATA[###LONG PATH WITH SPACE###]]></argument></arguments>
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top