Maven depend on project - no jar but classes

独自空忆成欢 提交于 2019-12-11 03:29:40

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/6373534/maven-depend-on-project-no-jar-but-classes

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!