我希望有一个包含两个战争包的最终战争包:
前端- angularjs,BackendApi -包括REST到下一个(外部api)
我知道我可以把它塞进耳朵里,但我关心的是战争
<modules>
<module>Commons</module> <!-- jar package -->
<module>WarCreator</module> <!-- war package -->
<module>Web/Frontend</module> <!-- war package -->
<module>Web/BackendApi</module> <!-- war package -->
</modules>WarCreator在war中构建整个包,pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>testtest</artifactId>
<groupId>testtest</groupId>
<version>1.0</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<packaging>war</packaging>
<artifactId>Dist</artifactId>
<version>1.0</version>
<dependencies>
<dependency>
<groupId>testtest</groupId>
<artifactId>Frontend</artifactId>
<version>1.0</version>
<type>war</type>
</dependency>
<dependency>
<groupId>testtest</groupId>
<artifactId>BackendApi</artifactId>
<version>1.0</version>
<type>war</type>
</dependency>
</dependencies>
</project>后端和FrontendApi包都有jboss-web.xml文件,设置如下:
<jboss-web>
<context-root>/rest</context-root>
</jboss-web>
<jboss-web>
<context-root>/view</context-root>
</jboss-web>但是最终的war包只有第一个模块,并且只注册了这个模块(在widlfly日志中可见)。
有没有办法让一场包含两个战争包的战争?
发布于 2018-02-09 04:20:15
你在哪里看到你可以在一场战争中打包两场战争?
战争并不是为了遏制另一场战争而设计的。
正如您所注意到的,Maven不允许这样做。即使您设法通过使用技巧来做到这一点,应用程序服务器也可能无法识别它们。
要实现你想要的东西,最好使用一种传统的方式来打包多场战争,或者更好:不要试图将它们联系起来。
事实上,使战争独立为它们的部署和维护提供了更多的灵活性。
https://stackoverflow.com/questions/48694003
复制相似问题