-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
bug(pom): wrong inheritance of version
and scope
from root DepManagement in parent dependencies
#7539
Comments
After investigation I realized that this is incorrect. |
I wanted to play with
I ran
How do you test |
I just copied org folder to |
Hmm... it didn't help either. |
bash-4.2# mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ----------< com.example:inherit-scopes-in-parents-from-root >-----------
[INFO] Building inherit-scopes-in-parents-from-root 0.1.0
[INFO] from pom.xml
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for org.example:example-api-runtime:jar:3.0.0 is missing, no dependency information available
[WARNING] The POM for org.example:example-api-compile:jar:3.0.0 is missing, no dependency information available
[WARNING] The POM for org.example:example-api-empty:jar:3.0.0 is missing, no dependency information available
[INFO]
[INFO] --- dependency:3.7.0:tree (default-cli) @ inherit-scopes-in-parents-from-root ---
[INFO] com.example:inherit-scopes-in-parents-from-root:jar:0.1.0
[INFO] +- org.example:example-nested-scope-runtime:jar:1.0.0:runtime
[INFO] | \- org.example:example-scope-runtime:jar:2.0.0:compile
[INFO] | \- org.example:example-api-runtime:jar:3.0.0:runtime
[INFO] +- org.example:example-nested-scope-compile:jar:1.0.0:compile
[INFO] | \- org.example:example-scope-compile:jar:2.0.0:runtime
[INFO] | \- org.example:example-api-compile:jar:3.0.0:test
[INFO] \- org.example:example-nested-scope-empty:jar:1.0.0:test
[INFO] \- org.example:example-scope-empty:jar:2.0.0:test
[INFO] \- org.example:example-api-empty:jar:3.0.0:test
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.395 s
[INFO] Finished at: 2024-10-16T08:54:41Z
[INFO] ------------------------------------------------------------------------
|
What??? Shouldn't |
Even if
|
This output also shows warnings. |
|
I thought there was no point in adding these dependencies because they were at the top of the tree (I didn't know that |
In addition to missing dependencies,
|
Yes, I think so, too, but our test cases don't work with |
I think using |
We don't know whether |
I agree with you. I will check new changes i will make using |
Description
We need to correctly inherit some fields from the root DepManagement in parent dependencies:
version
from root DepManagement and don't use properties from parent.scope
only if parent dependency doesn't usescope
Example:
root pom:
Parent pom:
mvn
result:[INFO] com.example:child-depManagement-in-parent:jar:1.0.0 [INFO] +- org.example:example-api:jar:1.0.1:compile [INFO] \- org.example:example-api2:jar:1.0.2:runtime
Discussed in #7537
The text was updated successfully, but these errors were encountered: