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

Allow adding a custom repository to the settings.xml #283

Closed
wimdeblauwe opened this issue May 16, 2023 · 1 comment · Fixed by #319
Closed

Allow adding a custom repository to the settings.xml #283

wimdeblauwe opened this issue May 16, 2023 · 1 comment · Fixed by #319
Labels
enhancement New feature or request.

Comments

@wimdeblauwe
Copy link

Is your feature request related to a problem? Please describe.
Unless I have misunderstood things, I think that this action assumes you add your repository to your pom.xml and just define the authentication part in the settings.xml. However, it is not such a good idea to add custom repository URLs in your Maven build file (See https://blog.sonatype.com/2009/02/why-putting-repositories-in-your-poms-is-a-bad-idea/).

Describe the solution you'd like
I would like a way to have the action generate a settings.xml that has repository entries. Ideally, it would generate something like this:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

  <activeProfiles>
    <activeProfile>github</activeProfile>
  </activeProfiles>

  <profiles>
    <profile>
      <id>github</id>
      <repositories>
        <repository>
          <id>central</id>
          <url>https://repo1.maven.org/maven2</url>
        </repository>
        <repository>
          <id>github</id>
          <url>https://maven.pkg.github.com/MyOrganisation/MyProject</url>
          <snapshots>
            <enabled>true</enabled>
          </snapshots>
        </repository>
      </repositories>
    </profile>
  </profiles>

  <servers>
    <server>
      <id>github</id>
      <username>GITHUB_ACTOR</username>
      <password>GITHUB_TOKEN</password>
    </server>
  </servers>
</settings>
@flo-02-mu
Copy link
Contributor

I made an attempt in #319

@slawekjaranowski slawekjaranowski added the enhancement New feature or request. label Dec 30, 2023
@slawekjaranowski slawekjaranowski linked a pull request Dec 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request.
Development

Successfully merging a pull request may close this issue.

3 participants