diff options
Diffstat (limited to 'java')
-rw-r--r-- | java/common/pom.xml | 5 | ||||
-rw-r--r-- | java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java | 38 |
2 files changed, 28 insertions, 15 deletions
diff --git a/java/common/pom.xml b/java/common/pom.xml index 25f8550304..0d6e64b0e1 100644 --- a/java/common/pom.xml +++ b/java/common/pom.xml @@ -90,7 +90,10 @@ <param>org.apache.qpidity.transport</param> <param>${specs.dir}/amqp.0-10-preview.xml</param> </params> - <source>${specs.dir}/amqp.0-10-preview.xml</source> + <sources> + <source>${specs.dir}/amqp.0-10-preview.xml</source> + <source>${basedir}/generate</source> + </sources> <timestamp>${generated.path}/generated.timestamp</timestamp> </configuration> <goals> diff --git a/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java b/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java index 50af9c257e..85dffeb4bf 100644 --- a/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java +++ b/java/plugins/src/main/java/org/apache/qpid/plugins/JythonMojo.java @@ -52,7 +52,7 @@ public class JythonMojo extends AbstractMojo * * @parameter */ - private File source; + private File[] sources; /** * Optional timestamp. @@ -63,27 +63,37 @@ public class JythonMojo extends AbstractMojo public void execute() throws MojoExecutionException { - if (source != null && timestamp != null) + boolean stale = true; + + if (sources != null && sources.length > 0 && timestamp != null) { - if (timestamp.lastModified() > source.lastModified()) + stale = false; + for (File source : sources) { - return; + if (source.lastModified() > timestamp.lastModified()) + { + stale = true; + break; + } } } - jython.main(params); - - if (timestamp != null) + if (stale) { - try - { - timestamp.createNewFile(); - } - catch (IOException e) + jython.main(params); + + if (timestamp != null) { - throw new MojoExecutionException("cannot create timestamp", e); + try + { + timestamp.createNewFile(); + } + catch (IOException e) + { + throw new MojoExecutionException("cannot create timestamp", e); + } + timestamp.setLastModified(System.currentTimeMillis()); } - timestamp.setLastModified(System.currentTimeMillis()); } } |