Infrastructure with maven, Jenkins, Nexus

前端 未结 5 1392
遥遥无期
遥遥无期 2020-12-12 21:16

We are using maven. I want to set up infrastructure, so that automatically built artifacts would go to Nexus repository. And then they could be used by developers.

I

5条回答
  •  借酒劲吻你
    2020-12-12 21:44

    update pom.xml

     
        ...
        
          deploymentRepo
          Internal Releases
          http://nexusserver:8081/nexus/content/repositories/releases
        
        ...
      
    

    then for maven ~/.m2/settings.xml add (this is default deployment user in Nexus)

    
      deploymentRepo
      deployment
      deployment123
     
    

    then mvn deploy

    Then it is possible to use deployed artifact in any project, just as standard artifacts. In this case add to pom.xml

    
        
            deploymentRepoReleases
            Releases (Nexus)
            http://nexusserver:8081/nexus/content/repositories/releases/
        
        
            deploymentRepoSnapshots
            Snapshots (Nexus)
            http://nexusserver:8081/nexus/content/repositories/snapshots/
        
    

    UPDATE: Later we went away from Snapshot repositories and were using maven-release-plugin that only needs repositories of release type.

提交回复
热议问题