IVY-1653: makepom: write overrides to Maven dependencyManagement section#114
IVY-1653: makepom: write overrides to Maven dependencyManagement section#114eric-milles wants to merge 1 commit into
makepom: write overrides to Maven dependencyManagement section#114Conversation
|
I'm wondering what happens if you specify the organisation in the override, like in the example in the JIRA. |
|
This test case does just that: |
|
Sure, but how does Maven handle the '*' artifactId? Does that work? |
|
I'd have to try that with maven. Is there a concern that lots of top-level overrides are in use? Could this get taken as-is and if we find a compatibility problem, work it as a new issue? |
|
If maven gives errors on these wildcards, perhaps we could only add it to the dependencymanagement if the Ivy-override is fully specified (read: both groupId and artifactId have a non-wildcard value) ? We should try to avoid generating pom.xml files that cannot be handled by Maven. |
|
|
I fixed the tests to write proper |
| ModuleRules<DependencyDescriptorMediator> mr = md.getAllDependencyDescriptorMediators(); | ||
| if (mr.getAllRules().isEmpty()) { | ||
| return; | ||
| } |
There was a problem hiding this comment.
Perhaps also return here if none of the rules are an instance of non-wildcard OverrideDependencyDescriptorMediator.
This way, we avoid an empty <dependencyManagement>/<dependencies>-construct if container was true.
There was a problem hiding this comment.
Sure -- I tried to keep it simple instead of building up a filtered collection.
| }; | ||
|
|
||
| assertEquals(String.join(System.lineSeparator(), expect), readFileToString(pomFile, "UTF-8")); | ||
| } |
There was a problem hiding this comment.
Could you also add a test case for updating a template pom.xml that already has a dependencyManagement section, and we have an ivy.xml with an override element. (just to verify that an existing dependencyManagent gets updated correctly).
|
I've added some comments, could you have a look? |
|
I will get to your feedback on this one. Now that |
|
Could you review my PRs from oldest to newest? |
I'm not deeply involved with Ivy so please bear with my ignorance. Which effect do you expect a rule without a module attribute to have on a generated POM? Have Ivy find all transitive dependencies of explicit dependencies and add something to the POM replacing the * with all modules/artifacts found? |
|
This is still in draft form since there are some compat issues raised that are not easily solved. You can ignore this until it is marked ready for review. |
Inspect the
DependencyDescriptorMediatorobjects ofModuleDescriptorto represent overrides in Maven'sdependencyManagementelement.https://issues.apache.org/jira/browse/IVY-1653