[转] maven中如何打包源代码
原帖地址:http://blog.csdn.net/symgdwyh/article/details/4407945
1、The source plugin can be used to create a jar file of the project sources from the command line or by binding the goal to the project's build lifecycle. To generate the jar from the command line, use the following command:
mvn source:jar
mvn source:test-jar
<build> <plugins> <plugin> <artifactId>maven-source-plugin</artifactId> <version>2.1</version> <configuration> <attach>true</attach> </configuration> <executions> <execution> <phase>compile</phase> <goals> <goal>jar</goal> </goals> </execution> </executions> </plugin> </plugins> </build>