I am trying to print dependency tree as per dependency:tree for multimodule Maven project and firing the command
mvn org.apache.maven.plugins:maven-dependency-plugin:3.2.0:tree works perfectly in this case.
For mentioning additional configurations such as creating aggregate dependency graph and writing to external directory, I made following changes in pom.xml.
<profile> <id>java-src</id> <activation> <activeByDefault>false</activeByDefault> </activation> <build> <plugins> --- --- <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>3.2.0</version> <executions> <execution> <id>copy-dependencies</id> <phase>compile</phase> <goals> <goal>tree</goal> </goals> <configuration> <outputDirectory>${project.build.directory}/alternateLocation</outputDirectory> </configuration> </execution> </executions> </plugin> --- --- </plugins> </build> </profile> On running mvn tree, it is not working as expected and gives following error:
[ERROR] Unknown lifecycle phase "tree". You must specify a valid lifecycle phase or a goal in the format <plugin-prefix>:<goal> or <plugin-group-id>:<plugin-artifact-id>[:<plugin-version>]:<goal>. Available lifecycle phases are: validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy, pre-clean, clean, post-clean, pre-site, site, post-site, site-deploy. -> [Help 1]
Kindly help regarding the same.
mvn depndency:treetreeis not a phase of any Maven standard lifecycle.dependency!