开发者

Maven depend on project - no jar but classes

开发者 https://www.devze.com 2023-03-13 21:46 出处:网络
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

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 开发者_Python百科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 -classes artifact by adding <classifier>classes</classifier> to the pom.

Otherwise you can use the dependency plugin to unpack the B artifact when C is packaged.

0

精彩评论

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