1

In my maven project, when I use maven-dependency-plugin:resolve, it resolves all the dependencies used by the project in text file. I want to resolve specific dependencies of particular POM file. But there is no inputFile, file, url tags support with this plugin so that I can give path to input file (say specific POM file having dependencies list) so that those all dependencies get resolved in text file. Is there any other way or other plugin to achieve this?

Note: The POM file is not present in the project. It is present on central repo/nexus and it's dependency is imported/added in source pom file of project.

Here is my plugin usage code:

              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>list-dependencies</id>
                        <phase>prepare-package</phase>
                        <goals>
                            <goal>resolve</goal>
                        </goals>
                        <configuration>
                            <includeScope>compile</includeScope>
                            <sort>true</sort>      
                            <outputFile>${project.basedir}/target/dependencies.txt</outputFile>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
  • For what do you need this? – J Fabian Meier Jun 27 '22 at 09:27
  • I need to get the dependencies in the text file so that I can parse them into an XML file. I have used the [gmaven-plugin](https://groovy.github.io/gmaven/groovy-maven-plugin/index.html) with [groovy language](https://mvnrepository.com/artifact/org.codehaus.groovy/groovy-xml) to create the XML file. This XML file is needed for dev purposes. The case is that I don't want all the dependencies in text, only specific dependencies to be get resolved so that I can easily create XML from it. – Sagar Sikchi Jun 27 '22 at 12:15
  • Simplest solution would be to write a simple maven plugin and keep your dependencies in your pom file.... apart from that I don't understand such need for deps in a supplemental file ... – khmarbaise Jun 27 '22 at 14:14

0 Answers0