0
我多模塊Maven項目:Maven的模塊罐子不添加到戰爭的lib
Parent
Core module
Web module
War Module
時期和戰爭時期的POM我添加的Web和核心的依賴性:
<?xml version="1.0"?>
<project
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.team.hello</groupId>
<artifactId>helloParent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>hello-war</artifactId>
<packaging>war</packaging>
<name>hello-war Maven Webapp</name>
<url>http://maven.apache.org</url>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.team.hello</groupId>
<artifactId>hello-web</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.team.hello</groupId>
<artifactId>hello-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>hello-war</finalName>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<packagingIcludes>WEB-INF/lib/*.jar</packagingIcludes>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>
,並在網站的pom.xml
我添加了Core模塊的依賴項。
在建設使用我看到在戰爭中的lib
文件夾兩瓶,但同時發佈到JBoss的EAP它僅複製網頁的jar
文件夾lib
但不是核心的jar
文件。
你能告訴我我哪裏錯了嗎?
如果你打開這場戰爭,它裏面有什麼? – Taylor
lib文件夾中的所有maven相關jar文件和hello-web-0-0-1-snapshot.jar文件,視圖等。但hello-core-0-0-1-sapshot.jar不會複製到lib文件夾 – Arat
'packagingIcludes'有一個錯字,它應該是'packagingIncludes'。但爲什麼要使用它呢?刪除它,讓'maven-war-plugin'完成它的工作。 – Tunaki