Thursday, July 28, 2011

Adding JAXB / jxc support in maven

Put your schemas (*.xsd) and bindings (*.xjb) into the src/main/resources folder.
Correct pom.xml as you add:
<build>
 <plugins>
  <plugin>
   <groupId>org.jvnet.jaxb2.maven2</groupId>
   <artifactId>maven-jaxb2-plugin</artifactId>
   <executions>
    <execution>
     <goals>
      <goal>generate</goal>
     </goals>
     <configuration>
      <args>
       <arg>-nv</arg><!-- this disable strict schema validation -->
      </args>
     </configuration>
    </execution>
   </executions>
  </plugin>
  <plugin>
   <inherited>true</inherited>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <configuration>
    <source>1.5</source>
    <target>1.5</target>
   </configuration>
  </plugin>
 </plugins>
</build>

No comments:

Post a Comment