Ear-javaee6 archetype does not allow Java files

I created a new Maven project and selected the archetype org.codehaus.mojo.arhcetypes ear-javaee6. When I try to add a Java class to the project, I get "The source folder is not a Java project."

Therefore, we should not add Java classes to exit .ear files. What do these guys think when they create a project for .ear but donโ€™t allow Java classes?

What archetype should I use to create Java EE 6..ear files?

+4
source share
1 answer

From Wikipedia, EAR (file format) :

EAR (Enterprise Archive) is a file format used by Java EE to pack one or more modules into a single archive [...]

Create an EJB ( ejb-javaee6 archetype) or a WAR project ( webapp-javaee6 archetype, for example) for your java codes and access it from the in- ear configuration plugin (and add also the dependency).

0
source

All Articles