Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for multiple servers. #85

Open
drewctaylor opened this issue Jul 30, 2020 · 7 comments · May be fixed by Exhorder6/setup-java#5, NOUIY/setup-java#6, NOUIY/setup-java#17, NOUIY/setup-java#25 or NOUIY/setup-java#43
Labels
feature request New feature or request to improve the current logic

Comments

@drewctaylor
Copy link

Currently, as I understand it, the user may specify only one server, as follows:

- name: Setup Java.
  uses: actions/setup-java@v1
  with:
    java-version: 1.8
    server-id: value-of-server-id
    server-username: SERVER_USERNAME
    server-password: SERVER_PASSWORD

Which produces the following xml in the settings.xml file:

<server>
  <id>value-of-server-id</id>
  <username>value-of-server-username</username>
  <password>value-of-server-password</password>
</server>

However, it would be useful to be able to specify more than one server. For example, this yaml:

- name: Setup Java.
  uses: actions/setup-java@v1
  with:
    java-version: 1.8
    server-list:
      - server-id: value-of-server-id-1
        server-username: SERVER_USERNAME_1
        server-password: SERVER_PASSWORD_1
      - server-id: value-of-server-id-2
        server-username: SERVER_USERNAME_2
        server-password: SERVER_PASSWORD_2

Might produce the following xml in the settings.xml file:

<server>
  <id>value-of-server-id-1</id>
  <username>value-of-server-username-1</username>
  <password>value-of-server-password-1</password>
</server>
<server>
  <id>value-of-server-id-2</id>
  <username>value-of-server-username-2</username>
  <password>value-of-server-password-2</password>
</server>

While it would be valuable in general to be able to specify more than one server, it should be especially valuable in the context of Github, as it seems for now, in order to reference multiple packages from maven.pkg.github.com, the user must reference each package's repository in their pom.xml.

If the above configuration were possible, a user could then reference the artifacts at value-of-server-id-1 and value-of-server-id-2 in their pom.xml as follows:

<dependencies>
  <dependency>
    <groupId>group-id-for-owner</groupId>
    <artifactId>artifact-id-from-repository-1</artifactId>
    <version>version-1</version>
  </dependency>

  <dependency>
    <groupId>group-id-for-owner</groupId>
    <artifactId>artifact-id-from-repository-2</artifactId>
    <version>version-2</version>
  </dependency>
</dependencies>

<repositories>
  <repository>
    <id>value-of-server-id-1</id>
    <name>GitHub Packages</name>
    <url>https://maven.pkg.github.com/owner/artifact-id-from-repository-1</url>
  </repository>
  <repository>
    <id>value-of-server-id-2</id>
    <name>GitHub Packages</name>
    <url>https://maven.pkg.github.com/owner/artifact-id-from-repository-2</url>
  </repository>
</repositories>
drewctaylor pushed a commit to drewctaylor/setup-java that referenced this issue Aug 1, 2020
drewctaylor pushed a commit to drewctaylor/setup-java that referenced this issue Aug 1, 2020
drewctaylor pushed a commit to drewctaylor/setup-java that referenced this issue Aug 1, 2020
@drewctaylor drewctaylor linked a pull request Aug 1, 2020 that will close this issue
@dmitry-shibanov dmitry-shibanov added enhancement feature request New feature or request to improve the current logic labels Jan 14, 2021
@MCLonips
Copy link

MCLonips commented Apr 6, 2021

what is the current state of this issue?

@perkam
Copy link

perkam commented May 10, 2021

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

@dmitry-shibanov
Copy link
Contributor

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

@torrespro
Copy link

https://github.com/marketplace/actions/maven-settings-action

@jsoref
Copy link

jsoref commented Mar 6, 2023

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

@Andreiasilva1
Copy link

Gostaria de saber como funciona

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment