jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Eclipse Plugin
  • MECLIPSE-449

Facet Generation generates duplicate entries - breaks RAD/RSA support

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • 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>

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    MECLIPSE-449.patch
    29/Oct/09 4:35 PM
    22 kB
    Daniel Rohe
  2. Hide
    Zip Archive
    sample-error.zip
    25/Aug/10 9:14 AM
    3 kB
    Diego Gomes
    1. File
      .classpath 0.6 kB
    2. File
      .project 0.8 kB
    3. File
      .settings/org.eclipse.jdt.core.prefs 0.3 kB
    4. File
      .settings/org.eclipse.wst.common.component 0.6 kB
    5. XML File
      .settings/org.eclipse.wst.common.project.facet.core.xml 0.2 kB
    6. XML File
      pom.xml 4 kB
    Download Zip
    Show
    Zip Archive
    sample-error.zip
    25/Aug/10 9:14 AM
    3 kB
    Diego Gomes
  3. Hide
    Zip Archive
    sample-noerror.zip
    25/Aug/10 9:14 AM
    3 kB
    Diego Gomes
    1. File
      .classpath 0.8 kB
    2. File
      .project 0.8 kB
    3. File
      .settings/org.eclipse.jdt.core.prefs 0.3 kB
    4. File
      .settings/org.eclipse.wst.common.component 0.6 kB
    5. XML File
      .settings/org.eclipse.wst.common.project.facet.core.xml 0.2 kB
    6. XML File
      pom.xml 4 kB
    Download Zip
    Show
    Zip Archive
    sample-noerror.zip
    25/Aug/10 9:14 AM
    3 kB
    Diego Gomes

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Chris Graham added a comment - 14/May/08 7:30 PM

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 - 14/May/08 7:30 PM 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
Permalink
Chris Graham added a comment - 18/May/08 8:41 PM

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 - 18/May/08 8:41 PM 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
Permalink
Alessandro Zucchi added a comment - 01/Oct/08 9:24 AM

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 - 01/Oct/08 9:24 AM 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
Permalink
Florian Probst added a comment - 04/Aug/09 3:25 AM

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 - 04/Aug/09 3:25 AM 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
Permalink
Daniel Rohe added a comment - 29/Oct/09 4:35 PM

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 - 29/Oct/09 4:35 PM 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
Permalink
Daniel Rohe added a comment - 03/Nov/09 1:35 AM

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 - 03/Nov/09 1:35 AM 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
Permalink
Karl Pietrzak added a comment - 25/Aug/10 8:29 AM

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

Show
Karl Pietrzak added a comment - 25/Aug/10 8:29 AM Can anyone post a status update on this? I can try to fix it if it's not been done yet.
Hide
Permalink
Diego Gomes added a comment - 25/Aug/10 8:35 AM

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 - 25/Aug/10 8:35 AM 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
Permalink
Karl Pietrzak added a comment - 25/Aug/10 8:39 AM

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

Show
Karl Pietrzak added a comment - 25/Aug/10 8:39 AM @Diego: Can you attach an example POM and the created Eclipse files? This would help us out.
Hide
Permalink
Diego Gomes added a comment - 25/Aug/10 9:14 AM

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 - 25/Aug/10 9:14 AM 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
Permalink
Nicolas Ternisien added a comment - 28/Oct/10 3:53 AM

Bug reproduced here.

Show
Nicolas Ternisien added a comment - 28/Oct/10 3:53 AM Bug reproduced here.
Hide
Permalink
Barrie Treloar added a comment - 17/Nov/11 8:25 PM

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

Show
Barrie Treloar added a comment - 17/Nov/11 8:25 PM removed fixed version as no one has taken ownership to look into it.

People

  • Assignee:
    Unassigned
    Reporter:
    Chris Graham
Vote (5)
Watch (5)

Dates

  • Created:
    14/May/08 6:24 PM
    Updated:
    17/Nov/11 8:25 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.