1、局域网私服

首先保证已经安装配置好了局域网的私服(具体私服的搭建可以查看相关资料)

私服页面访问地址:http://192.168.0.110:8081/nexus,使用admin登录,默认的用户名和密码是:admin/admin123

2、项目的仓库部署配置

1)pom文件中插件配置

 <build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</pluginManagement>
</build>
 <build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
</plugins>
</build>

2)pom文件中私服仓库配置

 <distributionManagement>
<repository>
<id>thirdparty</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/thirdparty/</url>
</repository>
<snapshotRepository>
<id>nexus-snapshots</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/snapshots/</url>
</snapshotRepository>
10 </distributionManagement>

Release版本和Snapshot版本对应的仓库URL,可以在私服的web页面上查看(本文的Release版本都发布到3rd party仓库下面)

View/Repositories -> Repositories -> Repositories Path

3、Maven的settings配置文件

1)配置Servers(项目pom文件中<distributionManagement>标签里面的id要与这里面的id保持一致)

 <servers>
<server>
<id>nexus-releases</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)配置Mirror镜像,配置指向私服

 <mirrors>
<mirror>
<id>nexus</id>
<name>internal nexus repository</name>
<url>http://192.168.0.110:8081/nexus/content/groups/public/</url>
<mirrorOf>*</mirrorOf>
</mirror>
</mirrors>

3)配置仓库描述

 <profile>
<id>dev</id>
<repositories>
<repository>
<id>nexus-releases</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/releases/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>nexus-snapshots</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/snapshots/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>central</id>
<name>Central</name>
<url>http://192.168.0.110:8081/nexus/content/repositories/central/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
<repository>
<id>thirdparty</id>
<url>http://192.168.0.110:8081/nexus/content/repositories/thirdparty/</url>
<releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
</repository>
</repositories>
</profile>

4、工程项目发布

1)执行发布命令

mvn  clean  deploy

2)发布成功之后,可以在页面上查看到刚刚发布的jar包

View/Repositories -> Repositories -> 3rd party -> Browse Index

将maven项目发布到私服的更多相关文章

  1. maven项目如何从私服nexus中下载依赖包

    maven项目如何从私服nexus中下载依赖包   解决方法: 1.打开maven的config目录中settings.xml文件 2.在<profile></profiles> ...

  2. Maven入门指南⑥:将项目发布到私服

    1 . 修改私服中仓库的部署策略 Release版本的项目应该发布到Releases仓库中,对应的,Snapshot版本应该发布到Snapshots仓库中.Maven根据pom.xml文件中版本号&l ...

  3. Maven入门指南12:将项目发布到私服

    1 . 修改私服中仓库的部署策略 Release版本的项目应该发布到Releases仓库中,对应的,Snapshot版本应该发布到Snapshots仓库中.Maven根据pom.xml文件中版本号&l ...

  4. maven项目发布不成功的问题

    MyEclipes   里面有好多的项目,有些项目是插件有些是组件,  就是有些项目是被依赖的项目,有些事项目的主体,被依赖的项目需要打成jar 包放在maven的中央仓库里面,也是所说的maven的 ...

  5. ava Maven项目之Nexus私服搭建和版本管理应用

    目录: Nexus介绍 环境.软件准备 Nexus服务搭建 Java Maven项目版本管理应用 FAQ 1.Nexus介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓库的维 ...

  6. Java Maven项目之Nexus私服搭建和版本管理应用

    转载自:https://cloud.tencent.com/developer/article/1010603 1.Nexus介绍 Nexus是一个强大的Maven仓库管理器,它极大地简化了自己内部仓 ...

  7. maven项目发布到Tomcat丢失jar包

    昨天看了一篇tomcat设置的文章,说要把第一个勾上,这样不需要更新到tomcat.  一启动tomcat就发现丢包.后来在网上看了许多文章,说要update maeven项目,然后你就会发现启动过程 ...

  8. maven项目发布到tomcat后没有lib目录解决方案

    maven项目放入tomcat中时,总是报错,而且这些jar都是真实存在的,错误如下: maven eclipse tomcat java.lang.ClassNotFoundException: o ...

  9. maven项目发布到tomcat的错误

    Could not publish to the server. java.lang.IndexOutOfBoundsException "Updating status for Tomca ...

随机推荐

  1. 深入理解hadoop之HDFS

    深入理解hadoop之HDFS 刚刚才写完关于mapreduce的一篇博文,趁热打铁接下来聊聊HDFS.本博文参考资料为HADOOP权威指南第3版完版,博文如有错漏之处,敬请指正. HDFS即Hado ...

  2. docker容器里面安装php的redis扩展

      docker exec -i -t php /bin/bash 进入php容器内执行:pecl install -o -f redis  修改php.ini,添加:extension=redis. ...

  3. (九)How to use the audio gadget driver

    Contents [hide]  1 Introduction 2 Audio Gadget Driver 1.0 2.1 Enabling the audio gadget driver 2.2 U ...

  4. STM32/EMC/ZILIAO

    https://www.st.com/content/ccc/resource/technical/document/application_note/a2/9c/07/d9/2a/b2/47/dc/ ...

  5. IDEA利用mybatis-generator自动生成dao和mapper

    pom.xml配置 <properties> <java.version>1.8</java.version> <mybatis-generator-core ...

  6. php正则表达式提取数字,字符串中提取数字

    <?php $str = "请注意:有谁知道30901.5号路怎么走?这个因为我买了100块的烧饼和7901的钥匙了,那个对了,我再拿个30000"; $pattern = ...

  7. Linux/Centos查看进程占用内存大小的几种方法总结

    1.命令行输入top回车,然后按下大写M按照memory排序,按下大写P按照CPU排序. 2. ps -ef | grep "进程名"     ps -e -o 'pid,comm ...

  8. 使用 Drag and Drop 给Web应用提升交互体验

    什么是 Drag and Drop (拖放)? 简单来说,HTML5 提供了 Drag and Drop API,允许用户用鼠标选中一个可拖动元素,移动鼠标拖放到一个可放置到元素的过程. 我相信每个人 ...

  9. 1024·程序员节来啦!MyEclipse致敬改变世界的程序猿

    1024·程序员狂欢季 MyEclipse/CodeMix — Java开发利器!现金红包免费领! 快拆开看你的最大优惠券是多少,幸运奖红包翻倍!   (活动期间在线下单的客户才可享受此优惠,过期恢复 ...

  10. HTML实现背景颜色的渐变

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...