Maven使用nexus配置,SNAPSHOT版本介绍及发布jar到nexus
2016-06-14 12:17
501 查看
Maven Setting.xml配置
关于发布到nexus仓库中,使用mvn deploy命令
eclipse中配置run configuration中加入deploy参数,如图
发布项目到nexus上在pom.xml中加入
server中配置的用户名密码为nexus中的用户id和密码,注意是id不是name,否则报错,当时也是被坑了个first blood出来..
关于SNAPSHOT版本简单介绍一下
如pom.xml中配置<version>1.0.0-SNAPSHOT</version>
表示快照版本,版本虽为1.0.0,但是每次都会使用最新的版本,参考nexus仓库截图,每次提交都会产生不同的版本号
关于发布到nexus仓库中,使用mvn deploy命令
eclipse中配置run configuration中加入deploy参数,如图
<?xml version="1.0" encoding="utf-8"?> <settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"> <!-- 本地仓库配置 --> <localRepository>D:\java\mavenRepos</localRepository> <pluginGroups> </pluginGroups> <proxies> </proxies> <!-- 服务用户配置 --> <servers> <server> <id>releases</id> <username>deployment</username> <password>cykj</password> </server> <server> <id>snapshots</id> <username>deployment</username> <password>cykj</password> </server> </servers> <!-- 镜像配置 --> <mirrors> <!-- 对snapshots版本有效 --> <mirror> <id>nexusSnapashots</id> <url>http://192.168.2.18:8081/nexus/content/groups/public/</url> <mirrorOf>public-snapshots</mirrorOf> <interval>always</interval> </mirror> <mirror> <id>nexusMirror</id> <name>local repos</name> <url>http://192.168.2.18:8081/nexus/content/groups/public/</url> <mirrorOf>*</mirrorOf> </mirror> </mirrors> <!-- 条件配置 --> <profiles> <profile> <id>nexusRepository</id> <!-- jar包仓库配置 --> <repositories> <repository> <id>nexusSnapashots</id> <name>nexus-snapshots</name> <url>http://192.168.2.18:8081/nexus/content/groups/public/</url> <releases> <enabled>false</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> <layout>default</layout> <snapshotPolicy>always</snapshotPolicy> </repository> <repository> <id>nexusMirror</id> <name>nexus-snapshots</name> <url>http://192.168.2.18:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> </snapshots> <layout>default</layout> <snapshotPolicy>always</snapshotPolicy> </repository> </repositories> <!-- 插件仓库配置 --> <pluginRepositories> <pluginRepository> <id>nexusMirror</id> <name>nexus mirror</name> <url>http://192.168.2.18:8081/nexus/content/groups/public/</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>false</enabled> <updatePolicy>always</updatePolicy> <checksumPolicy>warn</checksumPolicy> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <!-- 激活profile --> <activeProfiles> <activeProfile>nexusRepository</activeProfile> </activeProfiles> </settings>
关于发布到nexus仓库中,使用mvn deploy命令
eclipse中配置run configuration中加入deploy参数,如图
发布项目到nexus上在pom.xml中加入
<distributionManagement> <repository> <id>releases</id> <name>Nexus Releases Repository</name> <url>http://192.168.2.18:8081/nexus/content/repositories/releases/</url> </repository> <snapshotRepository> <id>snapshots</id> <name>Nexus Snapshots Repository</name> <uniqueVersion>false</uniqueVersion> <layout>legacy</layout> <url>http://192.168.2.18:8081/nexus/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement>注意id与setting中server的id保持一致
server中配置的用户名密码为nexus中的用户id和密码,注意是id不是name,否则报错,当时也是被坑了个first blood出来..
关于SNAPSHOT版本简单介绍一下
如pom.xml中配置<version>1.0.0-SNAPSHOT</version>
表示快照版本,版本虽为1.0.0,但是每次都会使用最新的版本,参考nexus仓库截图,每次提交都会产生不同的版本号
关于发布到nexus仓库中,使用mvn deploy命令
eclipse中配置run configuration中加入deploy参数,如图
相关文章推荐
- VMC部署管理:关于无缝升级
- maven学习
- maven插件maven-war-plugin的使用
- jenkins------部署项目到jboss eap下
- maven使用经验集
- java application maven项目打自定义zip包实例(推荐)
- window下安装和配置maven环境
- Eclipse使用maven搭建spring mvc图文教程
- 使用maven+eclipse搭建struts2开发环境
- myeclipse中使用maven前常见错误及解决办法
- Java随手笔记8之包、环境变量和访问控制及maven profile实现多环境打包
- Eclipse 使用Maven构建SpringMVC项目
- maven利用tomcat插件部署远程Linux服务器的步骤详解
- maven搭建java ee项目图文教程
- Java的项目构建工具Maven的配置和使用教程
- maven中下载jar包源码和javadoc的命令介绍
- Web Deploy发布网站及常见问题解决方法(图文)
- 表单重复提交处理总结
- Maven私服配置记录 Nexus
- Docker+Jenkins+GIT+Tomcat实战持续化集成