0

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

4

1 回答 1

0

我最终运行了 maven“解包”插件,将模式和绑定文件解包到我当前的项目中,并从那里生成对象。

于 2013-06-20T22:45:40.247 回答