我正在使用 Maven 程序集插件将我的 Java 项目的二进制文件打包到一个胖 jar 中(使用 jar-with-dependencies 描述符)。这工作得很好。
问题:我怎样才能在编译的类文件旁边包含我的项目的源文件?我试图查看 Maven 文档以了解如何执行此操作,但找不到任何东西。
谢谢!
我的 pom.xml 看起来像这样:
<project>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>1.6</source>
<target>1.6</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-assembly-plugin</artifactId>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<finalName>${pom.artifactId}-${pom.version}</finalName>
<appendAssemblyId>false</appendAssemblyId>
<outputDirectory>${project.basedir}/bin/</outputDirectory>
</configuration>
</plugin>
</plugins>
</build>
</project>