how to create separate war for my front end (angularjs) in multimodule maven project

强颜欢笑 提交于 2019-12-08 05:37:58

问题


I am using this directory structure :

Parent
 | 
 |--Back-end(one module FOR enitity)
 |   |- pom.xml
 |
 |--Back-end(one module FOR rest)
 |   |- pom.xml
 |
 |--Back-end(one module FOR service)
 |   |- pom.xml
 |
 |--Front-end(module for angular)
 |   |-public
 |   |    |-myApp
 |   |        |-all angularjs related files
 |   
 |
 |
 |pom.xml  

My back-end module produces a WAR but now how to make separate war for angular : the goal here is to be able to deploy the entire javascript application(angularjs) as a java war file.


回答1:


Try to use <packaging>jar</packaging> for all modules. Then create two new modules which have <packaging>war</packaging> and which depend on the plain JARs created by the other modules.

That way, you can reuse the Java code in your WARs. If you want to share files below WEB-INF, then you can create a common WAR module for that and use WAR overlays. This means you have many modules which produce JARs and three that produce WARs. Note that WAR overlays are somewhat brittle, so it's often better to stay away from them.



来源:https://stackoverflow.com/questions/29145394/how-to-create-separate-war-for-my-front-end-angularjs-in-multimodule-maven-pro

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