我需要将项目的所有传递依赖项下载到命令行上的目录,而不需要pom.xml文件或其他脚本.理想情况下,我可以使用一个或两个命令执行此操作.据我所知,这至少是mvn的两步过程.
为了获得我运行的依赖项
$ mvn org.apache.maven.plugins:maven-dependency-plugin:2.6:get -DgroupId=org.jclouds.provider -DartifactId=rackspace-cloudservers-us -Dversion=1.5.8
Run Code Online (Sandbox Code Playgroud)
哪个效果很好.不幸的是,dest param并没有帮助我,因为它不会将所有传递依赖项放在dest中.
所以现在我需要将该JAR文件及其所有传递依赖项复制到我的lib目录中.我知道这个部分已经在StackOverflow上被问了很多次但是我的工作没有任何效果.我尝试了以下内容.
$ mvn dependency:copy-dependencies ...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:copy-dependencies (default-cli): Goal requires a project to execute but there is no POM in this directory
Run Code Online (Sandbox Code Playgroud)
和
$ mvn dependency:copy ...
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.1:copy (default-cli): Goal requires a project to execute but there is no POM in this directory
Run Code Online (Sandbox Code Playgroud)
从阅读StackOverflow上的文档和其他答案的副本依赖和复制我认为我可以从命令行使用它们没有pom.xml但mvn似乎需要一个.我的Maven版本是Apache Maven 3.0.4(r1232337; 2012-01-17 02:44:56-0600).
任何人都可以给我一个使用没有pom.xml的mvn复制传递依赖的例子吗?
有没有更好的方法来做我在这里尝试完成的事情?
我需要帮助使用IVY作为依赖项管理器
我的应用程序需要在RUN-TIME加载插件
意味着在核心应用程序运行时,用户可以请求新的插件
并安装它们,
我希望管理所有已安装的插件使用核心应用程序DB.
我想从我的插件服务器(或其他描述符)获取一个pom,
并要求IVY告诉我什么是依赖项或让IVY根据我的应用程序的当前状态安装插件和依赖项.
(我现在有什么,
1.jar被核心应用程序
2.jar用于当前安装的插件)
我希望每个插件
在我的应用程序所在的某个文件夹下具有独立目录(不是共享目录)
事情是我不知道从哪里开始
我注意到没有编程API
我找到一个链接通过网络尝试类似的东西,
但看起来像代码没有完成,或一些变量丢失,我不知道如何完成其余的原因湖编程文档
http://www.mail-archive .com/ivy-user @ ant.apache.org/msg03228.html
(其中变量"art"来自......)
能帮帮我吗...谢谢大家
UPDATE
好吧,这就是我现在正在尝试的.我收到一些错误加上我不知道如何定义我的archiva服务器
IvySettings settings = new IvySettings();
settings.setDefaultIvyUserDir(new File("D:/programming/eclipse_projects/ivyTest/repo/"));
settings.setDefaultCache(new File("D:/programming/eclipse_projects/ivyTest/repo/cache/"));
settings.setDefaultCacheArtifactPattern("[module]/[revision]/[module]-[revision](-[classifier]");
Ivy ivy = Ivy.newInstance(settings);
ivy.getLoggerEngine().pushLogger(new DefaultMessageLogger(Message.MSG_VERBOSE));
ModuleDescriptor md = PomModuleDescriptorParser.getInstance().parseDescriptor(new IvySettings(), new File("src/movies.pom").toURL(), true);
RetrieveOptions retriveOptions = new RetrieveOptions();
retriveOptions.setUseOrigin(true);
retriveOptions.setConfs(md.getConfigurationsNames());
ivy.retrieve(md.getModuleRevisionId(), "lib/[conf]/[artifact].[ext]", etriveOptions);
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误
:: loading settings :: url = jar:file:/D:/programming/eclipse_projects/ivyTest/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
:: retrieving :: org.jtpc#movies
checkUpToDate=true
confs: [default, master, compile, provided, runtime, test, system, sources, …Run Code Online (Sandbox Code Playgroud)