diff --git a/pom.xml b/pom.xml
index fbeac4ad89..03efc1560b 100644
--- a/pom.xml
+++ b/pom.xml
@@ -87,6 +87,7 @@
3.1.4
1.7.0
3.6.1
+ 3.2.0
3.4.2
3.2.0
3.15.2
diff --git a/quickfixj-codegenerator/src/main/java/org/quickfixj/codegenerator/GenerateMojo.java b/quickfixj-codegenerator/src/main/java/org/quickfixj/codegenerator/GenerateMojo.java
index 5faeef257c..b192309250 100644
--- a/quickfixj-codegenerator/src/main/java/org/quickfixj/codegenerator/GenerateMojo.java
+++ b/quickfixj-codegenerator/src/main/java/org/quickfixj/codegenerator/GenerateMojo.java
@@ -93,6 +93,13 @@ public class GenerateMojo extends AbstractMojo {
@Parameter(defaultValue = "true")
private boolean overwrite = true;
+ /**
+ * Skip the code generation if true.
+ * Useful for incremental builds when source files haven't changed.
+ */
+ @Parameter(property = "codegen.skip", defaultValue = "false")
+ private boolean skip = false;
+
/**
* The Maven project to act upon.
*/
@@ -111,6 +118,11 @@ public class GenerateMojo extends AbstractMojo {
*/
public void execute() throws MojoExecutionException {
+ if (skip) {
+ getLog().info("Skipping code generation (codegen.skip = true)");
+ return;
+ }
+
if (!outputDirectory.exists()) {
FileUtils.mkdir(outputDirectory.getAbsolutePath());
}
diff --git a/quickfixj-messages/quickfixj-messages-all/pom.xml b/quickfixj-messages/quickfixj-messages-all/pom.xml
index 82540700c1..9ee966c20c 100644
--- a/quickfixj-messages/quickfixj-messages-all/pom.xml
+++ b/quickfixj-messages/quickfixj-messages-all/pom.xml
@@ -82,6 +82,8 @@
${project.build.directory}/generated-sources
true
false
+
+ ${codegen.uptodate}
@@ -110,6 +112,8 @@
${project.build.directory}/generated-sources
true
false
+
+ ${codegen.uptodate}
@@ -247,6 +251,14 @@
org.quickfixj
quickfixj-codegenerator
${project.version}
+
+
+ ${codegen.uptodate}
+
fix40
@@ -346,13 +358,19 @@
-
+
org.apache.maven.plugins
maven-antrun-plugin
- 3.2.0
+ ${maven-antrun-plugin-version}
+ delete-base-classes
process-sources
run
@@ -413,13 +431,64 @@
+
+
+ check-codegen-uptodate
+ initialize
+
+ run
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ create-codegen-marker-file
+ generate-sources
+
+ run
+
+
+
+
+
+
+
+
+
org.codehaus.mojo
build-helper-maven-plugin
+
+ add-source
process-sources
add-source
diff --git a/quickfixj-messages/quickfixj-messages-fixt11/pom.xml b/quickfixj-messages/quickfixj-messages-fixt11/pom.xml
index ee4340badc..96680e2389 100644
--- a/quickfixj-messages/quickfixj-messages-fixt11/pom.xml
+++ b/quickfixj-messages/quickfixj-messages-fixt11/pom.xml
@@ -68,7 +68,7 @@
org.apache.maven.plugins
maven-antrun-plugin
- 3.2.0
+ ${maven-antrun-plugin-version}
process-sources