The boundaries of the Maven vs. Project Eclipse for Java EE 6

I created Maven projects inside Eclipse with these archetypes:

  • EJB-javaee6
  • Webapp-javaee6

Projects were created without a limit.

Does it make sense to convert such Maven projects into faceted form?

Which aspects would be useful and which might cause problems for the Maven project?

In particular: can any of the following aspects of the project conflict with what Maven answers?

  • Java
  • Javascript
  • EJB module
  • Dynamic web module
  • GlassFish Deployment Descriptor Files
  • JavaServer Faces

I got the impression that converting a Maven project into a faceted form would mean mixing the two worlds. Therefore, as a rule, I DO NOT admit ANY facet of the project.

But where I work, we have examples of Maven projects that are in faceted form, and I was wondering if there could be (without risk) advantages for it.

+7
source share
2 answers

Eclipse graphs and maven archetypes are orthogonal - that is, they do not affect each other, or rather, do not know each other. You can safely add faces if this makes your work with eclipse easier.

+9
source

After some experimentation, I think I have something that works (except that I cannot force m2e to accept Java 1.7 for EJB).

Versions:

  • Eclipse Juno 4.2
  • m2e 1.3.1
  • GlassFish 3.1.2
  • JDK 1.7.0_17 (Oracle)

IMPORTANT USE NOTE. . In the setup below, you must turn off automatic publishing to GlassFish ("Never Publish Automatically") if you want to start Maven clean and install. For normal editing and saving work in Eclipse, automatic publishing can be turned on and it seems to work fine. Only when I first started Maven (inside Eclipse) did I encounter problems.

Setting up an EJB project using Maven in Eclipse

Create Maven projects in Eclipse with these archetypes: ejb-javaee6 ear-javaee6 webapp-javaee6 webapp-javaee6 -------------- - Convert to faceted form, select GlassFish in Runtimes and enable: - Dynamic Web Module - GlassFish Deployment Descriptors Files - Java - JavaScript - JavaServer Faces Further configuration available... - Content directory: src/main/webapp - NOT checked: Generate web.xml deployment descriptor - JSF Capabilities (all defaults): JSF 2.1 + PrimeFaces selected CHECKED: "Include libraries with this application" ejb-javaee6 ----------- - Convert to faceted form, select GlassFish in Runtimes and enable: - EJB Module - GlassFish Deployment Descriptors Files - Java Further configuration available... - NOT checked: Generate ejb-jar.xml deployment descriptor ear-javaee6 ----------- - Convert to faceted form, select GlassFish in Runtimes and enable: - EAR - GlassFish Deployment Descriptors Files Further configuration available... - Add EJB and WEB projects as dependencies - Content directory: src/main/application (META-INF location used by Maven) - NOT checked: Generate application.xml deployment descriptor 
+1
source

All Articles