groovy
  1. groovy
  2. GROOVY-1430

Invalid Package declaration: abc.groovy is not in a source folder matching the package declaration

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0
    • Component/s: None
    • Labels:
      None
    • Environment:
      GroovyPlugin 1.0.0.20060711
    • Number of attachments :
      1

      Description

      Copied from: http://www.nabble.com/Eclipse-and-%27Invalid-Package-Declaration%27-error.-tf1897916.html#a5449140

      I created a app with grails0.2, imported it into eclipse3.2, have all subfolders marked as src-folders (default), but still get errors like this in eclipse:

      "Invalid Package declaration in script: C:\dev\grails\inventory\grails-app\conf\ApplicationBootStrap.groovy is not in a source folder matching the package declaration: "

      (Of course) my ApplicationBootStrap.groovy doesn't have a package declaration, like all other generated groovy-files it is starting with "class xyz" instantly.

      My .classpath file:
      <classpathentry kind="src" path="grails-app/conf"/>

      Is this a bug of the groovy plugin?

        Activity

        Hide
        James E. Ervin added a comment -

        Zoinks!! Scott unless you have a solution on hand I will investigate fixing this.

        Show
        James E. Ervin added a comment - Zoinks!! Scott unless you have a solution on hand I will investigate fixing this.
        Hide
        Scott Hickey added a comment -

        I don't have a quick solution at hand - thanks.

        Show
        Scott Hickey added a comment - I don't have a quick solution at hand - thanks.
        Hide
        James E. Ervin added a comment -

        Try out this patch. I changed the code that acquires the source directories from the classpath to goto the project, get the IResource object that corresponds, check that that IResource object exists, and then query it for its raw location.

        I was able to reproduce the problem and this seems to have made it go away.

        Show
        James E. Ervin added a comment - Try out this patch. I changed the code that acquires the source directories from the classpath to goto the project, get the IResource object that corresponds, check that that IResource object exists, and then query it for its raw location. I was able to reproduce the problem and this seems to have made it go away.
        Hide
        Scott Hickey added a comment -

        James - thanks for the quick turn around. I also was able to duplicate the error and watch it go away.
        Thomas - I committed the patch to CVS. You pull down the latest plugin from CVS and try it out, thanks.

        Show
        Scott Hickey added a comment - James - thanks for the quick turn around. I also was able to duplicate the error and watch it go away. Thomas - I committed the patch to CVS. You pull down the latest plugin from CVS and try it out, thanks.
        Hide
        Scott Hickey added a comment -

        appears to be fixed with no further comment

        Show
        Scott Hickey added a comment - appears to be fixed with no further comment

          People

          • Assignee:
            Scott Hickey
            Reporter:
            Thomas Latka
          • Votes:
            3 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: