-
Notifications
You must be signed in to change notification settings - Fork 83
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
Regression: parent dependencies missing in flattened pom since 1.4.0 #377
Comments
Was it caused by #329? |
No, it was #220 that introduced this regression. Revision 2b1a1d3 works and next revision (aab4485) fails :-/ Here is a patch to reproduce the issue |
Originally posted by @KemalSoysal in #220 (comment) That's the regression, dependencies in parent are direct dependencies and not transitive dependencies. The inherit-parent-dependency IT did fail, and the "fix" was to change the IT and add flattenDependencyMode: all (instead of direct which is the default) |
What exactly is the desired behavior? |
@KemalSoysal try
|
Hi @filip26, The parent_pom.xml configures the flatten plugin with only ossrh flatten-mode (did I miss a configuration somewhere else?). @filip26 , @leonarta , @hohwille, @filip26, @hkampbjorn Please advise how to proceed If the requirement is, that the flattenDependencyMode is defaulted to src/it/projects/optional-elements-modeOssrh/pom.xml
|
I guess the issue could be in terminology, transitive vs direct dependency. You suggest that a dependency declared outside main Convenient interpretation is that a direct dependency is the one that an artifact requires to compile/run, no matter where the dependency is declared. Transitive dependency is a dependency of a direct dependency or any other transitive dependency. |
I tested the pom_parent.xml after adding I get a difference: |
@KemalSoysal Well, I don't mind adding the config line, generally, the issue is that this plugin changed behavior unexpectedly - a minor version change. I've released a few artifacts with broken pom because of this, so the real issue is to establish a trust again. For now, I'm sticking with 1.3.0 ;) |
Communication is always context related and prone to misunderstandings.... |
I think there are still a lot of integration tests missing for flatten-maven-plugin.... |
@filip26 I guess it was hard to test a |
The problem is that 1.4.0 change the behaviour of "direct" from the effective dependencies including those inherited from parent, to exclude those inherited from parent. Without any clarifying updated documentation. To have those inherited dependencies included in versions 1.4.0 up to 1.6.0 we need to change to flatten dependency mode "all" but this will also includes all transitive dependencies. We cannot get the default behaviour in 1.3.0 or before @KemalSoysal yes there are many small variations that are missing from integration tests, like having dependencies in parent module that have transitive dependencies. I have a patch that introduces a new "effective" flatten dependency mode, which behaves like 1.2.0 and before, and as "direct" in 1.3.0. And I would also like to make this the default from 1.7.0 on. I'd like to make "effective" the new default too PS Personally I consider having compile scope dependencies in parent modules an anti-pattern, but it's allowed in maven, and internally we do have such projects :-( |
Hi @hkampbjorn, I need your help to really understand the scenario, that you describe. Could you point to repositories eligible to showcase the flattened-pom problem when changed
Or can you provide a simplistic maybe mermaid diagram to define the the dependencies scenario which fail to be flattened correctly like: ---
title pom dependency diagram
---
graph LR;
B[module B] --> A[parent A];
C[module C] -->A;
D[module D] --> B;
E[module E]--> C;
E--> B;
What is the difference in the flattened-pom ? |
When I have a parent POM that has a compile time dependency
X
and I do flatten a child POM of it, thenflatten-maven-plugin
version1.5.0
does not haveX
as dependency in the flattened POM.This is working until version
1.3.0
.Some change broke this - maybe 5b757ae
I am slightly confused why the IT inherit-parent-dependency did not fail (maybe the version of the parent dependency has to be omitted and defined in dependency management).
Here some links to prove the error in my project:
Related issues:
The text was updated successfully, but these errors were encountered: