0

We have a number of war projects in eclipse. When they are imported as maven projects, the annotation processing are automatically enabled.

Tried disabling the annotation processing by adding <proc>none</proc> to the maven-compiler-plugin. It doesn't help.

If preferences -> Maven -> Enable Java EE configuration is disabled, the annotation processing is NOT enabled (but then the modules can't be deployed). As soon as that option is checked, the maven update starts and the annotation processing is re-enabled.

All the modules affected are identified as J2EEModuleVirtualComponent show the same maven debug information:

YYY is a J2EEModuleVirtualComponent Underlying resources for the root folder are : -/YYY/src/main/java/ -/YYY/src/main/resources/ -/YYY/.apt_generated/

Is there a way to enable the Java EE configuration while disabling the annotation processing?

movees
  • 183
  • 1
  • 15

1 Answers1

0

It turned out the annotations were being enabled by two plugins from the GWT eclipse plugin. To disable them I had to do the following:

Make a security copy of C:\Users\.p2\pool\artifacts.xml and remove the following entries (the versions might change depending on your GWT plugin). Depending on your installation the .p2 folder might be in the eclipse instead.

    <artifact classifier='osgi.bundle' id='com.ibm.etools.javaee.cdi.ext.ui' version='1.2.300.v20171018_0400'>
      <properties size='1'>
        <property name='download.size' value='161017'/>
      </properties>
    </artifact>

<artifact classifier='osgi.bundle' id='com.ibm.etools.javaee.cdi.ext.ui' version='1.2.0.v20150617_2241'>
      <properties size='1'>
        <property name='download.size' value='158451'/>
      </properties>
    </artifact>

Same for the entries in all the versions of C:\Users\.p2\pool\features\com.ibm.ws.st.jee.tools.feature: Backup the feature.xml and remove the "com.ibm.etools.javaee.cdi.ext.ui" and "com.ibm.etools.javaee.cdi.ext.ui" entries.

Restart your eclipse and verify in help->about eclipse->Installation details-> Plug-ins that "com.ibm.etools.javaee.cdi.ext.ui" and "com.ibm.etools.javaee.cdi.ext.ui" are no longer listed.

If you want to clean your work space, remove all the imported maven projects (not the parent ones) and execute the attached script from the root of the work space. This will delete all the generated files, and leave the projects as if they had been just imported from the repository. After that you can re-import the existing maven projects, and verify that no apt_generated folders are created or added to the paths, and annotation processing are disabled in all the the projects.

To verify automatically that no annotation processing has been enable, search your work space for "org.eclipse.jdt.apt.core.prefs" files and ".apt_generated" folders. There should be none.

movees
  • 183
  • 1
  • 15