• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录

cynchanpin

  • 博客园
  • 联系
  • 订阅
  • 管理

View Post

eclipse中maven插件上传项目jar包到私服

我们知道,每一个公司都会有自己的工具包或公共包。这样的包就能够上传到公司的maven私服,就不用每一个人都去同步开发包了。

那么,怎么把本地项目打包并公布到私服呢?依照例如以下步骤就能够轻松完毕。

1.  在setting.xml文件里添加例如以下内容:

 <servers>
    <server>
      <!-- 公布的位置在POM中配置。以ID为关联,有非常多公用的信息须要配置在POM文件中,最佳实践是定义一个公司级别的root pom -->
      <id>nexus</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
    <server>
      <id>nexus-snapshots</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
	<server>
      <id>thirdparty</id>
      <username>admin</username>
      <password>admin123</password>
    </server>
  </servers>


2. 在项目的pom.xml文件里添加例如以下内容

  <distributionManagement>
	<repository>
	    <id>nexus</id>
	    <name>local private nexus</name>
	    <url>http://192.168.xx.xx:8081/nexus/content/groups/public</url>
	</repository>
	<snapshotRepository>
	    <id>nexus-snapshots</id>
	    <name>local private nexus snapshots</name>
	    <url>http://192.168.xx.xx:8081/nexus/content/groups/public-snapshots</url>
	</snapshotRepository>
  </distributionManagement> 
<span style="font-family: Arial, Helvetica, sans-serif; background-color: rgb(255, 255, 255);"> </span>

3.  在项目的 maven bulider中的Goals输入例如以下内容

deploy:deploy-file -DgroupId=com.ivifi.tools -DartifactId=ivifi.tools -Dversion=1.0-SNAPSHOT -Dpackaging=jar -Dfile=D:\git\tools\visn.tools\target\ivifi.tools-1.0-SNAPSHOT.jar  -Durl=http://192.168.xx.xx:8081/nexus/content/repositories/thirdparty/ -DrepositoryId=thirdparty

posted on 2017-05-19 09:14  cynchanpin  阅读(1421)  评论(0)    收藏  举报

刷新页面返回顶部
 
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3