Properties Nathan Coast
PropertyOptional?DescriptionDefault
maven.ear.final.name Yes Name of the generated EAR file. ${maven.final.name}.ear
maven.ear.manifest Yes Location of the manifest file to be used within the ear file. ${maven.ear.src}/META-INF/MANIFEST.MF
maven.ear.displayname Yes Display name of the application to be used when application.xml file is autogenerated ${pom.artifactId}
maven.ear.resources Yes Directory that resources are copied to during the build.NOTE: cannot have the same value of ${maven.ear.src}! ${maven.build.dir}/ear
maven.ear.src Yes Single directory for extra files to include in the EAR. NOTE: cannot have the same value of ${maven.ear.resources}! ${maven.src.dir}/application
maven.ear.descriptordir Yes Directory where the application.xml file will be auto-generated (only if maven.ear.appxml.generate is true). ${maven.build.dir}
maven.ear.appxml Yes Location of the application.xml file to be used within the ear file. ${maven.ear.src}/META-INF/application.xml
maven.ear.appxml.generate Yes Indicates if application.xml files should be autogenerated false
maven.ear.appxml.version Yes Inserts the doctype header depending on the specified version. 1.3
maven.ear.appxml.encoding Yes Character encoding for the auto-generated application.xml file. UTF-8
maven.ear.appxml.description Yes The description element inserted in the descriptor. ${pom.description}
maven.ear.appxml.securityRoles Yes A comma-separated list of role names. Will create xml element security-role with sub-element role-name. Empty
PropertyDescriptionSee
maven.build.dir where the component will be assembled maven.build.dir
maven.final.name The assembled component will be ${maven.build.dir}/${maven.final.name}.ear maven.final.name

You must tell Maven what artifact you want to include in the ear. This operation is type sensitive. Maven can bundle in ear artifacts of following types: jar, war, ejb, rar, sar. Artifacts of other types are ignored. This is achieved by specifying meta-information in the POM, using the following syntax:

groupId ejbArtifactId aversion ejb true ]]>

Those artifacts will be also "visible" during generation of application.xml file. In case of war artifacts you can also specify context root which will be set in application.xml file:

groupId warArtifactId aversion war true webapp ]]>

Note that by default the artifacts will be bundled in the EAR's root directory. To change the location where an artifact is bundled, please use the ear.bundle.dir property:

groupId jarArtifactId aversion jar true APP-INF/lib ]]>

(it does not matter if the value of ear.bundle.dir starts with a slash (/) or not - it will always be relative to the root of the EAR)

It is also possible to change the name by which the dependency will be bundles using the ear.bundle.name property:

groupId jarArtifactId aversion jar true aJar ]]>

In the example above, the dependency will be bundled simply as aJar and not jarArtifactId.aversion; note that ear.bundle.name and ear.bundle.dir can be used together:

groupId jarArtifactId aversion jar true aJar /anotherDir ]]>

Finally, please note that if a jar is a java client module, you will need to declare it using the ear.module property, rather than ear.bundle:

groupId jarArtifactId aversion jar true ]]>