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: support multiple bom poms #1173

Merged
merged 1 commit into from
Jan 2, 2022
Merged

Conversation

maxandersen
Copy link
Collaborator

ShrinkWrap does not have direct support for multiple pom files to use
for resolving versions for dependencies without version, i.e. called
<dependencyManagement> in Maven, platforms in Gradle.

To fix it we now generate a temporary pom.xml that has nothing but a
section containg the list of managed pom dependencies.

This has the following consequences:

  • we need to write a temporary file as ShrinkWrap does not allow passing a string directly.
  • we avoid loading a bom pom as a pom which will activate parent poms features like adding repositories that generated warnings. Now this just don't happen.
  • means that @pom references now can come in any order (before we required it to be the first)
  • consequence of that is there in effect will be to //DEPS lists; one is pom's other is everything else.
  • Also could resolve in change in behavior but as users only could load one pom.xml for this in past this should not be a problem;except maybe we don't generate so many warnings anymore if parent pom's were incomplete.

...and what this enables:

  • having multiple bom poms which in particular is useful with larger frameworks like quarkus, springboot, groovy, kotlin which all rely on multiple boms.

Fixes #877

ShrinkWrap does not have direct support for multiple pom files to use
for resolving versions for dependencies without version, i.e. called
`<dependencyManagement>` in Maven, platforms in Gradle.

To fix it we now generate a temporary pom.xml that has nothing but a
<dependencyManagement> section containg the list of managed pom dependencies.

This has the following consequences:

- we need to write a temporary file as ShrinkWrap does not allow passing a string directly.
- we avoid loading a bom pom as a pom which will activate parent poms features like adding repositories that generated warnings. Now this just don't happen.
- means that @pom references now can come in any order (before we required it to be the first)
- consequence of that is there in effect will be to `//DEPS` lists; one is pom's other is everything else.
- Also *could* resolve in change in behavior but as users only could load one pom.xml for this in past this should not be a problem;except maybe we don't generate so many warnings anymore if parent pom's were incomplete.

...and what this enables:

- having multiple bom poms which in particular is useful with larger frameworks like quarkus, springboot, groovy, kotlin which all rely on multiple boms.
@maxandersen
Copy link
Collaborator Author

note, this really need some more manual/automatic testing before we merge it.

things to test:

  • using multiple boms with quarkus 2+
  • does jbang edit generate proper gradle file when using multiple boms?
  • example from camel?

@codecov
Copy link

codecov bot commented Dec 31, 2021

Codecov Report

Merging #1173 (9b4e955) into main (e416516) will increase coverage by 0.09%.
The diff coverage is 89.28%.

Impacted file tree graph

@@             Coverage Diff              @@
##               main    #1173      +/-   ##
============================================
+ Coverage     58.98%   59.07%   +0.09%     
- Complexity     1050     1052       +2     
============================================
  Files            84       84              
  Lines          5554     5569      +15     
  Branches        935      935              
============================================
+ Hits           3276     3290      +14     
- Misses         1795     1797       +2     
+ Partials        483      482       -1     
Flag Coverage Δ
Linux 57.90% <89.28%> (+0.09%) ⬆️
Windows 57.82% <89.28%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...in/java/dev/jbang/dependencies/DependencyUtil.java 81.33% <89.28%> (+1.33%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e416516...9b4e955. Read the comment docs.

@maxandersen maxandersen merged commit 796c716 into jbangdev:main Jan 2, 2022
@maxandersen maxandersen deleted the multiplebom branch January 2, 2022 07:35
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.

Support multiple boms at the starting DEPS
1 participant