• Home
  • LLMs
  • Docker
  • Kubernetes
  • Java
  • All
  • About
Maven | Create an EJB module (JAR file)
  1. Using the archetype "ejb-javaee6"
  2. pom.xml file (sample)

  1. Using the archetype "ejb-javaee6"
    $ mvn archetype:generate \
      -DarchetypeGroupId=org.codehaus.mojo.archetypes \
      -DarchetypeArtifactId=ejb-javaee6 \
      -DarchetypeVersion=1.5 \
      -DgroupId=mtitek.maven.ejb.samples \
      -DartifactId=mtitek-maven-ejb-samples \
      -Dpackage=mtitek.maven.ejb.samples \
      -Dversion=1.0.0-SNAPSHOT \
      -DinteractiveMode=false
  2. pom.xml file (sample)
    <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>mtitek.maven.ejb.samples</groupId>
        <artifactId>mtitek-maven-ejb-samples</artifactId>
        <version>1.0.0-SNAPSHOT</version>
        <packaging>ejb</packaging>
    
        <build>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-ejb-plugin</artifactId>
                    <version>3.2.1</version>
    
                    <configuration>
                        <ejbVersion>3.1</ejbVersion>
                    </configuration>
                </plugin>
            </plugins>
        </build>
    </project>
    Build the project:
    $ mvn clean install
© 2025  mtitek