Skip to content

Instantly share code, notes, and snippets.

@ricston-git
Created January 4, 2013 10:40
Show Gist options
  • Save ricston-git/4451584 to your computer and use it in GitHub Desktop.
Save ricston-git/4451584 to your computer and use it in GitHub Desktop.
Using xjc plugin in a project.
<project ...>
...
<build>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings
only. It has no influence on the Maven build itself. -->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
org.jvnet.jaxb2.maven2
</groupId>
<artifactId>
maven-jaxb2-plugin
</artifactId>
<versionRange>
[0.8.0,)
</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore></ignore>
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory>
<generatePackage>com.ricston.blog.data</generatePackage>
<extension>true</extension>
<args>
<arg>-Xexample-plugin</arg>
</args>
<plugins>
<plugin>
<groupId>com.ricston</groupId>
<artifactId>xjc-plugin-blog</artifactId>
<version>0.0.1-SNAPSHOT</version>
</plugin>
</plugins>
</configuration>
</plugin>
</plugins>
</build>
...
</project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment