maven 命令行部署到nexus仓库

maven 命令行部署到nexus仓库

1.在maven的配置文件conf.xml中添加私服配置 repositoryId=gzstrong

   
      
          gzstrong
          admin
          admin123
      
  

2.在cmd命令行中输入

  • 打包 spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.M.jar
mvn deploy:deploy-file -DgroupId=org.springframework.cloud -DartifactId=spring-cloud-starter-alibaba-nacos-config -Dversion=0.2.2.RELEASE.M -Dpackaging=jar -Dfile=C:\Users\Administrator\Desktop\spring-cloud-alibaba-nacos-config-0.2.2.RELEASE.M.jar -Durl=http://192.168.197.30:8081/repository/gzstrong/ -DrepositoryId=gzstrong --settings M:\soft\Java\apache-maven-3.0.5\conf\settings.xml
  • 打包 spring-cloud-alibaba-nacos-discovery-0.2.2.RELEASE.M.jar
mvn deploy:deploy-file -DgroupId=org.springframework.cloud -DartifactId=spring-cloud-starter-alibaba-nacos-discovery -Dversion=0.2.2.RELEASE.M -Dpackaging=jar -Dfile=C:\Users\Administrator\Desktop\spring-cloud-alibaba-nacos-discovery-0.2.2.RELEASE.M.jar -Durl=http://192.168.197.30:8081/repository/gzstrong/ -DrepositoryId=gzstrong --settings M:\soft\Java\apache-maven-3.0.5\conf\settings.xml
  • 打包 mybatis-plus-generate-2.3.M.jar
mvn deploy:deploy-file -DgroupId=com.baomidou -DartifactId=mybatis-plus-generate -Dversion=2.3.M -Dpackaging=jar -Dfile=C:\Users\Administrator\Desktop\mybatis-plus-generate-2.3.M.jar  -Durl=http://192.168.197.30:8081/repository/gzstrong/ -DrepositoryId=gzstrong --settings M:\soft\Java\apache-maven-3.0.5\conf\settings.xml

3.如果gradle项目要使用,需要配置在build.gradle文件中添加

repositories {
    maven {
        url = "http://192.168.197.30:8081/repository/maven-public/"
        credentials {
            username 'admin'
            password 'admin123'
        }
    }
}

你可能感兴趣的:(maven 命令行部署到nexus仓库)