Maven依赖项目 - 没有jar但是类 [英] Maven depend on project - no jar but classes
问题描述
我们假设C是一个Web应用程序,所以默认情况下B.jar将被包含在C的WEB-INF / lib目录中。
但是,我要编译B,然后移动它的编译类到C的目标目录。
如何在Maven中实现?
谢谢对于您的答案,
balázs
如果您的模块> B 也是一个webapp模块,你可以通过c 配置战争插件。然后,您可以通过添加< classifier> classes< / classifier> 根据
-classes
code>到pom。
否则你可以使用依赖插件来解压缩 I have a multi-module Maven project A. There are two modules: B and C, where C depends on B. Let's say C is a web application, so by default B.jar would be included in the WEB-INF/lib directory of C. But instead of this, I want to compile B, and then move its compiled classes to the target directory of C. How can I achieve this in Maven? Thank you for your answers, balázs If your module B is also a webapp module, you can create a jar file containing only the classes simply by configuring the war plugin. You can then make C depend on that Otherwise you can use the dependency plugin to unpack the B artifact when C is packaged. 这篇关于Maven依赖项目 - 没有jar但是类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!-classes
artifact by adding <classifier>classes</classifier>
to the pom.