简体   繁体   中英

Maven - how to create ejb client when packing jar

I would like to build two jar files - one for the client and one for the server side. I tried to follow Maven - how to create ejb client when packing war without any luck. My pom is very simple but I can't figure out what's wrong with it. I only get one jar with all classes.

<?xml version="1.0" encoding="UTF-8"?>
<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>com.valdoprojects.employeemanagementserverapplication</groupId>
    <artifactId>EmployeeManagmentServerApplication</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>7.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.wildfly.plugins</groupId>
            <artifactId>wildfly-maven-plugin</artifactId>
            <version>1.2.0.Final</version>
            <type>maven-plugin</type>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ejb-plugin</artifactId>
                    <version>3.1</version>
                    <configuration>
                        <generateClient>true</generateClient>
                        <clientIncludes>
                            <clientInclude>/com/valdoprojects/employeemanagement/domain/**</clientInclude>
                            <clientInclude>**/*Service*</clientInclude>
                        </clientIncludes>
                    </configuration>
                    <goals>
                        <goal>ejb</goal>
                    </goals>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

看来您需要将<packaging>jar更改为ejb并在<ejbVersion>下指定<ejbVersion> <configuration>

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