我正在尝试生成JAVA类WSDL和XSD,但是当我运行mvn全新安装时,我在日志中看到这些类是从我的第一个插件生成的,但是我的第二个插件只是删除了它们。我的构建部分是这样写的:
<build>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxws-maven-plugin</artifactId>
<version>2.5</version>
<executions>
<execution>
<id>generate-wsdl-to-java</id>
<phase>generate-sources</phase>
<goals>
<goal>wsimport</goal>
</goals>
<configuration>
.
.
.
.
.
</configuration>
<inherited>true</inherited>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jaxb2-maven-plugin</artifactId>
<version>2.4</version>
<inherited>true</inherited>
<executions>
<execution>
<id>generate-xsd-to-java</id>
<phase>generate-sources</phase>
<goals>
<goal>xjc</goal>
</goals>
<configuration>
.
.
.
.
</configuration>
<inherited>true</inherited>
</execution>
</executions>
</plugin>
当我反转插件时,类生成得很好,没有任何东西被重写/删除。如果我愿意,我可以保持这种状态,然后继续前进,但我想知道在这种情况下我做错了什么。我是Maven的新手,所以仍然了解所有的细节。我是不是必须用"pluginManagement“或者类似的东西把它们包起来?
发布于 2019-04-02 19:01:37
这取决于你是如何配置这两个插件的输出文件夹的。
缺省值是${project.build.directory}/generated-sources/wsimport和${project.build.directory}/generated-sources/jaxb,所以我不希望它们不被覆盖。
不管怎样:如果这两个插件都打算在同一阶段运行,那么它们在POM中的顺序就定义了它们的执行顺序--即使是pluginManagement也不会改变这一点。所以这并没有什么错
https://stackoverflow.com/questions/55471775
复制相似问题