Skip to content

Latest commit

 

History

History
 
 

wildfly-jakartaee-ear-archetype

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

WildFly archetype for blank EAR project

Introduction

This archetype creates a blank EAR project with EJB and Web module. It is prepared for running Arquillian unit tests. More details can be found in the file "src/main/resources/archetype-resources/README.txt", which is end-user doc and added to the resulting project.

Component Dependencies

The versions of all dependencies and plugins that are used by this archetype are configured in the parent’s pom.xml.

Build

To build the archetype, you need at least Java 11. Run this command:

$ mvn clean install

It will be installed to your local maven repository at "%USERHOME%/.m2/repository/org/wildfly/archetype/wildfly-jakartaee-ear-archetype/", and an entry will be added to "%USERHOME%/.m2/repository/archetype-catalog.xml".

Create project from archetype

To create a new project from this archetype, use this maven command (replace dummy values for "groupId", "artifactId" and "version" with correct values):

$ mvn archetype:generate -DgroupId=my.project.org -DartifactId=sample-jakartaee-ear-archetype -Dversion=1.0-SNAPSHOT -DarchetypeGroupId=org.wildfly.archetype -DarchetypeArtifactId=wildfly-jakartaee-ear-archetype -DarchetypeVersion=30.0.0.Final-SNAPSHOT

Test the archetype

After having built the archetype, check whether both profiles "arq-remote" and "arq-managed" work. This is done by using scripts found in the directory "testing".

  • Profile "arq-managed": set variable JBOSS_HOME, then execute "runtest_managed.bat/.sh <archetypeVersion>" (replace "<archetypeVersion>" with the current archetype version)

  • Profile "arq-remote": start WildFly server, then execute "runtest_remote.bat/.sh <archetypeVersion>" (replace "<archetypeVersion>" with the current archetype version)

Both files create a project from the archetype (in "testing/arq-managed" or "testing/arq-remote"), copy an Arquillian unit test class and an EJB in this project, then build and deploy it to WildFly and execute the test using the Arquillian profile "arq-managed" or "arq-remote").

After the test is executed, check the server log for error outputs. In case of success, the outputs "Test is invoked…​" and "doTest is invoked…​" will be printed in the server console.