Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-330

broken classpath in builder while using jars from workspace

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Minor
    • Resolution: Fixed
    • 1.0-beta-5
    • 1.0-beta-5
    • None
    • None
    • eclipse 3.0 M7

    Description

      It seems that groovy builder uses wrong classpath since it cant' find any jars that are in the workspace.
      It works fine if you use envirovment variables instead.

      I checked the code and here is the place in GroovyProject.java that I think needs fix...

      private void setClassPath(IJavaProject javaProject) throws JavaModelException, Exception {
      IWorkspaceRoot root = javaProject.getProject().getWorkspace().getRoot();
      IClasspathEntry[] cpEntries = javaProject.getResolvedClasspath(false);
      StringBuffer classPath = new StringBuffer();
      for (int i = 0; i < cpEntries.length; i++) {
      IClasspathEntry entry = cpEntries[i];
      if (entry.getEntryKind() == IClasspathEntry.CPE_LIBRARY) {
      if(entry.getPath().getDevice()==null)

      { IResource resource = root.findMember(entry.getPath()); if(resource != null) classPath.append(resource.getLocation().toString() + ";"); }

      else

      { classPath.append(entry.getPath().toString() + ";"); }

      }
      }

      classPath.append(getOutputPath(javaProject) + ";");
      GroovyPlugin.trace("groovy cp = " + classPath.toString());
      compiler.setClasspath(classPath.toString());
      }

      what do you think?

      Attachments

        Activity

          People

            zohar Zohar Melamed
            blib Boris Bliznioukov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 20m
                20m
                Remaining:
                Remaining Estimate - 20m
                20m
                Logged:
                Time Spent - Not Specified
                Not Specified