英文:
Maven Command Dependencies
问题
我试图在与互联网断开连接的服务器上执行“mvn license:add-third-part”命令。它缺少一些依赖项。我尝试手动添加它们,但它仍然显示一些传递性依赖项丢失。是否有一种方法可以通过Maven命令显示所有依赖项,包括传递性依赖项?
我知道以下命令:
- "mvn site"
- "mvn dependency:tree"
但我不知道如何在Maven命令上执行它们。
并且在创建该命令的Codehouse Mojo页面上没有找到任何信息。
我尝试在"mvn license:add-third-part"的文件夹上执行"mvn dependency:tree",但它不像我假设的那样工作,因为它不是Maven项目。
我查看了"mvn license:add-third-part"的Pom文件,但那里只有直接依赖项。
我尝试手动添加依赖项,但导致"传递性依赖项丢失"的警告。
英文:
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
答案1
得分: 0
我不确定如果您的主机未连接到互联网,您将如何解决依赖关系问题。但是,您可以创建一个单独的 pom.xml
(在某个单独的文件夹中),并在其中包括您的插件的唯一依赖项。
假设您正在使用插件 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>
现在,在该文件夹内运行 mvn dependency:tree
。
另一种方法是使用在线服务,如:http://101coder.com/genTreeUI
英文:
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
答案2
得分: 0
通常情况下,您可以通过使用公司的Nexus/Artifactory来解决这个问题,它会为您解析(从网络上获取)构件。没有这个,几乎不可能运行正常的构建(如mvn clean deploy
)。
当然,您也可以在连接到互联网的计算机上运行该命令(使用新的本地存储库),然后复制下载的依赖项。
英文:
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论