diff --git a/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java b/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java index 632a6d40..ca402fee 100644 --- a/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java +++ b/src/main/java/org/codehaus/mojo/jaxb2/javageneration/AbstractJavaGeneratorMojo.java @@ -224,6 +224,26 @@ public abstract class AbstractJavaGeneratorMojo extends AbstractJaxbMojo { @Parameter(defaultValue = "false") protected boolean readOnly; + /** + *
List of plugins that should be enabled.
+ *
+ *
+ * <configuration>
+ * ...
+ * <plugins>
+ * <plugin>fluent-api</plugin>
+ * <plugin>inheritance</plugin>
+ * </plugins>
+ * </configuration>
+ *
+ *
+ * The arguments configured above yields the following extra arguments to the XJC command:
+ * -Xfluent-api -Xinheritance
List of ordered extra arguments to the XJC command. Each extra argument is interpreted as a word, intended * to be copied verbatim to the XJC argument list with spaces in between:
@@ -634,6 +654,10 @@ private String[] getXjcArguments(final String classPath, final String episodeFil builder.withNamedArgument("catalog", FileSystemUtilities.getCanonicalPath(catalog)); } + if (plugins != null) { + builder.withPrefixedArguments("X", plugins); + } + if (arguments != null) { builder.withPreCompiledArguments(arguments); } diff --git a/src/main/java/org/codehaus/mojo/jaxb2/shared/arguments/ArgumentBuilder.java b/src/main/java/org/codehaus/mojo/jaxb2/shared/arguments/ArgumentBuilder.java index d7393f2b..c50fa77b 100644 --- a/src/main/java/org/codehaus/mojo/jaxb2/shared/arguments/ArgumentBuilder.java +++ b/src/main/java/org/codehaus/mojo/jaxb2/shared/arguments/ArgumentBuilder.java @@ -180,6 +180,31 @@ public ArgumentBuilder withNamedArgument(final String name, final String value) return this; } + /** + * Adds the supplied prefixed arguments in the same order as they were given. + * + * @param prefix The prefix to add. + * @param values A non-null List holding arguments. + * @return This ArgumentBuilder, for chaining. + */ + public ArgumentBuilder withPrefixedArguments(String prefix, final List