project.compileClasspathElements 默认值介于 Maven 2 和 3 之间
我继承了一个 Maven 项目/模块,当我从 Maven 2 切换到 Maven 3 时,该项目/模块失败了。它取决于外部程序的执行,而该外部程序取决于 project/module/target/classpath.txt 的内容。该文件由使用 ${project.compileClasspathElements} 的自定义插件生成。
在 Maven 2 中,它包含:
project/module/target/classes
[all my dependencies in my local repository]
但在 Maven 3 中,classpath.txt 文件仅包含:
project/module/target/classes
换句话说,该文件缺少所有实际依赖项(除了构建目录)。 Maven 2 和 Maven 3 之间关于 project.compileClasspathElements 是否有变化?我怎样才能恢复所有依赖项,以便它像 Maven 2 一样工作?
[这个问题经过编辑以反映我刚刚发现的 classpath.txt 的来源。]
I inherited a Maven project/module that failed when I switched from Maven 2 to Maven 3. It hinges on the execution of an external program that depends on the contents of project/module/target/classpath.txt. This file is generated by a custom plugin that uses ${project.compileClasspathElements}.
In Maven 2 this contained:
project/module/target/classes
[all my dependencies in my local repository]
But in Maven 3, the classpath.txt file only contains:
project/module/target/classes
In other words, the file is missing all the actual dependencies, save for the build directory. Was there a change between Maven 2 and Maven 3 regarding project.compileClasspathElements? How can I get all the dependencies back so that it will work like Maven 2?
[This question was edited to reflect the source of classpath.txt, which I only just discovered.]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
刚刚在迁移在打包阶段执行的 maven 2 插件时遇到了这个问题。通过添加
到 Mojo 来修复,例如
来自 http://maven.apache.org/开发人员/mojo-api-specification.html
Just encountered this issue when migrating a maven 2 plugin that executes during the package phase. Fixed by adding
to the Mojo, e.g.
From http://maven.apache.org/developers/mojo-api-specification.html