Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Configure maven-license-plugin to use excludedGroups correctly

When this plugin is attached to the test or package phase, it causes a multi module build to break since it forces dependency resolution before the module dependencies are in the local repository (first build upon updating to a new snapshot version). I'm trying to get the plugin to ignore the offending com.cons3rt group dependencies which are not required for license output. Tried several variations of:

<plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>license-maven-plugin</artifactId>
        <version>1.3</version>
        <executions>
          <execution>
            <id>aggregate-add-third-party</id>
                <configuration>
                <excludedGroups>com.cons3rt</excludedGroups>
                </configuration>
        <phase>package</phase>
            <goals>
              <goal>aggregate-add-third-party</goal>
            </goals>
          </execution>
        </executions>

Nothing seems to work - looking at the output of mvn -X, it seems like the plugin is not honoring the configuration setting for excludedGroups. Anyone have any luck using this configuration approach?

like image 388
user1751415 Avatar asked Oct 24 '25 04:10

user1751415


2 Answers

In your configuration use a pipe to separate multiple groupIds and set the .* to refer to all sub packages:

<excludedGroups>com.group1.*|com.group2.*</excludedGroups>
like image 149
MS. Avatar answered Oct 26 '25 20:10

MS.


A workaround for this problem is to pass the parameter through the command line using the

-Dlicense.excludedGroups

parameter.

e.g. mvn package -Dlicense.excludedGroups=com.jhla.*

like image 45
hoysy016 Avatar answered Oct 26 '25 19:10

hoysy016



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!