Java Reference
In-Depth Information
Note
The scope provided includes the enterprise dependencies and corresponds to adding a lib-
rary to the compilation path. Therefore, it expects the JDK or a container to provide the
dependency at runtime. Besides dependencies, we would like to configure the build pro-
cess. The created project specifies the EJB packaging, but the build is performed with the
JDK 1.5 compliance level and an old EJB version. This is why we want to add an addi-
tional block to
pom.xml
, which is as follows:
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.1</version>
<configuration>
<!-- enforce Java 8 -->
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-ejb-plugin</artifactId>
<version>2.3</version>
<configuration>
<ejbVersion>3.2</ejbVersion>
<!-- Generate ejb-client for client project
-->
<generateClient>true</generateClient>
</configuration>
</plugin>
</plugins>
</build>
This block does two things, which are as follows:
• The
maven-compiler-plugin
configuration enforces the usage of Java 8