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

Fix duplicate artifacts issue with maven-source-plugin in release build #4237

Merged
merged 5 commits into from
Mar 21, 2024

Conversation

lhotari
Copy link
Member

@lhotari lhotari commented Mar 21, 2024

Motivation

dev/release/003-release-perform.sh fails with errors

[INFO] [INFO] --- source:3.3.0:jar (attach-sources) @ buildtools ---
[INFO] [INFO] Building jar: /Users/lari/workspace-pulsar/bookkeeper/target/checkout/buildtools/target/buildtools-4.17.0-sources.jar
[INFO] [INFO]
[INFO] [INFO] --- source:3.3.0:jar-no-fork (attach-sources) @ buildtools ---
[INFO] [ERROR] We have duplicated artifacts attached.
...
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-source-plugin:3.3.0:jar-no-fork (attach-sources) on project buildtools: Presumably you have configured maven-source-plugn to execute twice times in your build. You have to configure a classifier for at least on of them. -> [Help 1]
[INFO] [ERROR]

After resolving that, there was another set of errors in installing bookkeeper-dist/all, bookkeeper-dist/bkctl and bookkeeper-dist/server. The error message contained this message:

The packaging plugin for this project did not assign a main file to the project but it has attachments.

Changes

  • use jar-no-fork goal instead of jar goal.
  • change parent pom version to 29 (also used in apache/pulsar)
  • rely on pluginManagement for handling maven plugin versions for these core plugins
    • maven-assembly
    • maven-clean-plugin
    • maven-dependency-plugin
    • maven-deploy-plugin
    • maven-install-plugin
    • maven-jar-plugin
    • maven-javadoc-plugin
    • maven-shade-plugin.
    • maven-source-plugin
  • let Apache parent pom version 29 assign the plugin versions so that they are compatible with each other and the Apache release.
  • Changing package from jar to pom for bookkeeper-dist/all, bookkeeper-dist/bkctl and bookkeeper-dist/server
    • error was The packaging plugin for this project did not assign a main file to the project but it has attachments.

@lhotari
Copy link
Member Author

lhotari commented Mar 21, 2024

please also review and merge #4235 and #4236 since those were necessary at least in my case (MacOS Apple Silicon M3 Max)

- fixes error "The packaging plugin for this project did not assign a main file to the project but it has attachments."
@lhotari
Copy link
Member Author

lhotari commented Mar 21, 2024

@eolivelli @nicoloboschi This is also needed in branch-4.16 and branch-4.15 since those are also broken due to pom.xml changed made while fixing integration tests. Please also include #4235 and #4236.

Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

+1
thank you very much!

bookkeeper-dist/all/pom.xml Outdated Show resolved Hide resolved
@lhotari lhotari requested a review from eolivelli March 21, 2024 12:18
Copy link
Contributor

@eolivelli eolivelli left a comment

Choose a reason for hiding this comment

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

LGTM

@eolivelli eolivelli merged commit 5abb87f into apache:master Mar 21, 2024
22 checks passed
@nicoloboschi nicoloboschi added this to the 4.17.0 milestone Mar 21, 2024
nicoloboschi pushed a commit that referenced this pull request Mar 21, 2024
eolivelli pushed a commit that referenced this pull request Mar 25, 2024
Ghatage pushed a commit to sijie/bookkeeper that referenced this pull request Jul 12, 2024
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.

3 participants