How to disable duplicate dependencies check in Qulice?

688 views Asked by At

I'm trying to use the Qulice code quality control tool.

In my pom.xml I have the following definition:

<build>
    <plugins>
        <plugin>
            <groupId>com.qulice</groupId>
            <artifactId>qulice-maven-plugin</artifactId>
            <version>0.12.1</version>
            <configuration>
                <license>file:${basedir}/LICENSE.txt</license>
                <exclude>duplicatefinder:com.github.kodapan</exclude>
                <exclude>dependencies:com.github.kodapan</exclude>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>check</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
    </plugins>
</build>

When I run qulice:check, the build fails because of these problems:

[WARNING] Found duplicate (but equal) classes in [com.github.kodapan:osm-common.core:v0.0.2,se.kodapan.osm.common:core:0.0.2-SNAPSHOT] :
[WARNING]   se.kodapan.lang.Intern
[WARNING]   se.kodapan.osm.domain.OsmObjectVisitor
[WARNING]   se.kodapan.osm.domain.root.AbstractRoot
[WARNING]   se.kodapan.osm.domain.root.Root

How can I modify the exclude definition above in order for the build to succeed despite these problems (right now, fixing the classpath is out of question)?

2

There are 2 answers

0
Seelenvirtuose On BEST ANSWER

The plugins section in a POM allows to manage the dependencies (for that plugin), especially exclusions.

So the configuration looks something like that:

<build>
    <plugins>
        <plugin>
            <groupId>com.qulice</groupId>
            <artifactId>qulice-maven-plugin</artifactId>
            <version>0.12.1</version>
            <configuration>...</configuration>
            <executions>...</executions>
            <dependencies>
                <dependency>
                    <groupId>...</groupId>
                    <artifactId>...</artifactId>
                    <version>...</version>
                    <exclusions>
                        <exclusion>
                            <groupId>...</groupId>
                            <artifactId>...</artifactId>
                        </exclusion>
                    </exclusions>
                </dependency>
            </dependencies>
        </plugin>
    </plugins>
</build>

Here you have to configure which transitive dependencies of what direct dependencies should be excluded.

1
khmarbaise On

Based on the documentation of the qulice plugin you have to define the excludes a little bit different like this:

<build>
  <plugins>
    <plugin>
      <groupId>com.qulice</groupId>
      <artifactId>qulice-maven-plugin</artifactId>
      <version>0.12.1</version>
      <configuration>
        <excludes>
          <exclude>checkstyle:/src/examples/.*</exclude>
          <exclude>findbugs:~com.qulice.foo.*</exclude>
        </excludes>
      </configuration>
    </plugin>
  </plugins>
</build>

You can check the syntax etc. the example section.