mojohaus / license-maven-plugin

Maven plugin to download and collect license files from project dependencies.
https://www.mojohaus.org/license-maven-plugin/
GNU Lesser General Public License v3.0
107 stars 127 forks source link

aggregate-add-third-party prevents integration-tests in submodules from compiling #147

Closed sofax closed 5 years ago

sofax commented 6 years ago

Situation:

A reactor project with nested reactor projects. The nested reactor project's parent is the root reactor project's pom.xml.

The nested reactor projects consist of two child modules each, where one is the main artifact, and the other is an integration test artifact for that main artifact.

With the following section in the root project's pom.xml the nested integration tests won't compile when mvn clean install is invoked from the root project, because the classes in the artifact under test are not found, even though that artifact, of course, is a dependency of the integration-test artifact:

      <plugins>
         <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>license-maven-plugin</artifactId>
            <version>1.14</version>
            <inherited>false</inherited>

            <executions>
               <execution>
                  <id>update-project-license</id>
                  <phase>process-sources</phase>
                  <goals>
                     <goal>update-project-license</goal>
                     <!-- This breaks the surefire build in the reactor's child modules (for whatever reason)
                      -->
                     <goal>aggregate-add-third-party</goal>
                  </goals>

                  <configuration>
                     ...
                  </configuration>
               </execution>
            </executions>
         </plugin>
         ...
      </plugins>

The affected versions of the plugin, as of now, are 1.14 through 1.16. Version 1.13 still works.

sofax commented 6 years ago

With later versions of some other Maven plugins, even v1.13 breaks the build. I have not yet been able to trace it down to a specific constellation though.

srdo commented 6 years ago

This seems to describe the same issue as https://github.com/mojohaus/license-maven-plugin/issues/145. I put up a proposal for a fix here https://github.com/mojohaus/license-maven-plugin/pull/148. Feel free to try it out.

sofax commented 6 years ago

Thanks, @srdo! We don't compile Maven plugins ourselves to avoid incompatibilities, but I'm hopeful that your pull request will be integrated into the next version of the plugin! :)

ppalaga commented 5 years ago

The fix for #145 was merged. @sofax , could you please test with a SNAPSHOT build from the current master?

sofax commented 5 years ago

It looks good, @ppalaga!