maven deploy to Nexus
2016-09-22 17:11
232 查看
Step 1: Write a setting file:
Step 2: In your
Step 3: type the command to deploy to remote Nexus (maven private repository):
wenzhe_nexus_settings.xml, and define the
<servers>tag to specify the nexus admin user password.
<settings> <mirrors> <mirror> <!--This sends everything else to /public --> <id>nexus</id> <mirrorOf>*</mirrorOf> <url>http://nexus-wenzhe.com:8081/nexus/content/groups/public </url> </mirror> </mirrors> <profiles> <profile> <id>nexus</id> <!--Enable snapshots for the built in central repo to direct --> <!--all requests to nexus via the mirror --> <repositories> <repository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> <updatePolicy>always</updatePolicy> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>central</id> <url>http://central</url> <releases> <enabled>true</enabled> </releases> <snapshots> <enabled>true</enabled> </snapshots> </pluginRepository> </pluginRepositories> </profile> </profiles> <activeProfiles> <!--make the profile active all the time --> <activeProfile>nexus</activeProfile> </activeProfiles> <servers> <server> <id>nexus-releases</id> <username>admin</username> <password>wenzhe</password> </server> <server> <id>nexus-snapshots</id> <username>admin</username> <password>wenzhe</password> </server> </servers> </settings>
Step 2: In your
pom.xmlof the build project, add
<distributionManagement>tag to define nexus URL of release and snapshot repository.
<project> ... <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <nexus.url>http://nexus-wenzhe.com:8081/nexus</nexus.url> </properties> <distributionManagement> <repository> <id>nexus-releases</id> <url>${nexus.url}/content/repositories/releases/</url> </repository> <snapshotRepository> <id>nexus-snapshots</id> <url>${nexus.url}/content/repositories/snapshots/</url> </snapshotRepository> </distributionManagement> </project>
Step 3: type the command to deploy to remote Nexus (maven private repository):
mvn clean deploy -s wenzhe_nexus_settings.xml
相关文章推荐
- Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4X
- Maven project deploy to Nexus
- maven deploy到nexus报错:Return code is: 401, ReasonPhrase:Unauthorized
- Maven deploy 部署 jar+pom 到 Nexus 私服
- maven deploy到nexus报错:Return code is: 401, ReasonPhrase:Unauthorized
- maven deploy到nexus报错:Return code is: 401, ReasonPhrase:Unauthorized
- maven deploy到nexus报错:Return code is: 401, ReasonPhrase:Unauthorized
- Hot Deploy maven project from eclipse to tomcat
- Deploy standalone jar to nexus
- 大数据平台搭建之deploy components to nexus
- -Dsvn-revision-number.failOnError=false 解决"svn和maven版本不匹配命令行deploy到nexus私服报错"
- Configure Maven to Download from Nexus
- Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.0:deploy
- Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on p
- 使用maven将项目deploy至nexus
- 将maven项目部署到nexus的repository maven项目,可以通过maven的deploy插件,将之部署到远程服务器上,这样,该项目的artifact,就可以被其他项目通过pom的dep
- maven 中 部署构件至Nexus(mvn deploy)
- Failed to execute goal org.apache.maven.plugins:maven-deploy-plugin:2.7:deploy (default-deploy) on p
- Deploy to Maven Central Repository