Uploaded image for project: 'Spring Tool Suite'
  1. Spring Tool Suite
  2. STS-2539

Roo: src/main/java not configured as source folder when created

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.9.0.RELEASE, 3.0.0.RELEASE
    • Fix Version/s: 3.2.0.M2
    • Component/s: ROO
    • Labels:
      None

      Description

      The current Roo release does not create the Java source folders by default at project creation anymore. That has an inconvenient effect in Eclipse/STS, the user has to manually update the Maven project configuration after the first Java code was generated from the Roo shell.

      Example:

      • Create new Roo project > src/main/resources is the only configured source folder, src/main/java and test folders are not created yet
      • "jpa setup" in the Roo shell, then "entity jpa --class MyEntity"
        >> This creates the src/main/java folder and generates java and aj files into it.

      Expected:
      The project configuration reflects the new code, src/main/java is a source folder.

      Actual:
      src/main/java is not yet a source folder, Right Click > Maven > Update Project Configuration has to be done manually, or manual build path configuration for the new source folder; same probably true for test resources created with integration test commands, etc.

        Activity

        Hide
        ldossantos Leo Dos Santos (c) [X] added a comment -

        Yes, I see what's happening. STS does create the project with /src/main/java configured in .classpath but I think the first compilation 'optimizes away' the path entries for the non-existent folders. So unfortunately pre-populating the .classpath with src/main/java isn't a viable solution. We'll have to find a way to listen for source folder creation and trigger a project configuration update.

        Show
        ldossantos Leo Dos Santos (c) [X] added a comment - Yes, I see what's happening. STS does create the project with /src/main/java configured in .classpath but I think the first compilation 'optimizes away' the path entries for the non-existent folders. So unfortunately pre-populating the .classpath with src/main/java isn't a viable solution. We'll have to find a way to listen for source folder creation and trigger a project configuration update.
        Hide
        jrlacy Rick Lacy added a comment -

        I'm just starting with STS and roo and ran into this with 3.1.0. No src/main/java and no src/test/resources when project created. Voting for it - it would be nice to fix this - very confusing for a newbie.

        Show
        jrlacy Rick Lacy added a comment - I'm just starting with STS and roo and ran into this with 3.1.0. No src/main/java and no src/test/resources when project created. Voting for it - it would be nice to fix this - very confusing for a newbie.
        Hide
        ldossantos Leo Dos Santos (c) [X] added a comment -

        I've fixed the src/test/resources error with STS-3090

        I'm also observing that the entry for src/main/java is preserved in the .classpath file with m2e 1.2.0 installed. Consequently the "entity jpa --class MyEntity" command is generating src/main/java and it shows up as source directory in the Package & Project Explorer views automatically.

        Show
        ldossantos Leo Dos Santos (c) [X] added a comment - I've fixed the src/test/resources error with STS-3090 I'm also observing that the entry for src/main/java is preserved in the .classpath file with m2e 1.2.0 installed. Consequently the "entity jpa --class MyEntity" command is generating src/main/java and it shows up as source directory in the Package & Project Explorer views automatically.
        Hide
        zdharmawan Zulfikar Dharmawan added a comment -

        I am using STS 3.3.0 with Eclipse 4.3.0, it seems that this still not resolved, CMIIW?

        Show
        zdharmawan Zulfikar Dharmawan added a comment - I am using STS 3.3.0 with Eclipse 4.3.0, it seems that this still not resolved, CMIIW?
        Hide
        mlippert Martin Lippert added a comment -

        We moved issue tracking for this project to https://github.com/spring-projects/spring-ide.
        If you would like to comment on or re-open this issue, please file a new issue at GitHub and refer to this one.

        Show
        mlippert Martin Lippert added a comment - We moved issue tracking for this project to https://github.com/spring-projects/spring-ide . If you would like to comment on or re-open this issue, please file a new issue at GitHub and refer to this one.

          People

          • Assignee:
            ldossantos Leo Dos Santos (c) [X]
            Reporter:
            birgitta.boeckeler Birgitta Boeckeler
          • Votes:
            2 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: