-
Notifications
You must be signed in to change notification settings - Fork 90
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
[MSHADE-36] Use reduced dependencies #25
[MSHADE-36] Use reduced dependencies #25
Conversation
I noticed that there will be a conflict with #22 because I moved the creation of the dpr to a slightly different place (more forward instead of more backward). |
9b4e29b
to
6fd4581
Compare
08d08a6
to
6c25ac7
Compare
What is the status of this ticket? @Tibor17 was there something missing still? |
I talked some time ago with @hboutemy about shading and poms. Which is the right pom? Think about licenses, etc. I can image we need a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still under consideration/development or should we close it?
@elharo I would like to see this problem fixed. If there is anything I need to change then I'm happy to do that. Just say what the desired solution is. |
Looks like for this issue to move forward it needs a proposal (not a PR) that can be discussed on the dev mailing list. If you can get consensus from the project maintainers on what a fix should look like--i.e. what would go into a project POM and what the output would be--then it could be implemented. But right now it doesn't look like there's consensus on the form of the solution. |
Perhaps, there could be a pragmatic solution to this: Instead of directly using the dependency-reduced pom directly, there |
Dear Maintainers/Contributors, |
src/it/MSHADE-36-inject-dep-reduced-pom-in-final/invoker.properties
Outdated
Show resolved
Hide resolved
src/it/MSHADE-36-inject-dep-reduced-pom-in-final/src/main/java/nl/example/Main.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
Outdated
Show resolved
Hide resolved
@@ -437,6 +447,24 @@ public void execute() | |||
|
|||
List<ResourceTransformer> resourceTransformers = getResourceTransformers(); | |||
|
|||
if ( createDependencyReducedPom ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You have moved this before the Shader works. No changes in behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With the tests present in the project today 2 fail with my changes in place.
So this does indeed need some rework.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apparently the problem that failed the tests made two files.
Fix that now all tests pass.
Still the question "No changes in behavior?" remains a valid one.
For now: Let's assume there IS a change the current tests did not pick up.
I'll look into it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My verification steps:
- All integration tests pass.
- Checkout both master and my version into separate directories.
- Run in both:
MAVEN_OPTS=-Dinvoker.parallelThreads=2 mvn clean verify -Prun-its
under javac 11.0.11 - Get this tool to compare the jars https://github.com/scala/jardiff
- Run these magical incantations on my Linux machine:
find target/it -type f -name '*.jar' | while read JAR ; do java -jar ../jardiff.jar ${JAR} ../maven-shade-plugin-master/${JAR} ; done > jar-changes.log
find target/it -type f -name '*pom*' | while read POM ; do diff ${POM} ../maven-shade-plugin-master/${POM} ; done > pom-changes.log
- Manually go through the output.
Differences logged:
- Files like surefirebooter2116138492290729396.jar are unique (Ignore)
- The test files I created are only present in mine (Ignore)
- All files have a difference in the timestamps when the files were generated (pom.properties) (Ignore)
- Some tests include the plugin itself and show differences because of the new feature (Ignore)
@michael-o Is this sufficient verification?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will verify!
src/main/java/org/apache/maven/plugins/shade/resource/UseDependencyReducedPomXml.java
Outdated
Show resolved
Hide resolved
I am inclined to merge this after a few small changes since this is optional and does not affect default behavior. Respecing licenses and other attributions is solely a dev's task. Not ours. |
@nielsbasjes Please also rebase on top of master to resolve merge conflicts. |
Wow. Finally some progress. |
No, as far as I interpret the comments in #26 (See the very first line in the initial text), #26 includes #25. Also, if you click on the commits tab of #26 you see TWO commits, where one is identical to this PR. Have a look at https://github.com/jenkinsci/jclouds-plugin (A plugin which uses jclouds which in turn uses guava) and Also, maybe have a look at @nielsbasjes remarks here: https://yauaa.basjes.nl/NOTES-shading-dependencies.html Cheers |
This is a contradiction, isn't it? If #26 includes this PR then it requires it. I will first resolve this one waiting for @nielsbasjes then continue with the rest. |
I'm picking up the reviews and comments. |
Thanks, looking forward too. If all goes well we'll have a release this month. |
@nielsbasjes Something is wrong, GitHub shows 97 commits to be merged. Did you rebase incorrectly? |
031ec4a
to
0cf7fc5
Compare
Yes, something went wrong here. |
… the final shaded jar
@nielsbasjes Let me explicitly know when you are done from your PoV and I will review and test everything. |
13b12cb
to
3d1dbbc
Compare
@michael-o I have fixed it. CI builds all pass now. |
src/it/MSHADE-36-inject-dep-reduced-pom-in-final/invoker.properties
Outdated
Show resolved
Hide resolved
src/it/MSHADE-36-inject-dep-reduced-pom-in-final/src/main/java/nl/example/Main.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
Outdated
Show resolved
Hide resolved
Going through now... |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few issues
src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/shade/mojo/ShadeMojo.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/shade/resource/UseDependencyReducedPom.java
Outdated
Show resolved
Hide resolved
src/main/java/org/apache/maven/plugins/shade/resource/UseDependencyReducedPom.java
Outdated
Show resolved
Hide resolved
Works for me on:
Waiting for ASF Jenkins to complete |
@nielsbasjes Please continue (rebase) the next PR and let me know when you are done. |
Yes, will do |
Excellent cooperation, thank you folks! So glad to see this fixed |
Took way too long to process, but people are busy. |
This is a proposed fix for the issue https://issues.apache.org/jira/browse/MSHADE-36 which has been open for over 11 years.
The implementation is activated when the setting "useDependencyReducedPomInJar" is set to true.
It then essentially injects two ResourceTransformers from code
This includes an integration test to verify this actually happens.
Following this checklist to help us incorporate your
contribution quickly and easily:
for the change (usually before you start working on it).
https://issues.apache.org/jira/browse/MSHADE-36
[MSHADE-XXX] - Fixes bug in ApproximateQuantiles
,where you replace
MSHADE-XXX
with the appropriate JIRA issue. Best practiceis to use the JIRA issue title in the pull request title and in the first line of the
commit message.
mvn clean verify
to make sure basic checks pass. A more thorough check willbe performed on your pull request automatically.
mvn -Prun-its clean verify
).If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
I hereby declare this contribution to be licensed under the Apache License Version 2.0, January 2004
In any other case, please file an Apache Individual Contributor License Agreement. I'm a committer and PMC for Apache Avro.