1

I am trying to execute "mvn license:add-third-part" on a server, that is not connected to the web. It's missing some dependencies. I tried to add them manually, but it says that still some transitive dependencies are missing. I there a way to display all dependencies by a Maven Command, including transitve ones? I know the

  • "mvn site"
  • "mvn dependency:tree"

Commands, but I dont know how to execute them on a Maven Command. Also did not found anything on the Codehouse Mojo Page, which created the Command.

  • did try to execute "mvn dependency:tree" on mvn license:add-third-part's folder, but didnt work as I assumed, cuase its no Maven Projekt
  • looked into "mvn license:add-third-part"'s Pom but there are only the direkt dependencies
  • added Dependcies manually -> lead to the "transitive Dependencies are missing" Warning
Torben
  • 13
  • 3
  • To execute things like `mvn dependency:tree` you have to have a pom.xml file in that directory (Maven project)...otherwise that does not work... Manually downloading deps is technically possible but it will take very very time... you might need to download hundreds of deps... the usual way to have a repository manager in your coprorate environment... – khmarbaise Feb 08 '23 at 16:39

2 Answers2

0

I am not sure how you are going to resolve dependencies if your host is not connected to the Internet. However you can just create separate pom.xml (in some separate folder) and include there the only dependency of your plugin.

Say you are using plugin v2.0.0:

<!-- https://mvnrepository.com/artifact/org.codehaus.mojo/license-maven-plugin -->
<dependency>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>license-maven-plugin</artifactId>
    <version>2.0.0</version>
</dependency>

Now inside that folder run mvn dependency:tree.

Another way is to use online service like: http://101coder.com/genTreeUI

Alexey R.
  • 8,057
  • 2
  • 11
  • 27
0

Usually you resolve the problem by using a company Nexus/Artifactory that resolves the artifacts for you (from the web). Without this, it is hardly possible to run a normal build (like mvn clean deploy).

You can of course also run the command on a machine that is connected to the internet (with a fresh local repository) and then copy the downloaded dependencies over.

J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142