I ended up running the maven "unpack" plugin to unpack the schema and binding files in to my current project, and generated objects from there.
Maven xjb Access external schema directory
質問
I am planning to use the 'jaxb2-maven-plugin' and generate objects out of the schema.
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>1.3</version>
<executions>
<execution>
<id>schemaObjs</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
<schemaDirectory>C:\workspace\com\myorg\project-name\schemas</schemaDirectory>
<packageName>com.myorg.project.domain</packageName>
<staleFile>${project.build.directory}/generated-sources/sta/.myStaleFlag</staleFile>
<outputDirectory>${project.build.directory}/generated-sources/schemaobjects</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
The problem is that the schema directory is under a different project. I am defining a <dependency>
on that project, but can't figure out how to specify the directory path in <schemaDirectory>
for this other project (I don't want to traverse the directory structure using ../)
Thanks for the help
解決
所属していません StackOverflow