mvn install把代码安装到本地仓库

  1. 在pom.xm文件中增加以下配置

<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>

在项目根目录下运行以下命令:

mvn clean source:jar install -Dmaven.test.skip=true


你可能感兴趣的:(maven,Install,source)