받는다는 전쟁 - 플러그인은 당신이 당신의 웹 파일을 모두와 전쟁 파일을 만들 수 있습니다, 종속 프로젝트에 overlay로 사용합니다. ,
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar.baz</groupId>
<artifactId>big-messy-ui</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
을 나는 받는다는 내 UI 프로젝트에 설치 할 후 :
이의 내가이
src
|-main
|-webapp
|-jsp
| |-thing1.jsp
| |-thing2.jsp
|-WEB-INF
|-web.xml
같은 프로젝트에 일부 UI 코드가 그 pom.xml 파일은 다음과 같습니다 가정 해 봅시다 나는이 같은 응용 프로그램에 포함 할 수 있습니다
<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">
<modelVersion>4.0.0</modelVersion>
<groupId>foo.bar.baz</groupId>
<artifactId>some-app</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>war</packaging>
<dependencies>
<!-- include ui as an overlay -->
<dependency>
<groupId>foo.bar.baz</groupId>
<artifactId>big-messy-ui</artifactId>
<version>0.0.1-SNAPSHOT</version>
<type>war</type>
</dependency>
</dependencies>
<build>
<finalName>SomeApp</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
</configuration>
</plugin>
</plugins>
</build>
</project>
,
지금 SomeApp
의 전쟁 파일은 내가 가져온 지저분한 UI의 로컬 프로젝트에 포함 된 모든 플러스 모든 것 :
SomeApp.war : 적절한 것 같다
jsp
|-thing1.jsp // from overlay
|-thing2.jsp // from overlay
|-plus anything from SomeApp's src/main/webapp/jsp
META-INF
|-MANIFEST.MF
WEB-INF
|-classes
| |-.class files from SomeApps's src/main/java
|-web.xml (from SomeApp, the web.xml from the overlay is dropped)
그래 그것을하는 방법 :) –