Git Product home page Git Product logo

Comments (9)

branflake2267 avatar branflake2267 commented on May 30, 2024

Gotcha, I've had this issue. Thanks for reporting. When the physical source path doesn't exist for test it causes an issue because m2e sets it up anyway. This feels like a m2e issue, although I'll have to investigate further.

from gwt-eclipse-plugin.

foal avatar foal commented on May 30, 2024

Ok, inasmuch as it is so annoying to cleanup ~30 projects from generated staff after each project update I spent few hours and find the the reason (workaround).

The problem is in the launch generator. The default launch configuration SHOULD NOT include the test sources. It does not resolve the "optional" issue, but it resolve MY issue (all my wrong classpath entries are from tests).

Nonetheless the launch configuration INCLUDE all the sources from the projects. The reason is in wrong test Source Folder detection.

gwt-eclipse-plugin\plugins\com.google.gwt.eclipse.core\src\com\google\gwt\eclipse\core\GWTProjectUtilities.java

  public static boolean isTestPath(IPath path) {
    return "test".equals(path.lastSegment())
        || "javatests".equals(path.lastSegment());
  }

It tests the last segment, but the standard maven project has "src/test/java".

So if you will fix the test Source Folder detection it will eliminate the issue with m2e which generate non existing classpath entries.

from gwt-eclipse-plugin.

foal avatar foal commented on May 30, 2024

Ok. It is not a real solution, because it fix include/exclude tests from launch configuration. To fix he original issue you should change fillGWTSourceFolderPathsFromProject from the same class (GWTProjectUtilities) to check IClasspathEntry is optional (like bellow)

public boolean isOptional() {
        for (int i = 0, length = this.extraAttributes.length; i < length; i++) {
            IClasspathAttribute attribute = this.extraAttributes[i];
            if (IClasspathAttribute.OPTIONAL.equals(attribute.getName()) && "true".equals(attribute.getValue())) //$NON-NLS-1$
                return true;
        }
        return false;
    }

and check if curClasspathEntry.getPath() exists on the file system.

from gwt-eclipse-plugin.

foal avatar foal commented on May 30, 2024

Do I have to create a separate issue for incorrect including test sources to run-time classpath?

from gwt-eclipse-plugin.

branflake2267 avatar branflake2267 commented on May 30, 2024

Looks fine. I guess you don't have to create an issue for that.

from gwt-eclipse-plugin.

branflake2267 avatar branflake2267 commented on May 30, 2024

I'm out of country at the moment and tired, so I'll wait till I get back to merge it. Thats the 15th and a couple days to recover. Then I can merge and build the snapshot.

from gwt-eclipse-plugin.

foal avatar foal commented on May 30, 2024

Greate 👍

from gwt-eclipse-plugin.

branflake2267 avatar branflake2267 commented on May 30, 2024

Merged and updated repo. I've marked this fixed and if you can verify that would be great.

from gwt-eclipse-plugin.

foal avatar foal commented on May 30, 2024

I update the workspace with new version, it continue works. I am going to create new workspace from scratch in few days. will let you know if it will works correctly.

from gwt-eclipse-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.