Passionate developer
Passionate developer

Reputation: 185

Maven module jars not added to war lib

I have multi-module Maven project:

Parent 
  Core module
  Web module
  War Module

And in War's POM I added the dependency of Web and Core:

<?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>

and in Web's pom.xml I added the dependency of Core module.

While building using clean -e install I am seeing two jars in War's lib folder but, while publishing to jboss-eap it is copying only Web's jar file to lib folder but not Core's jar file.

Could you tell me where I am wrong?

Upvotes: 0

Views: 1398

Answers (1)

Passionate developer
Passionate developer

Reputation: 185

Finally I found the solution. I removed the pluginmanagement and then deleted .settings and .project of war module and then reimported the projects(checked the deployed assembly it has both core and web and maven) the cleaned the jboss eclipse(in eclipse jboss server--right click-->clean) then it published the jar.

Upvotes: 2

Related Questions