17.08.2016 Views

Apache Maven 3 Cookbook

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 5<br />

ff<br />

ff<br />

ff<br />

sar<br />

wsr<br />

har<br />

The minimum requirements for this plugin are <strong>Maven</strong> 2.0.6 or higherer and JDK 1.4 or higher.<br />

Getting ready<br />

If you don't have a <strong>Maven</strong> Java project, create one by executing the following command:<br />

$mvn archetype:generate -DarchetypeArtifactId=maven-archetype-j2ee-simple<br />

This command creates a simple J2EE Enterprise application with the following structure:<br />

├───ear<br />

├───ejbs<br />

│ └───src<br />

│ └───main<br />

│<br />

└───resources<br />

│<br />

└───META-INF<br />

├───primary-source<br />

├───projects<br />

│ └───logging<br />

├───servlets<br />

│ └───servlet<br />

│ └───src<br />

│<br />

└───main<br />

│<br />

└───webapp<br />

│<br />

└───WEB-INF<br />

└───src<br />

└───main<br />

└───resources<br />

As of today, this archetype contains a bug. The generate pom.xml must be modified and<br />

the site sub module must be removed.<br />

How to do it...<br />

The configuration of the EAR plugin is similar to the configuration of the other plugins. The<br />

following needs to be specified in your <strong>Maven</strong> Java project:<br />

<br />

[...]<br />

<br />

[...]<br />

103

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!