maven 上传jar 包含源码
1、pom配置如下
<build>
<plugins>
<!-- 要将源码放上去,需要加入这个插件 -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
<executions>
<execution>
<phase>compile</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
2、depoly.cmd
mvn clean install deploy:deploy-file ^
-DgroupId=com.iflytek.icourt ^
-DartifactId=common-service ^
-Dversion=1.0.0-SNAPSHOT ^
-Dpackaging=jar ^
-Dfile=target/common-service-1.0.0-SNAPSHOT.jar ^
-DpomFile=pom.xml ^
-Durl=http://pl.maven.iflytek.com/nexus/content/repositories/court-snapshot/ ^
-DrepositoryId=court-snapshot ^
-Dmaven.test.skip=true -e
cmd
3、maven的config中settings.xml的配置
因为nexus是需要登陆操作,当然可以通过配置免登陆,这是后话。
在settings.xml的<servers></servers>
<server>
<id>thirdparty</id>
<username>admin</username>
<password>admin123</password>
</server>