Spring Tool Suite
  1. Spring Tool Suite
  2. STS-2539

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

    Details

    • Type: Improvement Improvement
    • Status: Resolved Resolved
    • Priority: Minor 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
        Leo Dos Santos (c) 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
        Leo Dos Santos (c) 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
        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
        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
        Leo Dos Santos (c) 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
        Leo Dos Santos (c) 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
        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
        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?

          People

          • Assignee:
            Leo Dos Santos (c)
            Reporter:
            Birgitta Boeckeler
          • Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:
              First Response Date: