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

Improved transitive downstream detection can cause build failures #791

Open
josple opened this issue Feb 6, 2024 · 4 comments
Open

Improved transitive downstream detection can cause build failures #791

josple opened this issue Feb 6, 2024 · 4 comments

Comments

@josple
Copy link

josple commented Feb 6, 2024

We have hit an issue with the functionality added by #529.

We were excited to benefit from the increased parallelism that this change enables. However, we've encountered an edge case that's causing our builds to fail: When constructing a war file, if one of its dependencies is simultaneously built alongside the war file, there's a possibility that the war file may resolve the compiled class files, leading to an inability to package them into the war file. Consequently, this produces a war file that is functionally broken.

We believe the underlying cause of this issue may be a Maven defect, and as such we have flagged this potential defect (which contains a lot more details) in the Maven issues mailing list. See the "Inconsistent dependency resolution behaviour for concurrent multi-module build can cause failures" discussion at https://lists.apache.org/list?users@maven.apache.org:2024-2.

Despite suspecting the underlying defect is in Maven, we wanted to flag this issue as we don't know when the defect will be fixed (or whether the Maven community agree it is actually a defect).

@famod
Copy link
Member

famod commented Feb 9, 2024

Thanks for the heads up! I'll try to read into this in the next few days.

@famod
Copy link
Member

famod commented Feb 23, 2024

@josple what was the verdict of the discussion? Did you find a solution/workaround?

@josple
Copy link
Author

josple commented Feb 28, 2024

@famod , I have updated the link in this issue description to point to the full mailing list discussion (the thread permalink seems to omit most of the discussion for some reason...).

It would seem that this is considered a bug. A hack of the proposed solution was put forward here: apache/maven#1406. This essentially:

  1. Retains the full multi-module build dependency graph such that the build graph always remains consistent regardless of whether a “-pl” arg has been provided
  2. Introduces a skip build option to satisfy the functionality of the “-pl” arg

This 'hack' therefore fixes the issue although it does limit some of the parallelism opportunity.

AFAIK no bug was raised, and I cannot get access to the Maven Jira project to do so myself. I will follow up on this.

In the meantime, I am not aware of a workaround.

@josple
Copy link
Author

josple commented Apr 15, 2024

I have been granted access to the maven Jira project, so I have raised: https://issues.apache.org/jira/browse/MNG-8096

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

No branches or pull requests

2 participants