开发者

Specify project for dependency:copy-dependencies?

dependency:copy-dependencies copies the dependencies of the current project into some path. How do I copy the dependencies of other projects (not the current one) into some path?

UPDATE: I doesn't help to declare the other projects as a dependency of the current one because I need to copy each project's dependencies into a separate directory. Declaring them as a dependency on the current project would copy all the dependencies 开发者_StackOverflow社区into the same directory, which isn't what I want.


If you know what are the dependencies of the other project (which you can know by examining the pom), you can use the dependency:copy goal specifying the list of artifacts that you want to copy. A few examples are available here.


Call mvn with the parameter -f and the path to the pom of that other project (mvn -f /path/to/pom.xml dependency:copy-dependencies).

Edited from comment: Then you have to specify that project as a dependency of your first project. Otherwise it wouldn't work (as i read your description, it is a dependency, otherwise i couldn't think of a reason, why i would want that).


I'm trying to do this too - currently I'm copying dependencies in the sub projects, and then the installer project copies those to its specific subdirectories of target/ by relative path. Dirty hack that requires everything to be in one place. Would be much nicer to be able to copy the dependencies of a dependency.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜