Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Java Maven project disable dafault project facets

Using Eclipse Luna SR1 with the m2e plugin, I have created a Java web project with Maven.

How do I remove the default project facets (e.g. CDI, JPA, etc.) in the project's pom.xml?

enter image description here

Unchecking "Project Facets" in Project -> Properties resets after Maven -> Update Project.

like image 276
Zigac Avatar asked Dec 25 '22 22:12

Zigac


1 Answers

You can either disable the m2e integration with the related Facets at the workspace preferences or the project properties level, under Maven > Java EE integration (for JAX-RS, JPA, JSF) and under JBoss Tools > JBoss Maven Integration for CDI, Hibernate, ...

Alternatively, you can use pom properties directly in your pom.xml :

 <m2e.jaxrs.activation>false</m2e.jaxrs.activation>
 <m2e.jpa.activation>false</m2e.jpa.activation>
 <m2e.jsf.activation>false</m2e.jsf.activation>
 <m2e.cdi.activation>true</m2e.cdi.activation>

For more information, please refer to :

  • https://wiki.eclipse.org/M2E-WTP/New_and_Noteworthy/1.0.0#Enable.2FDisable_the_JAX-RS.2FJPA.2FJSF_Configurators_at_the_pom.xml_level
  • http://tools.jboss.org/documentation/whatsnew/jbosstools/4.2.0.Final.html#pom-properties-controlled-project-configurators

Please note that the JAX-WS Node you see in the project explorer is automatically added by WTP and is not controlled by any m2e integration plugin.

If it bothers you, you can hide it from the Project Explorer view, Customize View...>Content> uncheck JAX-WS Web Services Elements

like image 60
Fred Bricon Avatar answered Dec 28 '22 06:12

Fred Bricon