Announcement Announcement Module
Collapse
No announcement yet.
Importing an existing maven project - not a java project Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Importing an existing maven project - not a java project

    Hello,

    I'm using STS Version: 3.1.0.RELEASE and imported an existing Java Maven project.

    But the project is not seen as a Java project.

    The contextual menu Build Path is empty.

    My project has a pom.xml file and a child module with its own pom.xml file.

    It used to be fine on a previous install of Eclipse.

    Before doing the project import, I removed the project files:

    rm -fr .project .settings/

    I don't think I should need to run the command:

    mvn eclipse:eclipse -DdownloadSources,downloadJavadocs

    before doing the project import.

    I wonder what is missing...

    Could it be because I don't have a file called .m2/settings.xml

    Kind Regards,
    Last edited by stephaneeybert; Nov 10th, 2012, 09:28 AM.

  • #2
    Hey Stephane,

    you should be able to import the project using the "Import Existing Maven Project" wizard without running eclipse:eclipse first. The Maven Integration for Eclipse should take care of all that when you use that import wizard. The missing settings.xml should also not be a problem as long as you are not behind a proxy. Otherwise you would need the settings.xml file to configure the proxy settings for Maven.

    When you do the import via the "Import Existing Maven Project...", how does the project look like?

    HTH,
    Martin

    Comment


    • #3
      Hi Martin,

      Thanks for the comment. Indeed, that was my understanding too, not needing to run the eclipse:eclipse Maven command.

      I had created the project as you suggest but it still is not a Java project.

      How does it look like ? Well, it's a typical Spring Hibernate DAO layer.

      I took a screenshort too Attachment
      Attached Files

      Comment


      • #4
        Hey Stephane!

        Would it be possible to attach the project here to have us take a look? Or are there any steps for me to reproduce this from scratch using a fresh STS 3.1.0 installation?

        -Martin

        Comment


        • #5
          Hey Martin,

          It did not happen on the previous versions of Eclipse and STS I used some 6 months ago.

          In fact the same issue happens with all the projects I have. You can try with a simple project of yours and see if you also have the issue.

          Otherwise I'll send you one of my projects.

          Kind Regards,

          Comment


          • #6
            Hey Stepane!

            I did this multiple times in the past (also with the latest STS 3.1.0 version), usually without problems. Therefore I guess we would need to take a look at your specific project... Would that be possible?

            Cheers,
            -Martin

            Comment


            • #7
              Hey Martin,

              I solved my issue. I'm sorry to have disturbed a Spring team member on a Sunday afternoon for such a trifle one like this. Indeed, the reason I could not see any Java nature in the contextual menu item Build Path is that I had selected a working set that showed only the parent project of my Maven multiple modules project. I would right click on the parent project name in the explorer pane and the contextual menu item Build Path would be empty. I would do the same in its child core project and the contextual menu item Build Path would be also empty.

              But then if I deactivated the working set and was able to see the child project, as a project (left most aligned as its parent) and not as a child item in the parent project. And a right click on the child project name does display the Java alternatives in the contextual menu item Build Path.

              My mistake was not noticing that a child project, when seen under its parent, is not considered a project by STS.

              Sorry again for the disturbance.

              Kind Regards,

              Comment


              • #8
                Hey Stephane,

                no problem, glad to hear you solved your issue... :-)

                Cheers,
                -Martin

                Comment

                Working...
                X