Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jaxws-maven-plugin fails with space in temp path #704

Open
palbr opened this issue Jan 15, 2025 · 0 comments
Open

jaxws-maven-plugin fails with space in temp path #704

palbr opened this issue Jan 15, 2025 · 0 comments

Comments

@palbr
Copy link

palbr commented Jan 15, 2025

On a Windows machine, I have a maven project with following pom.xml:

<project>
    <!-- ... -->
    <build>
        <plugins>
            <plugin>
                <groupId>com.sun.xml.ws</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>2.3.7</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsimport</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <wsdlDirectory>${project.basedir}/src/main/resources/META-INF/wsdl</wsdlDirectory>
                    <wsdlFiles>
                        <wsdlFile>myService.wsdl</wsdlFile>
                    </wsdlFiles>
                    <xdebug>true</xdebug>
                </configuration>
            </plugin>
        </plugins>
    </build>
</project>

If the maven build process uses a temp path with spaces, like C:\MyTemp with Spaces\, the jaxws-maven-plugin throws the following exception:

Exception in thread "main" java.io.FileNotFoundException: C:\MyTemp (Das System kann die angegebene Datei nicht finden)
	at java.base/java.io.FileInputStream.open0(Native Method)
	at java.base/java.io.FileInputStream.open(FileInputStream.java:216)
	at java.base/java.io.FileInputStream.<init>(FileInputStream.java:157)
	at org.jvnet.jax_ws_commons.jaxws.Invoker.main(Invoker.java:49)

The line above this exception is:

[DEBUG] cmd.exe /X /C ""C:\Program Files\jdk-17\bin\java.exe" -cp /C:/maven-repository/com/sun/xml/ws/jaxws-maven-plugin/2.3.7/jaxws-maven-plugin-2.3.7.jar org.jvnet.jax_ws_commons.jaxws.Invoker com.sun.tools.ws.wscompile.WsimportTool -pathfile C:\MyTemp with Spaces\jax-ws-mvn-plugin-cp2979622311834687376.txt -keep -s C:\MyProject\target\generated-sources\wsimport -d C:\MyProject\target\classes -encoding UTF-8 -Xnocompile -Xdebug file:/C:/MyProject/src/main/resources/META-INF/wsdl/myService.wsdl"

You can see that the value for -pathfile is not properly quoted or escaped.

You can set the temp path by adding "-Djava.io.tmpdir=C:\MyTemp with Spaces" to your mvn install command.

The build process works well, if I use a temp path without spaces. Like:

mvn clean install "-Djava.io.tmpdir=C:\MyTempWithoutSpaces" -e -X -f pom.xml
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant