0
我们正在建设从外部jar文件(该项目)类的外部源文件。 这工作正常,但我们一直未能弄清楚如何也包括外部源文件。我曾尝试使用“< includes>”标签,但最终使用时仅在最终的jar中包含清单文件。我看过使用maven-resources-plugin,但是我用它错了,或者在我的情况下不起作用。这里是我们的代码的副本:如何在包括Maven的JAR-插件
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.4</version>
<executions>
<execution>
<!-- <phase>generate-resources</phase> -->
<phase>clean</phase>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<classesDirectory>${itendant.path}/web/rocket/WEB-INF/classes</classesDirectory>
<finalName>${itendant.jar.name}</finalName>
<outputDirectory>${itendant.jar.path}</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
通过资源我的意思是我想包括罐中的外部文件(* .java)java源文件和类。 – 2012-04-04 16:53:15
我尝试使用像你的例子那样的资源,但它并没有在最终的jar包中包含java源文件。 – 2012-04-04 16:54:42
如果你在'clean'期间构建JAR,它显然不会在'process-resources'中拾取任何东西。把它放在生命周期中的适当位置。 – freeone3000 2012-04-05 19:59:55