maven将jar包和源码一起打包到本地仓库

http://stackoverflow.com/questions/4031987/how-to-upload-sources-to-local-maven-repository


<project>
  ...
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-source-plugin</artifactId>
        <version>2.1.2</version>
        <executions>
          <execution>
            <id>attach-sources</id>
            <phase>verify</phase>
            <goals>
              <goal>jar-no-fork</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  ...
</project>


mvn clean source:jar install

你可能感兴趣的:(maven)