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. left join 和 inner join 区别和优化

    关联查询总结,left join 和 inner join 区别和优化 一直以来都没有细细的研究 left join 和 inner join,现在发觉要做优化还真的是要熟悉它们的区别才行. 原谅转载 ...

  2. React学习——子组件给父组件传值

    //子组件 var Child = React.createClass({ render: function(){ return ( <div> 请输入邮箱:<input onCha ...

  3. -bash: ls: No such file or directory 错误的原因及解决办法

    ubuntu出现如下错误: { Welcome to Ubuntu 16.04.5 LTS (GNU/Linux 4.15.0-42-generic x86_64) * Documentation: ...

  4. 微信小程序音乐播放器

    写在前面 1.入门几天小白的作品,希望为您有帮助,有好的意见或简易烦请赐教 2.微信小程序审核音乐类别已经下架,想要发布选题需慎重.附一个参考链接,感谢https://www.hishop.com.c ...

  5. layui 数据表格自适应高度

    添加css .layui-table-cell { height: inherit; } .layui-table-cell { height: inherit;}

  6. 【转】(深入理解计算机系统) bss段,data段、text段、堆(heap)和栈(stack)

    bss段: bss段(bss segment)通常是指用来存放程序中未初始化的全局变量的一块内存区域. bss是英文Block Started by Symbol的简称. bss段属于静态内存分配. ...

  7. 内嵌tomcat快速入门

    1.依赖 <!--Java语言操作tomcat --> <dependency> <groupId>org.apache.tomcat.embed</grou ...

  8. java8学习之Supplier与函数式接口总结

    Supplier接口: 继续学习一个新的函数式接口--Supplier,它的中文意思为供应商.提供者,下面看一下它的javadoc: 而具体的方法也是相当的简单,就是不接受任何参数,返回一个结果: 对 ...

  9. 转载一篇c++开源框架和库

    值得学习的C语言开源项目 -1. Webbench Webbench是一个在linux下使用的非常简单的网站压测工具.它使用fork()模拟多个客户端同时访问我们设定的URL,测试网站在压力下工作的性 ...

  10. IO框架:asyncio 上篇

    如何定义/创建协程 只要在一个函数前面加上 async 关键字,这个函数对象是一个协程,通过isinstance函数,它确实是Coroutine类型. from collections.abc imp ...