Sonatype Nexus: How to set a single server credentials for multiple repositories in maven's settings.xml?

后端 未结 3 1527
旧巷少年郎
旧巷少年郎 2021-02-06 06:08

We have multiple repositories in Nexus (i.e., releases, snapshot and site). All 3 repos are under public group and users uses the same credentials to access all these repositori

3条回答
  •  隐瞒了意图╮
    2021-02-06 06:49

    Just use one entry in setttings.xml like that

       
        nexus   
        deployment   
        deployment123      
      
    

    and then in distributionManagement in your pom.xml's you use something like that

    
    
      nexus
      Nexus Releases
      http://localhost:8081/nexus/content/repositories/releases
    
    
      nexus
      Nexus Snapshot
      http://localhost:8081/nexus/content/repositories/snapshots
    
    
    

    For fully working setup with this look at the Nexus Book Examples project that are used in the trial guide. You can add a site with the same id as well, of course. Keep in mind that there is no problem if the id;s are the same as they just detail the identifier of the server element in settings to look for and are NOT an id element for the repository. Imho it should be called serverId or something to be clearer, but thats a different story.

提交回复
热议问题