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

Source dir is only registered with build if output is not stale #95

Closed glassfishrobot closed 11 years ago

glassfishrobot commented 11 years ago

The source dir with the generated sources is only registered with the current Maven build if the output is stale (and thus, sources re-generated). This causes issues e.g. with v3.0 of maven-compiler-plugin which has a new approach to recompiling where all compiled classes are removed in a project if it is out of sync. If the jaxws generated source dir is then not registered, those classes are not compiled.

The solution is that the generated source dir should always be registered if there are generated classes.

The workaround currently is to execute "mvn clean install" instead of "mvn install", which is not a good Maven experience.

Environment

n/a

Affected Versions

[2.2]

glassfishrobot commented 11 years ago

Reported by ahammar

glassfishrobot commented 11 years ago

ahammar said: I've created a patch containing an IT showing this issue. I don't seem to have permission to attach a file to the ticket, so the patch can be found here: https://dl.dropbox.com/u/5695604/JAX_WS_COMMONS-95_IT.patch

glassfishrobot commented 11 years ago

@lukasj said: http://java.net/projects/jax-ws-commons/sources/svn/revision/1007

glassfishrobot commented 11 years ago

schueffi said: Unfortunately this fix only covers the "local" wsdl files, but does not cover the "via url" wsdl files.

A better patch, which also account for default source folders (with the very same check as in AbstractJaxWsMojo) whould be this one (against the 2.2-version). Please reconsider the patch and improve solutions even if one is using wsdl-via-url.

--- WsImportMojo.java   2013-04-23 09:24:54.802510394 +0200
+++ WsImportMojo.java   2013-04-23 09:37:06.648928867 +0200
@@ -321,6 +321,10 @@
 getLog().info("jaxws:wsimport args: " + args);
 wsImport(args);
 touchStaleFile(url);
+            } else {
+if (!isDefaultSrc(getSourceDestDir()) || keep) {
+    addSourceRoot(getSourceDestDir().getAbsolutePath());
+}
             }
         }
     }
@@ -341,6 +345,10 @@
 getLog().info("jaxws:wsimport args: " + args);
 wsImport(args);
 touchStaleFile(wsdlUrl);
+            } else {
+if (!isDefaultSrc(getSourceDestDir()) || keep) {
+    addSourceRoot(getSourceDestDir().getAbsolutePath());
+}
             }
         }
     }
glassfishrobot commented 11 years ago

@lukasj said: schueffi: good catch!

glassfishrobot commented 11 years ago

@lukasj said: https://java.net/projects/jax-ws-commons/sources/svn/revision/1034

glassfishrobot commented 11 years ago

@lukasj said: closing issues after 2.2.1 release

glassfishrobot commented 7 years ago

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

glassfishrobot commented 11 years ago

Marked as fixed on Monday, May 13th 2013, 4:00:19 am