问题描述
我想在pom中将一个属性设置为一个包含所有项目依赖项的类路径. ant插件会执行类似的操作,所以我知道这绝对是可能的.
I'd like to set a property in my pom to a classpath containing all the project's dependencies. The ant plugin does something like this, so I know it's definitely possible.
我基本上想在$ pom中的任何地方使用$ {maven.compile.classpath}并使其正常工作".我不介意使用插件或其他任何方式来实现这一目标.
I basically want to use ${maven.compile.classpath} wherever I like in my pom and have it 'just work'. I don't mind using plugins or anything else to achieve this.
非常感谢,
尼克
推荐答案
我不认为没有编写自己的Maven插件就可以做到这一点.也就是说,您可以使用 dependency:build来获取类路径-classpath .是用的吗?
I don't think that there's a way of doing this without writing your own maven plugin. That said, you can get at the classpath using dependency:build-classpath. Is that of use?
这篇关于将属性设置为maven.compile.classpath不包含Ant的内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!