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

feat: publish jvm artifacts #2640

Merged
merged 20 commits into from
Sep 11, 2024
Merged

feat: publish jvm artifacts #2640

merged 20 commits into from
Sep 11, 2024

Conversation

tomdaffurn
Copy link
Contributor

Closes #2636

mistermoe and others added 2 commits September 9, 2024 22:59
@github-actions github-actions bot changed the title [WIP] Jvm publish feat: [WIP] Jvm publish Sep 10, 2024
@mistermoe mistermoe changed the title feat: [WIP] Jvm publish feat: publish jvm artifacts Sep 10, 2024
@mistermoe
Copy link
Collaborator

Summary

This PR introduces the changes needed to publish all jvm artifacts to maven central as part of the pre-existing release github workflow

Note

this is the first of a few PRs to set up jvm artifact publishing with all bells & whistles

JVM Artifacts

  • ftl-build-parent
  • ftl-build-parent-java
  • ftl-build-parent-kotlin
  • ftl-java-runtime
  • ftl-java-runtime-deployment
  • ftl-java-runtime-parent
  • ftl-jvm-bom
  • ftl-jvm-parent
  • ftl-jvm-runtime
  • ftl-jvm-runtime-deployment
  • ftl-jvm-runtime-integration-tests
  • ftl-jvm-runtime-parent
  • ftl-jvm-test-framework
  • ftl-kotlin-runtime
  • ftl-kotlin-runtime-deployment
  • ftl-kotlin-runtime-parent

Changes

  • added maven_settings.xml which configures authentication for Maven to access different artifact repositories
  • added profile that can be used to sign artifacts during the build process. It activates the sign-maven-plugin, which automatically signs the project's artifacts. This is required when
    deploying to Maven Central or other repositories that mandate signed artifacts for security and authenticity verification. Activate this profile when you need to create signed releases, usually in conjunction with the deployment to public repositories.
  • added profile used to deploy artifacts to Maven Central via OSSRH (OSS Repository Hosting). It configures the nexus-staging-maven-plugin for automated deployment and release, and sets up the distribution management for both snapshot and release repositories. Activate this profile when deploying open-source projects to Maven Central.
  • specified snapshot and release repositories
  • Included groundwork for mirroring all artifacts and caching all third party dependencies in artifactory in a subsequent PR
  • added job to pre-existing release github workflow to publish all jvm artifacts for each version bump

Considerations

Move jvm artifact publishing into a separate github workflow

benefits of this would be the ability to publish artifacts independent of releases. this can be helpful in scenarios where:

  • everything in the release ci passes except for this
  • publishing *-SNAPSHOT artifacts for consumption is desired
  • running this workflow in isolation and on demand is desired

We could set it up such that successful completion of the release workflow triggers a publish-jvm-artifacts workflow

Mirror artifacts and third party deps in artifactory

Other JVM artifacts published at TBD do this today for redundancy, availability, and caching

@mistermoe mistermoe marked this pull request as ready for review September 10, 2024 19:30
@mistermoe mistermoe requested review from a team and matt2e and removed request for a team September 10, 2024 19:30
@tomdaffurn
Copy link
Contributor Author

Was the Java doc not needed @mistermoe? I was getting errors from Sonatype without it.

@mistermoe
Copy link
Collaborator

Oh really? We should add it back in then. I only built the artifacts locally which worked fine. Didn't try re-publishing.

I removed bc we aren't using dokka anywhere afaict

</plugins>
</pluginManagement>
<plugins>
<!-- generates a JAR file containing the source code of the project -->
<plugin>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we want these in the plugins section, they should be in a profile, e.g. there is not need to generate source artifacts in a development build.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great point, I added release profile to group signing and source jarring


<!-- specifies where the project artifacts should be distributed or deployed.
tells Maven where to deploy your project's artifacts when you run mvn deploy -->
<distributionManagement>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be in the .settings.xml? I also don't understand what the use case is here, won't the TBD artifactory pull them down from central once they have been released?

</distributionManagement>

<!-- additional repositories that we can pull dependencies from -->
<repositories>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general this is a bad idea to put TBH repos into a publicly published pom. This will mean that projects consuming this pom will end up with these repositories in their repo list. If we really need them they should be in a
settings.xml file.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stuartwdouglas it may be best to connect with @ALRubinger as he paved the way here for other jvm artifacts at tbd. Take a look at web5-kt or tbdex-kt for reference.

No real opinions from my pov especially with limited jvm experience. Happy to do whatever you think makes sense.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have moved it to a settings.xml profile for now.

@stuartwdouglas stuartwdouglas added this pull request to the merge queue Sep 11, 2024
Merged via the queue into main with commit 7a7e8d0 Sep 11, 2024
23 checks passed
@stuartwdouglas stuartwdouglas deleted the jvm-publish branch September 11, 2024 01:09
This was referenced Sep 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ftl dev borks when attempting to run a fresh kotlin module
4 participants