java - Maven combine two project - Stack Overflow

How can i bine two maven projects. One is webapp, and other is some javascript library (also webapp) wh

How can i bine two maven projects. One is webapp, and other is some javascript library (also webapp) which i want to bine with others project.

Or, would be better, how to add some outside folder with js files to maven project that can be deployed on testing server and then build to war.

How can i bine two maven projects. One is webapp, and other is some javascript library (also webapp) which i want to bine with others project.

Or, would be better, how to add some outside folder with js files to maven project that can be deployed on testing server and then build to war.

Share Improve this question asked Dec 8, 2014 at 10:54 user3714967user3714967 1,6453 gold badges16 silver badges33 bronze badges 1
  • From my point of view JS are considered as resources and it should go along with project it self, if you want to have different JS to bundled with war then you should use profile in maven for the same. – Bilbo Baggins Commented Dec 8, 2014 at 10:58
Add a ment  | 

3 Answers 3

Reset to default 5

Have a look at overlays in the Maven WAR Plugin documentation. This explains how Maven merges resources from different web projects into a single WAR.

In a nutshell, you create several WAR files of all the dependencies (usually, you already have this but you can even do this if they aren't real working web projects). Then you can pull these in as dependencies. The important part here is to specify the type of the dependency (<type>war</type>); otherwise Maven will try to add the JAR.

The WAR plugin will notice the additional WARs in the list of dependencies and merge them.

You can create One parent project and Two modul project. You will have 3 pom.xml files. modul projects extendens dependencies from parent project. Maven parent pom vs modules pom, Multimodule project

Maven WAR Overlays could solve the problem. If you have two maven web projects, and one of your Web Project depends on the other's you could declare the dependent project as a dependency and do an overlay.

Reference:

http://maven.apache/plugins/maven-war-plugin/overlays.html

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744402174a4572444.html

相关推荐

  • java - Maven combine two project - Stack Overflow

    How can i bine two maven projects. One is webapp, and other is some javascript library (also webapp) wh

    6天前
    20

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信