Uploaded image for project: 'Maven Shade Plugin'
  1. Maven Shade Plugin
  2. MSHADE-467

Dependency-reduced POM with missing exclusions in concurrent build

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 3.4.1, 3.5.0, 3.5.1
    • 3.5.2
    • None

    Description

      As discussed in this maven-users thread, when running Maven builds for this reproducer concurrently, some dependency exclusions are missing from the generated dependency-reduced POMs. Run the reproducer like this:

      $ mvn clean package -T 4 | grep 'BUILD SUCCESS' && find . -name "dependency-reduced-pom.xml" -exec bash -c 'cat $0 | grep exclu | wc -l ' {} \;
      [INFO] BUILD SUCCESS
      12
      12
      12
      12
      

      When running with -T 1, however, the correct result is 20.

      This concurrency issue might have been introduced by the MSHADE-413 fix, but I am not sure.

      I have a local fix, synchronising on the injected mojo parameter MavenSession session in the lower section of ShadeMojo::rewriteDependencyReducedPomIfWeHaveReduction. There might be a better way to fix the problem, but I it leave that up to the PR reviewers to come up with one, if any.

      Attachments

        Issue Links

          Activity

            People

              rmannibucau Romain Manni-Bucau
              kriegaex Alexander Kriegisch
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: