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