How to display dependency conflicts in 'mvn site'

I can easily see if there are conflicts between (transitive) dependency versions using:

mvn dependency: tree -Dverbose = true

... this will show a complete permission tree, including elements that were omitted (for duplication or conflict or something else). I would like to add a complete tree to the mvn site report.

Currently, the site report includes a dependency tree, but only as resolved, that is, without conflicts. I see in the project-info-reports plugin that there is currently no way to do what I want using a standard report.

I tried adding a section to pom to include the tree-dependency-plugin tree target with the specified outputFile parameter, but it was not included when I started the mvn site. It was something like this:

<reporting>
  ....
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <reportSets>
        <reportSet>
          <id>deptree</id>
          <reports>
            <report>tree</report>
          </reports>
          <configuration>
            <verbose>true</verbose>
            <outputFile>${project.reporting.outputDirectory}/deptree.txt</outputFile>
          </configuration>

, "" , , , , , , . .

? ? , / project-info-reports, , maven.

( maven 2.1.0, .)

+3
1

? ?

, mojo pre-site :

<build>
  <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
      <executions>
        <execution>
          <id>tree</id>
          <phase>pre-site</phase>
          <goals>
            <goal>tree</goal>
          </goals>
        </execution>
      </executions>
    </plugin>
  </plugins>
</build>
<reporting>
  ...
</reporting>

mvn site, dependency:tree.

+2

Source: https://habr.com/ru/post/1732912/


All Articles