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 maven relocation #2282

Merged
merged 2 commits into from
Oct 13, 2023
Merged

Add maven relocation #2282

merged 2 commits into from
Oct 13, 2023

Conversation

paul-dingemans
Copy link
Collaborator

Description

Add maven relocation block to ktlint-cli and ktlint-cli-reporter-baseline

When publishing to the local Maven repository, a 0.51.0-FINAL version of the pom.xml is created for the modules above. The modules contain the expected content. But the pom.xml is missing the signature. Another side effect is that the 1.0.1-SNAPSHOT version of the modules above is not created anymore as the signing block is now added to the module.

In 1.0.0 more modules have been relocated. They need to be added as well when it is clear how this should be approached.

Checklist

Before submitting the PR, please check following (checks which are not relevant may be ignored):

  • Commit message are well written. In addition to a short title, the commit message also explain why a change is made.
  • At least one commit message contains a reference Closes #<xxx> or Fixes #<xxx> (replace<xxx> with issue number)
  • Tests are added
  • KtLint format has been applied on source code itself and violations are fixed
  • CHANGELOG.md is updated
  • PR description added

Documentation is updated. See difference between snapshot and release documentation

…ter-baseline`

When publishing to the local Maven repository, a `0.51.0-FINAL` version of the `pom.xml` is created for the modules above. The modules contain the expected content. But the `pom.xml` is missing the signature. Another side effect is that the `1.0.1-SNAPSHOT` version of the modules above is not created anymore as the `signing` block is now added to the module.

In 1.0.0 more modules have been relocated. They need to be added as well when it is clear how this should be approached.
@paul-dingemans paul-dingemans marked this pull request as draft September 28, 2023 16:32
@paul-dingemans
Copy link
Collaborator Author

@Goooler Can you please help me out with this change? I have sent a slack message a while ago with more details.

Comment on lines 12 to 16

publishing {
publications {
// TODO: Remove in release after ktlint 1.0.1
create<MavenPublication>("relocation-ktlint-cli-reporter-baseline") {
Copy link
Contributor

Choose a reason for hiding this comment

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

Not be familiar with maven relocation, but if you wan't to sign this, could add something like:

signing {
    sign(publishing.publications["relocation-ktlint-cli-reporter-baseline"])
}

Ref:

sign(publishing.publications["maven"])

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

My question is not specifically about the maven relocation, but how to avoid code duplication in Gradle build. I have now added a publication and signing block in each module for which the maven coordinate has been changed. It is good enough as it will be removed soon.

@Goooler
Copy link
Contributor

Goooler commented Oct 8, 2023

And if this is only for maven coordinate relocation, can we rebase this PR to 0.51.0-FINAL branch and publish it, instead of on the master.

@paul-dingemans
Copy link
Collaborator Author

And if this is only for maven coordinate relocation, can we rebase this PR to 0.51.0-FINAL branch and publish it, instead of on the master.

I don't know how to create a release from a branch. I might not have enough privileges for that. I have tested on my local machine that publish to maven local creates both artifacts for 0.51.0-FINAL and 1.0.1. Only downside is that I have to remove the changes of this PR after publication of the next release.

@paul-dingemans paul-dingemans marked this pull request as ready for review October 9, 2023 18:04
@paul-dingemans paul-dingemans added this to the 1.0.1 milestone Oct 12, 2023
@paul-dingemans paul-dingemans merged commit 2acdeeb into master Oct 13, 2023
@paul-dingemans paul-dingemans deleted the 2280-maven-relocation branch October 13, 2023 06:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants