Skip to content

Add support for multiple servers. #85

Closed
Closed

Description

@drewctaylor

Summary

Support configuring multiple Maven <server> credential entries in the generated settings.xml during one setup-java run.

Today the action's legacy server-id, server-username, and server-password inputs describe only one server. That prevents workflows from configuring credentials for multiple registries or for separate release and snapshot repositories without generating or patching settings.xml themselves.

Use cases

  • Separate release and snapshot repositories in Artifactory, Nexus, or another private registry.
  • Multiple GitHub Packages repositories requiring distinct server IDs.
  • Publishing or resolving artifacts against multiple authenticated Maven repositories in the same workflow.

Proposed behavior

Add a structured multiline input for multiple server definitions, with one independent server ID, username environment-variable name, and password environment-variable name per entry. For example:

mvn-server-credentials: |
  releases:RELEASES_USERNAME:RELEASES_PASSWORD
  snapshots:SNAPSHOTS_USERNAME:SNAPSHOTS_PASSWORD

This should generate:

<servers>
  <server>
    <id>releases</id>
    <username>${env.RELEASES_USERNAME}</username>
    <password>${env.RELEASES_PASSWORD}</password>
  </server>
  <server>
    <id>snapshots</id>
    <username>${env.SNAPSHOTS_USERNAME}</username>
    <password>${env.SNAPSHOTS_PASSWORD}</password>
  </server>
</servers>

The implementation should validate malformed entries and duplicate server IDs.

Compatibility

Existing workflows using server-id, server-username, and server-password must continue to work unchanged when the structured input is not set.

Scope

This issue covers credentials in Maven <servers>. Configuring repository URLs and dependency resolution through <profiles> and <repositories> is complementary work tracked in #1054.

Prior work

Activity

  1. added 3 commits that reference this issue on Aug 1, 2020
    2b68012
    28e454b
    2a3b137
  2. MCLonips commented on Apr 6, 2021

    @MCLonips

    what is the current state of this issue?

  3. perkam commented on May 10, 2021

    @perkam

    Same question here. Is this feature on the roadmap? It would be really useful.

  4. dmitry-shibanov commented on May 11, 2021

    @dmitry-shibanov
    Contributor

    Hello everyone. Unfortunately it's not possible to implement right now, because GitHub does not support multiple parameters for arguments. actions/toolkit#184

  5. torrespro commented on Nov 11, 2021

    @torrespro
  6. jsoref commented on Mar 6, 2023

    @jsoref
    Contributor

    Surely this could be supported with either a toJSON / fromJSON or by taking a file parameter which contains the relevant content.

  7. Andreiasilva1 commented on Jun 13, 2023

    @Andreiasilva1

    Gostaria de saber como funciona

  8. kevinheins commented on Jul 18, 2024

    @kevinheins

    This would be really helpful to have. @IvanZosimov you closed the duplicate #427, can you provide an update or ping who can push this forward?

  9. roman-bicherschii commented on Sep 17, 2024

    @roman-bicherschii

    I run into the same issue :-( ! Would be really neat to either

    1. be able to configure multiple servers,
    2. or to access all packages of a given organization via single organization's server: eg: https://maven.pkg.github.com// over https://maven.pkg.github.com//
  10. fbonander commented on Nov 28, 2024

    @fbonander

    @roman-bicherschii You can use wildcards to access multiple repos

    https://maven.pkg.github.com/MyOrg/*

  11. added
    mavenMaven settings, toolchains, and publishing auth
    on Jun 22, 2026
  12. self-assigned this
    on Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

feature requestNew feature or request to improve the current logicmavenMaven settings, toolchains, and publishing auth

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions