I made an EJB project through Maven using “org.codehaus.mojo.archetypes:ejb-jee5” lastest version.
Then I typed “mvn install” and “mvn eclipse:eclipse”.
Finally I imported it as a general java project in eclipse but the project is not being recognised as being EJB capable.
What did I do wrong?
Thanks
EDIT
tried this as suggested by an awnser, doesn’t work
<build>
<plugins>
<plugin>
<artifactId>maven-eclipse-plugin</artifactId>
<configuration>
<buildcommands>
<buildcommand>org.eclipse.wst.common.project.facet.core.builder</buildcommand>
<buildcommand>org.eclipse.jdt.core.javabuilder</buildcommand>
<buildcommand>org.eclipse.wst.validation.validationbuilder</buildcommand>
</buildcommands>
<additionalProjectnatures>
<projectnature>org.eclipse.jem.workbench.JavaEMFNature</projectnature>
<projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature>
<projectnature>eclipse.jdt.core.javanature</projectnature>
<projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature>
</additionalProjectnatures>
</configuration>
</plugin>
</plugins>
</build>
EDIT
Apparently adding those builder and natures to your .project is not enougth, an xml file describing wich facet is enabled must be generated too, in order to do that I should add the following code betwen the ” tags
<additionalProjectFacets>
<jst.java>1.6</jst.java>
<jst.ejb>3.0</jst.ejb>
</additionalProjectFacets>
However those 4 line generate a ‘Build failure’
So I found out, as expected modifying the project natures is not enought, you also have to generate other file describing thing such as activated facets, etc.
add this to your EJB project and it will be recognized as an EJB without m2e.
notice that We are defining wich Server runtime is being used, meaning you have to configure a server runtime before and put it’s name inside.