Maven plugin: how to exclude a specific dependency in [sonar-packaging-maven-plugin]?


(Taodong Lu) #1

I use maven-shade-plugin relocate a dependency jar, so I don’t want the jar to be packaged into META-INF/lib by the latest sonar-packaging-maven-plugin.

I found sonar-packaging-maven-plugin supports “excludes” tag, but I don’t know how to make it work

            <plugin>
                <groupId>org.sonarsource.sonar-packaging-maven-plugin</groupId>
                <artifactId>sonar-packaging-maven-plugin</artifactId>
                <version>1.18.0.372</version>
                <extensions>true</extensions>
                <configuration>
                    <pluginKey>g11n</pluginKey>
                    <pluginName>G11n Base</pluginName>
                    <pluginClass>org.sonar.plugins.g11n.BasePlugin</pluginClass>
                    <sonarLintSupported>false</sonarLintSupported>
                    <sonarQubeMinVersion>6.7</sonarQubeMinVersion>
                    <excludes>
                        <exclude>icu4j-63.1.jar</exclude>
                    </excludes>
                </configuration>
            </plugin>

(Taodong Lu) #2

the issue is fixed, the below works

                    <excludes>
                        <exclude>**/icu4j-63.1.jar</exclude>
                    </excludes>