[ 
https://issues.apache.org/jira/browse/MNG-8380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17898699#comment-17898699
 ] 

Tamas Cservenak edited comment on MNG-8380 at 11/15/24 5:53 PM:
----------------------------------------------------------------

This could basically allow proper indirection, where repo using ID remains as 
is, while server element could denote a "real server" and just "map" repoIDs 
onto server, as we already have this: projects like plexus, takari, 
maveniverse, etc are all in fact deployed to same oss.sonatype.org...  while 
the repoID usually comes from parent POM where deployment is defined...

{noformat}

<settings>
  <server>
    <id>oss.sonatype.org</id>
    <aliases>
      <alias>plexus-release</alias>
      <alias>maveniverse-release</alias>
      <alias>takari-release</alias>
    </aliases>
    ...
  </server>
{noformat}


was (Author: cstamas):
This could basically allow proper indirection, where repo using ID remains as 
is, while server element could denote a "real server" and just "map" repoIDs 
onto server, as we already have this: projects like plexus, takari, 
maveniverse, etc are all in fact deployed to same oss.sonatype.org...  while 
the repoID usually comes from parent POM where deployment is defined...

{noformat}

<settings>
  <server>
    <id>oss.sonatype.org</id>
    <aliases>
      <alias>plexus-release</alias>
      <alias>takari-release</alias>
    </aliases>
    ...
  </server>
{noformat}

> Allow Repositories and Mirrors To Delegate Credentials To A <server>
> --------------------------------------------------------------------
>
>                 Key: MNG-8380
>                 URL: https://issues.apache.org/jira/browse/MNG-8380
>             Project: Maven
>          Issue Type: Improvement
>          Components: Artifacts and Repositories, Settings
>    Affects Versions: 3.9.9
>            Reporter: Robert Krajewski
>            Priority: Major
>              Labels: DRY, credentials, mirror, mirrorOf, repository, servers, 
> settings
>
> As far as I can tell from the current documentation and the behavior of Maven 
> 3.9.9, mirrors and repositories need authentication are still obliged to rely 
> on a server element of the same id as the repository for each repository or 
> mirror that needs credentials. If this is not the case, please document a 
> solution that does not require such repetition, otherwise please take a look 
> at the discussion at 
> [https://stackoverflow.com/questions/17511469/setting-a-single-server-credentials-in-maven-for-multiple-repositories]
> If there is no proposal, what I'd suggest is that an element like 
> <referenceServerId> (or something like that) contained in a <mirror> or 
> <repository> element, which if present, directs Maven to use the credentials 
> used in the referenced <server> with the <id> given by <referenceServerId>. 
> That server *must* be present in the settings environment. Otherwise the 
> older behavior of using a <server> with the same <id> as the mirror or 
> repository applies.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to