Maven Eclipse Plugin (RETIRED)
  1. Maven Eclipse Plugin (RETIRED)
  2. MECLIPSE-449

Facet Generation generates duplicate entries - breaks RAD/RSA support

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.5.1
    • Fix Version/s: None
    • Component/s: WTP support
    • Labels:
      None
    • Environment:
      WinXP, IBM RSA V7.0.0.6 (Eclipse 3.2.2)

      Description

      Using V2.5.1 of the maven-eclipse-plugin, I have some issues in getting the generated artifacts being correct.

      Take this section of the POM:

      <additionalProjectFacets>
      <jst.java>5.0</jst.java>
      <jst.ejb>2.1</jst.ejb>
      <com.ibm.websphere.extended.ejb>6.1</com.ibm.websphere.extended.ejb>
      </additionalProjectFacets>

      Generates this:

      <faceted-project>
      <fixed facet="jst.java"/>
      <fixed facet="jst.utility"/>
      <installed facet="jst.utility" version="1.0"/>
      <installed facet="jst.java" version="5.0"/>
      <installed facet="com.ibm.websphere.extended.ejb" version="6.1"/>
      <installed facet="jst.ejb" version="2.1"/>
      <installed facet="jst.java" version="5.0"/>
      </faceted-project>

      You'll see that the jst.java facet is in there twice.

      Removing the facet from the list:

      <additionalProjectFacets>
      <jst.ejb>2.1</jst.ejb>
      <com.ibm.websphere.extended.ejb>6.1</com.ibm.websphere.extended.ejb>
      </additionalProjectFacets>

      Generates this:

      <faceted-project>
      <fixed facet="jst.java"/>
      <fixed facet="jst.utility"/>
      <installed facet="jst.utility" version="1.0"/>
      <installed facet="jst.java" version="5.0"/>
      <installed facet="com.ibm.websphere.extended.ejb" version="6.1"/>
      <installed facet="jst.ejb" version="2.1"/>
      </faceted-project>

      Which is a little more correct.

      I consider this a bug, as the facets (by their very definition) are unique and should not be repeated.

      Additionally, when compared to a RSA (V7) generated one, it is missing the standard XML header:

      <?xml version="1.0" encoding="UTF-8"?>

      Also, where does the jst.utility facet come from?

      It's inclusion is getting in the way of RSA recognising it as a true J2EE component project (the EJB Deployment descriptor tree element does not display in the Project Explorer view in the J2EE Perspective).

      This is the complete RSA generated one, for reference:

      <?xml version="1.0" encoding="UTF-8"?>
      <faceted-project>
      <runtime name="WebSphere Application Server v6.1"/>
      <fixed facet="jst.ejb"/>
      <fixed facet="jst.java"/>
      <installed facet="jst.ejb" version="2.1"/>
      <installed facet="jst.java" version="5.0"/>
      <installed facet="com.ibm.websphere.extended.ejb" version="6.1"/>
      </faceted-project>

      (Which raises another question, how do we specify the runtime items and if something is fixed or not?)

      However, to get it to be correctly recognised, all we need is this:

      <faceted-project>
      <fixed facet="jst.java"/>
      <installed facet="jst.java" version="5.0"/>
      <installed facet="jst.ejb" version="2.1"/>
      <installed facet="com.ibm.websphere.extended.ejb" version="6.1"/>
      </faceted-project>

      1. sample-noerror.zip
        3 kB
        Diego Gomes
      2. sample-error.zip
        3 kB
        Diego Gomes
      3. MECLIPSE-449.patch
        22 kB
        Daniel Rohe

        Activity

        Hide
        Chris Graham added a comment -

        As a follow up, RSA V7 reports an error when editing the facets that:

        EJB Module 2.1 and Utility Module 1.0 cannot both be selected.

        Show
        Chris Graham added a comment - As a follow up, RSA V7 reports an error when editing the facets that: EJB Module 2.1 and Utility Module 1.0 cannot both be selected.
        Hide
        Chris Graham added a comment -

        As a further follow up:

        The pom of this project (which is an EJB project) had a packaging of type: JAR, not EJB.

        Once that was done, the generated facet settings files was:

        <faceted-project>
        <fixed facet="jst.java"/>
        <fixed facet="jst.ejb"/>
        <installed facet="jst.ejb" version="2.1"/>
        <installed facet="jst.java" version="5.0"/>
        <installed facet="com.ibm.websphere.extended.ejb" version="6.1"/>
        </faceted-project>

        Which removes my concerns about the utility project.

        This is the build section from the pom is now:

        <build>
        <plugins>
        <plugin>
        <artifactId>maven-eclipse-plugin</artifactId>
        <configuration>
        <wtpversion>1.5</wtpversion>

        <additionalBuildcommands>
        <buildcommand>org.eclipse.wst.validation.validationbuilder</buildcommand>
        <buildcommand>org.eclipse.wst.common.project.facet.core.builder</buildcommand>
        </additionalBuildcommands>

        <additionalProjectnatures>
        <projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature>
        <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature>
        </additionalProjectnatures>

        <classpathContainers>
        <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere v6.1 JRE</classpathContainer>
        <classpathContainer>org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v61/was.base.v61</classpathContainer>
        <classpathContainer>org.eclipse.jst.j2ee.internal.module.container</classpathContainer>
        </classpathContainers>

        <additionalProjectFacets>
        <com.ibm.websphere.extended.ejb>6.1</com.ibm.websphere.extended.ejb>
        </additionalProjectFacets>

        </configuration>
        </plugin>
        </plugins>
        </build>

        Show
        Chris Graham added a comment - As a further follow up: The pom of this project (which is an EJB project) had a packaging of type: JAR, not EJB. Once that was done, the generated facet settings files was: <faceted-project> <fixed facet="jst.java"/> <fixed facet="jst.ejb"/> <installed facet="jst.ejb" version="2.1"/> <installed facet="jst.java" version="5.0"/> <installed facet="com.ibm.websphere.extended.ejb" version="6.1"/> </faceted-project> Which removes my concerns about the utility project. This is the build section from the pom is now: <build> <plugins> <plugin> <artifactId>maven-eclipse-plugin</artifactId> <configuration> <wtpversion>1.5</wtpversion> <additionalBuildcommands> <buildcommand>org.eclipse.wst.validation.validationbuilder</buildcommand> <buildcommand>org.eclipse.wst.common.project.facet.core.builder</buildcommand> </additionalBuildcommands> <additionalProjectnatures> <projectnature>org.eclipse.wst.common.project.facet.core.nature</projectnature> <projectnature>org.eclipse.wst.common.modulecore.ModuleCoreNature</projectnature> </additionalProjectnatures> <classpathContainers> <classpathContainer>org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/WebSphere v6.1 JRE</classpathContainer> <classpathContainer>org.eclipse.jst.server.core.container/com.ibm.ws.ast.st.runtime.runtimeTarget.v61/was.base.v61</classpathContainer> <classpathContainer>org.eclipse.jst.j2ee.internal.module.container</classpathContainer> </classpathContainers> <additionalProjectFacets> <com.ibm.websphere.extended.ejb>6.1</com.ibm.websphere.extended.ejb> </additionalProjectFacets> </configuration> </plugin> </plugins> </build>
        Hide
        Alessandro Zucchi added a comment -

        The problem is not localized only on IBM RSA V7.0.0.6.
        Also Eclipse 3.3 / 3.4 duplicate entry using <additionalProjectFacets>.
        For me:

        <additionalProjectFacets>
        <jst.web>2.3</jst.web>
        </additionalProjectFacets>

        give the following result:

        <faceted-project>
        <fixed facet="jst.java"/>
        <fixed facet="jst.web"/>
        <installed facet="jst.web" version="2.4"/>
        <installed facet="jst.java" version="5.0"/>
        <installed facet="jst.web" version="2.3"/>
        </faceted-project>

        Regards
        Ale.

        Show
        Alessandro Zucchi added a comment - The problem is not localized only on IBM RSA V7.0.0.6. Also Eclipse 3.3 / 3.4 duplicate entry using <additionalProjectFacets>. For me: <additionalProjectFacets> <jst.web>2.3</jst.web> </additionalProjectFacets> give the following result: <faceted-project> <fixed facet="jst.java"/> <fixed facet="jst.web"/> <installed facet="jst.web" version="2.4"/> <installed facet="jst.java" version="5.0"/> <installed facet="jst.web" version="2.3"/> </faceted-project> Regards Ale.
        Hide
        Florian Probst added a comment -

        I have the same issue when creating a new web module. Adding "jst.jsf" in version 1.2 automatically adds "jst.web" in version 2.4 what is not supported by Eclipse. When i include "jst.web" in correct version 2.5 it looks like:

        <configuration>
        <additionalProjectFacets>
        <jst.jsf>1.2</jst.jsf>
        <jst.web>2.5</jst.web>
        </additionalProjectFacets>
        <wtpversion>2.0</wtpversion>
        </configuration>

        The result is a duplicated entry of "jst.web" in both versions 2.4 AND 2.5. It works for me, deleting the 2.4 entry out of the file.
        Affects current version 2.7.

        Show
        Florian Probst added a comment - I have the same issue when creating a new web module. Adding "jst.jsf" in version 1.2 automatically adds "jst.web" in version 2.4 what is not supported by Eclipse. When i include "jst.web" in correct version 2.5 it looks like: <configuration> <additionalProjectFacets> <jst.jsf>1.2</jst.jsf> <jst.web>2.5</jst.web> </additionalProjectFacets> <wtpversion>2.0</wtpversion> </configuration> The result is a duplicated entry of "jst.web" in both versions 2.4 AND 2.5. It works for me, deleting the 2.4 entry out of the file. Affects current version 2.7.
        Hide
        Daniel Rohe added a comment -

        This is a patch to this bug which checks whether the additional facets overwrite any of the hard-coded installed facets. Also the patch contains a test case which should show the replacement.

        Show
        Daniel Rohe added a comment - This is a patch to this bug which checks whether the additional facets overwrite any of the hard-coded installed facets. Also the patch contains a test case which should show the replacement.
        Hide
        Daniel Rohe added a comment -

        The cause of this bug is the creation of the facet file for WTP 1.5 and above. This file contains entries for fixed facets, the server runtime and installed facets of a project. The fixed facets depend on the project type and can easily be added during the creation. For the installed facets the handling currently uses the dependencies and looks for the servlet-api to determine the version of the jst.web facet. So one solution is to add the dependency javax.servlet:servlet-api:2.x to the pom and it works or e.g. use the patch and override the installed facets using the additional facets configuration element.

        There is still a bug when working with RAD because the extended and coexistence facets are only added to ear-projects but also need to be added to war-projects and the handling of the server runtime is somewhat buggy.

        Show
        Daniel Rohe added a comment - The cause of this bug is the creation of the facet file for WTP 1.5 and above. This file contains entries for fixed facets, the server runtime and installed facets of a project. The fixed facets depend on the project type and can easily be added during the creation. For the installed facets the handling currently uses the dependencies and looks for the servlet-api to determine the version of the jst.web facet. So one solution is to add the dependency javax.servlet:servlet-api:2.x to the pom and it works or e.g. use the patch and override the installed facets using the additional facets configuration element. There is still a bug when working with RAD because the extended and coexistence facets are only added to ear-projects but also need to be added to war-projects and the handling of the server runtime is somewhat buggy.
        Hide
        The Alchemist added a comment -

        Can anyone post a status update on this? I can try to fix it if it's not been done yet.

        Show
        The Alchemist added a comment - Can anyone post a status update on this? I can try to fix it if it's not been done yet.
        Hide
        Diego Gomes added a comment -

        KP, this bug still hasn't been fixed and meanwhile I'm usign a workaround

                <dependency>
                    <groupId> javax.servlet</groupId>
                    <artifactId>servlet-api</artifactId>
                    <version>2.5</version>
                    <scope>provided</scope>
                </dependency>
        

        so it doesn't buggy my applications;

        Show
        Diego Gomes added a comment - KP, this bug still hasn't been fixed and meanwhile I'm usign a workaround <dependency> <groupId> javax.servlet</groupId> <artifactId>servlet-api</artifactId> <version>2.5</version> <scope>provided</scope> </dependency> so it doesn't buggy my applications;
        Hide
        The Alchemist added a comment -

        @Diego: Can you attach an example POM and the created Eclipse files? This would help us out.

        Show
        The Alchemist added a comment - @Diego: Can you attach an example POM and the created Eclipse files? This would help us out.
        Hide
        Diego Gomes added a comment -

        Two attachments:

        • sample-error.zip: contains the files generated by eclipse:eclipse and the pom for error sample
        • sample-noerror.zip: contains the files generated by eclipse:eclipse and the pom for the workaround version
        Show
        Diego Gomes added a comment - Two attachments: sample-error.zip: contains the files generated by eclipse:eclipse and the pom for error sample sample-noerror.zip: contains the files generated by eclipse:eclipse and the pom for the workaround version
        Hide
        Nicolas Ternisien added a comment -

        Bug reproduced here.

        Show
        Nicolas Ternisien added a comment - Bug reproduced here.
        Hide
        Barrie Treloar added a comment -

        removed fixed version as no one has taken ownership to look into it.

        Show
        Barrie Treloar added a comment - removed fixed version as no one has taken ownership to look into it.
        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.
        Hide
        Diego Gomes added a comment -

        @Michael Osipov I'm not the owner of the issue, but the bug still reproducible with the sample errors I`ve included here in 25/Aug/10

        Show
        Diego Gomes added a comment - @Michael Osipov I'm not the owner of the issue, but the bug still reproducible with the sample errors I`ve included here in 25/Aug/10
        Hide
        Michael Osipov added a comment -

        Diego, accepted!

        Show
        Michael Osipov added a comment - Diego, accepted!
        Hide
        Robert Scholte added a comment -

        The Apache Maven team has decided to retire the maven-eclipse-plugin, so this issue won't be fixed.

        Show
        Robert Scholte added a comment - The Apache Maven team has decided to retire the maven-eclipse-plugin, so this issue won't be fixed.

          People

          • Assignee:
            Robert Scholte
            Reporter:
            Chris Graham
          • Votes:
            4 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development