zDev - M2E - OSS
  1. zDev - M2E - OSS
  2. MNGECLIPSE-1530

Eclipse Maven project doesn't have a Java Nature after Importing

    Details

    • Type: User Story User Story
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:
      eclipse galileo classic with wtp
    • Global Rank:
      1149

      Description

      hi, the issue is that if I import a maven project it hasn't proper "Java project nature" as it has if a create a new one. The project icon is missing the J letter and java file icons are different than in proper java project. Therefore the editor doesn't offer the usual features like javadoc hovering, or javadoc can't be generated because there are no proper "Java" files . If I create a new maven project, everything is OK. I have WTP installed. I spent 3 hours by playing with it, please help.

        Issue Links

          Activity

          Joseph Vychtrle created issue -
          Hide
          Joseph Vychtrle added a comment - - edited

          I'm including nature of the projects from .project file

          <projectDescription>
          <name>sis2-2.5.2</name>
          <comment></comment>
          <projects>
          </projects>
          <buildSpec>
          <buildCommand>
          <name>org.eclipse.wst.common.project.facet.core.builder</name>
          <arguments>
          </arguments>
          </buildCommand>
          <buildCommand>
          <name>org.eclipse.jdt.core.javabuilder</name>
          <arguments>
          </arguments>
          </buildCommand>
          <buildCommand>
          <name>org.springframework.ide.eclipse.core.springbuilder</name>
          <arguments>
          </arguments>
          </buildCommand>
          <buildCommand>
          <name>org.maven.ide.eclipse.maven2Builder</name>
          <arguments>
          </arguments>
          </buildCommand>
          </buildSpec>
          <natures>
          <nature>org.springframework.ide.eclipse.core.springnature</nature>
          <nature>org.eclipse.jdt.core.javanature</nature>
          <nature>org.maven.ide.eclipse.maven2Nature</nature>
          <nature>org.eclipse.wst.common.project.facet.core.nature</nature>
          </natures>
          </projectDescription>

          and it is the same even with

          <natures>
          <nature>org.eclipse.jdt.core.javanature</nature>
          <nature>org.maven.ide.eclipse.maven2Nature</nature>
          </natures>

          What is then the proper combination of natures in Galileo ? Only combination which works for me, is <nature>org.eclipse.jdt.core.javanature</nature> only... or if I set it in pom.xml as

          <additionalProjectnatures>
          <projectnature>org.eclipse.jdt.core.javanature</projectnature>
          </additionalProjectnatures>

          Show
          Joseph Vychtrle added a comment - - edited I'm including nature of the projects from .project file <projectDescription> <name>sis2-2.5.2</name> <comment></comment> <projects> </projects> <buildSpec> <buildCommand> <name>org.eclipse.wst.common.project.facet.core.builder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.eclipse.jdt.core.javabuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.springframework.ide.eclipse.core.springbuilder</name> <arguments> </arguments> </buildCommand> <buildCommand> <name>org.maven.ide.eclipse.maven2Builder</name> <arguments> </arguments> </buildCommand> </buildSpec> <natures> <nature>org.springframework.ide.eclipse.core.springnature</nature> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.maven.ide.eclipse.maven2Nature</nature> <nature>org.eclipse.wst.common.project.facet.core.nature</nature> </natures> </projectDescription> and it is the same even with <natures> <nature>org.eclipse.jdt.core.javanature</nature> <nature>org.maven.ide.eclipse.maven2Nature</nature> </natures> What is then the proper combination of natures in Galileo ? Only combination which works for me, is <nature>org.eclipse.jdt.core.javanature</nature> only... or if I set it in pom.xml as <additionalProjectnatures> <projectnature>org.eclipse.jdt.core.javanature</projectnature> </additionalProjectnatures>
          Joseph Vychtrle made changes -
          Field Original Value New Value
          Comment [ and it is the same even with ]
          Joseph Vychtrle made changes -
          Comment [ btw, when trying to install " Maven Integration for WTP (Optional) 0.9.9.200907071528 " from software updater, I'm getting this error

          !ENTRY org.eclipse.equinox.p2.engine 4 4 2009-07-28 15:33:20.367
          !MESSAGE An error occurred while collecting items to be installed
          !SUBENTRY 1 org.eclipse.equinox.p2.engine 4 0 2009-07-28 15:33:20.367
          !MESSAGE session context was:(profile=SDKProfile, phase=org.eclipse.equinox.internal.provisional.p2.engine.phases.Collect, operand=, action=).
          !SUBENTRY 1 org.eclipse.equinox.p2.artifact.repository 4 0 2009-07-28 15:33:20.367
          !MESSAGE No repository found containing: osgi.bundle,org.maven.ide.eclipse.wtp,0.9.9.200907071527
          !SUBENTRY 1 org.eclipse.equinox.p2.artifact.repository 4 0 2009-07-28 15:33:20.367
          !MESSAGE No repository found containing: org.eclipse.update.feature,org.maven.ide.eclipse.wtp.feature,0.9.9.200907071528 ]
          Hide
          Igor Fedorenko added a comment -

          It is very hard to suggest anything without being able to reproduce the problem locally. Can you please provide complete standalone sample project and explain expected behaviour?

          Show
          Igor Fedorenko added a comment - It is very hard to suggest anything without being able to reproduce the problem locally. Can you please provide complete standalone sample project and explain expected behaviour?
          Hide
          Joseph Vychtrle added a comment -

          It's simple, I'm talking about sample archetype project created outside of eclipse. It gets only maven "project nature" in the eclipses .project file. If I then import it to eclipse, it is not suported as java natured project would be. If I create it as a new project in eclipse, it gets the java nature.
          So I have to set the pom :

          <additionalProjectnatures>
          <projectnature>org.eclipse.jdt.core.javanature</projectnature>
          </additionalProjectnatures>

          and run eclipse:eclipse goal

          And then inport it to eclipse, right? Then it has both natures. I don't know if it is apropriet and default in eclipse. So I guess that I have to modify pom.xml and run eclipse:eclipse after I import the project or check it out from CVS/SVN.

          So my question is, wouldn't it be great if it was done automatically as a part of m2eclipse plugin ? Because the project is useless without the java nature. It is logical, that if I get these two natures after creating a new project that I should get them after I import or checkout some other project. It would be great if there was some question during importing the project whether to add java nature if the project doesn't have any.

          Show
          Joseph Vychtrle added a comment - It's simple, I'm talking about sample archetype project created outside of eclipse. It gets only maven "project nature" in the eclipses .project file. If I then import it to eclipse, it is not suported as java natured project would be. If I create it as a new project in eclipse, it gets the java nature. So I have to set the pom : <additionalProjectnatures> <projectnature>org.eclipse.jdt.core.javanature</projectnature> </additionalProjectnatures> and run eclipse:eclipse goal And then inport it to eclipse, right? Then it has both natures. I don't know if it is apropriet and default in eclipse. So I guess that I have to modify pom.xml and run eclipse:eclipse after I import the project or check it out from CVS/SVN. So my question is, wouldn't it be great if it was done automatically as a part of m2eclipse plugin ? Because the project is useless without the java nature. It is logical, that if I get these two natures after creating a new project that I should get them after I import or checkout some other project. It would be great if there was some question during importing the project whether to add java nature if the project doesn't have any.
          Hide
          Igor Fedorenko added a comment -

          Are you using "Existing Maven Projects" import wizard? This wizard is expected to enable java nature for relevant projects. Please provide exact steps to reproduce the problem if this is not the case for you. You can also use "Check out as Maven Project" wizard available from both CVS and SVN repositories view.

          Also note that maven-eclipse-plugin and m2e are two separate and independent projects. Generally, you should not use maven-eclipse-plugin (i.e. eclipse:eclipse goal) if you plan to use m2e with your projects.

          Show
          Igor Fedorenko added a comment - Are you using "Existing Maven Projects" import wizard? This wizard is expected to enable java nature for relevant projects. Please provide exact steps to reproduce the problem if this is not the case for you. You can also use "Check out as Maven Project" wizard available from both CVS and SVN repositories view. Also note that maven-eclipse-plugin and m2e are two separate and independent projects. Generally, you should not use maven-eclipse-plugin (i.e. eclipse:eclipse goal) if you plan to use m2e with your projects.
          Hide
          Joseph Vychtrle added a comment -

          yes, import wizard and existing maven project. But it gives me only maven nature, not java nature together with maven nature. And if I check out as maven project from CVS view, I'm getting only maven nature, not java.

          So the only way how I get the java nature is to use maven-eclipse-plugin.

          Show
          Joseph Vychtrle added a comment - yes, import wizard and existing maven project. But it gives me only maven nature, not java nature together with maven nature. And if I check out as maven project from CVS view, I'm getting only maven nature, not java. So the only way how I get the java nature is to use maven-eclipse-plugin.
          Hide
          Igor Fedorenko added a comment -

          Please provide sample project and/or steps to reproduce the problem.

          Show
          Igor Fedorenko added a comment - Please provide sample project and/or steps to reproduce the problem.
          Hide
          Joseph Vychtrle added a comment -

          For instance try to import echo / airport sample application from spring-ws 1.5.7 download: http://static.springsource.org/spring-ws/sites/1.5/downloads/releases.html. There is only maven nature set in its .project file and the imported project will be without java nature and I will have to use maven-eclipse-plugin.

          Show
          Joseph Vychtrle added a comment - For instance try to import echo / airport sample application from spring-ws 1.5.7 download: http://static.springsource.org/spring-ws/sites/1.5/downloads/releases.html . There is only maven nature set in its .project file and the imported project will be without java nature and I will have to use maven-eclipse-plugin.
          Hide
          Igor Fedorenko added a comment -

          Looks like m2e can't determine java version... and this is a tricky problem to solve. Unlike maven cli, m2e has to deal with two JREs, one that runs m2e itself and the other is project target JRE. If the two do not match, we have into inconsistent state, when wrong JRE version is used when working with the project inside m2e JVM and when launching the project in external JVM. I'll have to think about proper way to address this problem.

          2 problems were encountered during construction of the effective model:
          o Invalid activation condition for project profile jdk14-jdk15 in POM org.springframework.ws:echo:1.5.7 (/tmp/spring-ws-1.5.7/samples/echo/pom.xml): Failed to determine Java version for profile jdk14-jdk15
          o Invalid activation condition for project profile jdk14-jdk15 in POM org.springframework.ws:spring-ws-samples:1.5.7 (/tmp/spring-ws-1.5.7/samples/pom.xml): Failed to determine Java version for profile jdk14-jdk15
          
          Show
          Igor Fedorenko added a comment - Looks like m2e can't determine java version... and this is a tricky problem to solve. Unlike maven cli, m2e has to deal with two JREs, one that runs m2e itself and the other is project target JRE. If the two do not match, we have into inconsistent state, when wrong JRE version is used when working with the project inside m2e JVM and when launching the project in external JVM. I'll have to think about proper way to address this problem. 2 problems were encountered during construction of the effective model: o Invalid activation condition for project profile jdk14-jdk15 in POM org.springframework.ws:echo:1.5.7 (/tmp/spring-ws-1.5.7/samples/echo/pom.xml): Failed to determine Java version for profile jdk14-jdk15 o Invalid activation condition for project profile jdk14-jdk15 in POM org.springframework.ws:spring-ws-samples:1.5.7 (/tmp/spring-ws-1.5.7/samples/pom.xml): Failed to determine Java version for profile jdk14-jdk15
          Hide
          Joseph Vychtrle added a comment -

          Thank you Igor, sorry for my confusion. I'm still just learning. If you figure out the JRE inconsistency, please let people know in this thread. Joseph

          Show
          Joseph Vychtrle added a comment - Thank you Igor, sorry for my confusion. I'm still just learning. If you figure out the JRE inconsistency, please let people know in this thread. Joseph
          Hide
          Joseph Vychtrle added a comment -

          If you knew the way to run there spring-ws examples please tell me. Problem is that the eclipse general setting of JDK to use is irrelevant. Maybe the project JDK setting would help, but if I import the project, it doesn't have java nature therefore I can't set it up in the project settings. The activation is !1.6, but no matter if I give it JDK 6 or 5 in eclipse Runtime settings it behaves the same. Don't know how to feed it with chosen JRE...

          Show
          Joseph Vychtrle added a comment - If you knew the way to run there spring-ws examples please tell me. Problem is that the eclipse general setting of JDK to use is irrelevant. Maybe the project JDK setting would help, but if I import the project, it doesn't have java nature therefore I can't set it up in the project settings. The activation is !1.6, but no matter if I give it JDK 6 or 5 in eclipse Runtime settings it behaves the same. Don't know how to feed it with chosen JRE...
          Igor Fedorenko made changes -
          Link This issue is caused by MNGECLIPSE-1607 [ MNGECLIPSE-1607 ]

            People

            • Assignee:
              Unassigned
              Reporter:
              Joseph Vychtrle
              Last Updated By:
              Igor Fedorenko
            • Votes:
              1 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Date of First Response: