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

[Release Automation] Unify Maven Deploy procedure across CI #1123

Closed
jstastny-cz opened this issue Apr 25, 2024 · 4 comments
Closed

[Release Automation] Unify Maven Deploy procedure across CI #1123

jstastny-cz opened this issue Apr 25, 2024 · 4 comments
Assignees

Comments

@jstastny-cz
Copy link

jstastny-cz commented Apr 25, 2024

At the moment there are several ways how we deploy maven artifacts as part of our builds. This task aims at unifying the approach taken with following considerations:

  1. All Apache KIE maven projects that are to be deployed have org.apache:apache as their (transitive) parent.
  2. Use latest version of the parent, currently 32 (https://github.com/apache/maven-apache-parent/blob/master/pom.xml)
  3. maven-deploy-plugin version is 3.1.1
  4. Our poms need to remove repositories and distributionManagement sections to inherit from apache parent.
    • With exception of those project using SNAPSHOT artifacts as parents (like kogito-apps and kogito-examples do), those would need repositories section with the snapshot repo:
           <repositories>
             <!-- useful to resolve parent pom when it is a SNAPSHOT -->
             <repository>
                <releases>
                  <enabled>false</enabled>
                </releases>
                <id>apache.snapshots</id>
                <name>Apache Snapshot Repository</name>
                <url>https://repository.apache.org/snapshots</url>
              </repository>
            </repositories>
      
  5. Settings.xml contains following auth sections:
    <servers>
      <server>
        <id>apache.releases.https</id>
        <username>${apache.repository.username}</username>
        <password>${apache.repository.password}</password>
      </server>
      <server>
        <id>apache.snapshots.https</id>
        <username>${apache.repository.username}</username>
        <password>${apache.repository.password}</password>
      </server>
    </servers>
    
  6. The deploy command uses following parameters:
    • deploy - plain deploy goal
    • -DdeployAtEnd - deferred deploy after whole project successfully builds
    • -DretryFailedDeploymentCount=5 - to account for occasional failures during transfer
    • -Dapache.repository.username=<username> -Dapache.repository.password=<pass> for both release and snapshot deploys

UPDATED: corrected assumptions about distributionManagement and repositories sections.

@jstastny-cz jstastny-cz self-assigned this Apr 25, 2024
@jstastny-cz
Copy link
Author

jstastny-cz commented Apr 26, 2024

Corrections.

  • Apache parent is this one: https://github.com/apache/maven-apache-parent/blob/master/pom.xml
  • distributionManagement and repositories sections should be sufficient - no need to define any of these in our poms.
  • if we map our settings.xml server ids to apache.releases.https, apache.snapshots.https that should be sufficient.
  • update parent to latest (v 32 at the moment)

@tiagobento
Copy link

@jstastny-cz Question: packages/maven-base has groupId org.kie instead of org.apache.kie. Are both fine? Or should we change it?

@jstastny-cz
Copy link
Author

org.kie should go through, it's a groupid we already use, so is configured. We can then refactor everything when moving to new groupid. But org.apache.kie should work too, let me know which one you prefer I can adjust the existing PR.

@jstastny-cz
Copy link
Author

Project poms were adjusted, what is pending now is the change of deploy operation implementation in CI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🎯 Done
Development

No branches or pull requests

2 participants