Repository navigation
Add support for multiple servers. #85
Description
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_PASSWORDThis 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
- Added support for configuring multiple maven repositories with separate usernames and passwords #827, originally associated with duplicate issue Need support for multiple maven repositories #828
- feat: Add structured multi-server Maven credentials input #1037, a structured multiline-input implementation (closed without merge)
Activity
Fixes actions#85. Add support for multiple servers.
Fixes actions#85. Add support for multiple server ids.
Fixes actions#85. Add support for multiple server ids.
MCLonips commentedon Apr 6, 2021
what is the current state of this issue?
perkam commentedon May 10, 2021
Same question here. Is this feature on the roadmap? It would be really useful.
dmitry-shibanov commentedon May 11, 2021
Hello everyone. Unfortunately it's not possible to implement right now, because GitHub does not support multiple parameters for arguments. actions/toolkit#184
torrespro commentedon Nov 11, 2021
https://github.com/marketplace/actions/maven-settings-action
jsoref commentedon Mar 6, 2023
Surely this could be supported with either a
toJSON/fromJSONor by taking a file parameter which contains the relevant content.Andreiasilva1 commentedon Jun 13, 2023
Gostaria de saber como funciona
kevinheins commentedon Jul 18, 2024
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?
roman-bicherschii commentedon Sep 17, 2024
I run into the same issue :-( ! Would be really neat to either
fbonander commentedon Nov 28, 2024
@roman-bicherschii You can use wildcards to access multiple repos
https://maven.pkg.github.com/MyOrg/*