我想使用maven-resources-plugin复制一个excel,并使用exec-maven-plugin从该excel创建一些属性文件。并且新创建的属性需要附加到构建中。我可以创建属性文件,但这些属性文件没有包含在构建中(Jar)。有人能帮我解决这个问题吗?或者有没有办法做到这一点。
发布于 2018-11-03 00:28:42
您必须创建maven-resources-plugin的多个执行,并将它们分配给a different phase。
例如,您可以这样做:
generate-resources阶段:您需要doprocess-resources阶段的第一件事:处理resourceprepare-package阶段的exec-maven-plugin:无论运行maven-resources-plugin (再一次)您想要的是你可以选择对插件所做的事情有意义的阶段,你可以采取一些自由的方式让它工作。
您可以像这样配置执行:
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<executions>
<execution>
<id>first</id>
<phase>generate-resources</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
...
</configuration>
</execution>
<execution>
<id>second</id>
<phase>prepare-package</phase>
...
</execution>
</executions>
</plugin>
...https://stackoverflow.com/questions/53114548
复制相似问题