2 回答

TA貢獻1772條經驗 獲得超6個贊
我會像你一樣嘗試它......但也許資源插件在實際應用之前擴展了它的“包含”方式(這將是恥辱)。但我不知道,我會嘗試在日志中追蹤它。
如果您無法完成這項工作,您仍然可以通過 maven antrun 插件使用舊的 Ant 復制目標

TA貢獻1866條經驗 獲得超5個贊
起初我嘗試使用這個:
<plugin>
<!-- copy jarfiles straight to ../server/plugins so we can test
the plugin without having to move them ourselves -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.3.1</version>
<configuration>
<outputDirectory>${basedir}/../server/plugins</outputDirectory>
</configuration>
</plugin>
但它不適用于 jar-with-dependencies。
所以現在我用這個:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<phase>install</phase>
<configuration>
<target>
<copy file="${project.build.directory}/${project.artifactId}-${project.version}.jar" todir="${project.basedir}/../jarfiles" />
</target>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
添加回答
舉報