How can I know the Java EE version of a generated EAR from Maven build? I built an EAR using Maven build and added J2ee dependency as
<dependency>
<groupId>com.ibm.websphere</groupId>
<artifactId>j2ee</artifactId>
<version>6.0</version>
<scope>provided</scope>
</dependency>
in the pom.xml. How can I make sure the generated EAR is of Java EE version 6?
You are mixing to things here - dependencies and packaging.
First, if you plan to work with WebSphere it is better to install WebSphere dependencies into your local repository, rather than add different various dependencies (You don't need to install dependencies for WebSphere Liberty as they are available remotely). You can find installation poms for specific WAS versions here: http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/com/ibm/tools/target/
Then you add dependency like this in your web or ejb project:
<dependency>
<groupId>com.ibm.tools.target</groupId>
<artifactId>was</artifactId>
<version>8.5.5</version>
<type>pom</type>
<scope>provided</scope>
</dependency>
Or use one of the preconfigured archetypes available in the IBM WebSphere repository for creating web/ejb apps for WebSphere.
For packaging you use maven-ear-plugin
like below. For Java EE ear key setting is that version
element inside configuration
. You need to provide that one as default is 1.3.
<plugin>
<artifactId>maven-ear-plugin</artifactId>
<version>2.8</version>
<configuration>
<generateApplicationXml>false</generateApplicationXml>
<version>6</version>
<defaultLibBundleDir>lib</defaultLibBundleDir>
<archive>
<addMavenDescriptor>false</addMavenDescriptor>
</archive>
<modules>
<webModule>
<groupId>helloApp</groupId>
<artifactId>helloWeb</artifactId>
<contextRoot>/helloWeb</contextRoot>
</webModule>
</modules>
</configuration>
</plugin>