nexus 3.0后上传jar包方法

mvn deploy:deploy-file -DgroupId=com.example -DartifactId=demo -Dversion=1.0 -Dpackaging=jar -DrepositoryId=nexus -Dfile=C:\Users\Administrator\Desktop\demo.jar -Durl=http://192.168.59.2:8081/repository/maven-releases/ -DgeneratePom=false 

 

 

 

比如:mvn deploy:deploy-file -DgroupId=com.ccb -DartifactId=servlet -Dversion=1.0 -Dpackaging=jar -DrepositoryId=nexus -Dfile=C:\Users\Administrator\Desktop\VerifyAuth.jar -Durl=http://192.168.59.2:8081/repository/maven-releases/ -DgeneratePom=false

 

 

这里的nexus对应mvn配置文件里的setting.xml里的

 

 

 

  <servers>
    <!-- server
     | Specifies the authentication information to use when connecting to a particular server, identified by
     | a unique name within the system (referred to by the 'id' attribute below).
     |
     | NOTE: You should either specify username/password OR privateKey/passphrase, since these pairings are
     |       used together.
     |
    <server>
      <id>deploymentRepo</id>
      <username>repouser</username>
      <password>repopwd</password>
    </server>
    -->

    <!-- Another sample, using keys to authenticate.
    <server>
      <id>siteServer</id>
      <privateKey>/path/to/private/key</privateKey>
      <passphrase>optional; leave empty if not used.</passphrase>
    </server>
    -->
    <server>
	    <id>nexus</id>
	    <username>admin</username>
	    <password>123456</password>
	</server>
  </servers>

 

 

实在不行可以pom.xml里用compile插件,引入jar包


			<plugin>
				<artifactId>maven-compiler-plugin</artifactId>
				<configuration>
					<encoding>UTF-8</encoding>
					<compilerArguments>
						<extdirs>src/main/lib</extdirs>
					</compilerArguments>
				</configuration>
			</plugin>

 

如果要指定settings.xml

mvn -s D:\app\apache-maven-3.2.3\conf\settings.xml deploy:deploy-file 
-DgroupId=com.abc.pay -DartifactId=client -Dversion=3.1.1 -Dpackaging=jar 
-Dfile=C:\Users\dongsw\Desktop\client-3.1.1.jar 
-Durl=http://192.168.59.240:8081/repository/maven-releases/ -DrepositoryId=releases

 

示例

mvn -s C:\Users\Administrator\.m2\settings.xml deploy:deploy-file -DgroupId=com.websocket.goeasy -Durl=http://maven.sxb.lol/repository/maven-releases/ -DartifactId=goeasy-sdk -Dversion=1.0.0  -Dpackaging=jar -Dfile=C:\Users\Administrator\Desktop\goeasy-sdk-0.3.5.jar -DrepositoryId=releases -X

 

注意-DrepositoryId=release跟server的id一致

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值