Using Maven 2, is there a way I can list out the jar dependencies as just the file names?
mvn dependency:build-classpath
can list the jar files, but that will include the full path to their location in my local repository. What I need is essentially just a list of the file names (or the file names that the copy-dependencies goal copied).
So the list I need would be something like
activation-1.1.jar,antlr-2.7.6.jar,aopalliance-1.0.jar etc...
ideally as a maven property, but I guess, a file such as build-classpath can generate will do.
What I am trying to achieve is writing a Bundle-ClassPath
to an otherwise manually maintained MANIFEST.MF file for a OSGi bundle. (You shouldn't need to understand this bit to answer the question.)
To clarify: The question is not about how to write manifest headers into the MANIFEST.MF file in a jar (that is easily googleble). I am asking about how to get the data I want to write, namely the list shown above.
jar file. Use the -verbose:class option to find class-level dependencies or use the -v or -verbose option to include dependencies from the same JAR file. Use the -R or -recursive option to analyze the transitive dependencies of the com.
In your project's POM, press Ctrl and hover the mouse over the dependency. Click the dependency to open the dependency's POM. In the dependency POM, view the active dependency, its transitive dependencies and their versions. You can check the origin from which the dependency was pulled in.
In Maven, you can use mvn dependency:tree to display the project dependencies in tree format.
This command will generate the dependencies tree of your maven project:
$ mvn dependency:tree
I am sure that you will like the result :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With