简体   繁体   中英

How to add build ear file containing only dependency jars in pom

I would like to create an ear containing only dependency jar files using maven.

<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/maven-v4_0_0.xsd">
    <dependencies>
        <dependency>
            <groupId>groupId</groupId>
            <artifactId>artifactId</artifactId>
        </dependency>
        ......
        ......
        ......
    </dependencies>

    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-ear-plugin</artifactId>
            <configuration>
                <modules>
                    <jarModule>
                        <groupId>groupId</groupId>
                        <artifactId>artifcatId</artifactId>
                        <includeInApplicationXml>true</includeInApplicationXml>
                    </jarModule>
                </modules>
                ...............
                ...............
            </configuration>
        </plugin>
    </plugins>          
</project>

Maven created application.xml automatically which has entries for these jars but still, when deploying, I am getting message in console - "No modules found in ear."

Could you help me out what am I missing here.

An EAR file should contain WARs, RARs, SARs, and EJB JARs. Anything else, including basic library JARs, are unimportant as far as the EAR is concerned and and EAR with just those kind of files is useless as far as a Java EE Application Server is concerned.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM