javaee / metro-jaxws-commons

Metro has been contributed to Eclipse Foundation. This repository is for legacy review only. Please refer to the Eclipse EE4J Metro project for the very latest
https://eclipse-ee4j.github.io/metro-wsit/
Other
10 stars 9 forks source link

jaxws-maven-plugin: Binding files can not be found if path contains encoded charecters like %2f #137

Open glassfishrobot opened 8 years ago

glassfishrobot commented 8 years ago

We have git feature branches that follow the git-flow naming pattern 'feature/somefeature'. On our Jenkins buildserver the / gets encoded to %2f so it is stored in a directory '/some/path/feature%2fsomefeature'.

Now the jaxws-maven-plugin decodes this one step to far when looking for binding files, it looks for binding files in '/some/path/feature/somefeature/' which does not exist, it should look in 'some/path/feature%2fsomefeature/'.

The wsdl files are found correctly, so I made a patch that looks for the binding files the same way as for the wsdl files:

diff --git a/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java b/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java index 3bd6003..b4fb7dd 100644 — a/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java +++ b/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java @@ -475,7 +475,7 @@ abstract class WsImportMojo extends AbstractJaxwsMojo

for (File binding : bindings)

{ args.add("-b"); - args.add("'" + binding.getAbsolutePath() + "'"); + args.add("'" + binding.toURI() + "'"); }

getLog().debug( "jaxws:wsimport args: " + args ); –

Environment

linux, windows, java6, java8

Affected Versions

[2.3]

glassfishrobot commented 8 years ago

Reported by boerh1

glassfishrobot commented 8 years ago

boerh1 said: Forgot the formatting, this reads better:

diff --git a/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java b/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java
index 3bd6003..b4fb7dd 100644
--- a/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java
+++ b/src/main/java/org/jvnet/jax_ws_commons/jaxws/WsImportMojo.java
@@ -475,7 +475,7 @@ abstract class WsImportMojo extends AbstractJaxwsMojo

         for (File binding : bindings) {
             args.add("-b");
-            args.add("'" + binding.getAbsolutePath() + "'");
+            args.add("'" + binding.toURI() + "'");
         }

         getLog().debug( "jaxws:wsimport args: " + args );
--
glassfishrobot commented 7 years ago

This issue was imported from java.net JIRA JAX_WS_COMMONS-137