Labs
  1. Labs
  2. LABS-411

[eclipse] target/classes used by some Eclipse components instead of real output folder

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: Current
    • Fix Version/s: Current
    • Component/s: Magma
    • Labels:
      None

      Description

      When working with Maven and Eclipse, the target/classes folder can cause some problems, cause having both Eclipse and Maven using it inconsistencies can happen.

      This is expecially true for Magma, cause some .class files generated by the Magma mojo are not ready to run, but must be fed to the AspectJ LTW system or to magma:war for complete weaving (this is due to -XterminateAfterCompile).

      So, the Eclipse Magma plugin uses target-eclipse instead of target inside Eclipse, so that the two builders does not interfere, and Eclipse creates complete classes instead of partial ones to use for it's internal tools (like running junits inside eclipse).

      Unfortunately however, Eclipse keeps on using target/classes to run junit tests, even if that string does not appear inside .project nor anywhere else in the project or workspace, so I don't know exactly where it is getting that path. Since it is not a standard path, I think M2E has something to do with it, probably it modifies the Eclipse project to return that folder in a way that it's not possible to modify it further.

        Activity

        Hide
        Simone Gianni added a comment -

        Now it's possible to run tests (and applications, eventually) directly from inside Eclipse, using weaved folders produced by AJDT.

        Show
        Simone Gianni added a comment - Now it's possible to run tests (and applications, eventually) directly from inside Eclipse, using weaved folders produced by AJDT.
        Hide
        Simone Gianni added a comment -

        Method addProjectEntries desumes the target/classes and target/test-classes from maven metadata, ignoring eclipse settings completely, which is wrong cause does not permit to have a differentiated Eclipse/Maven target directory, or at least lets Eclipse use target/classes whenever it needs to run something.

        M2E installs its own MavenRuntimeClasspathProvider when a new configuration is created, Magma should obviate this M2E behaviour extending the Maven classpath provider so that the target-eclipse folder is used for Magma projects.

        Show
        Simone Gianni added a comment - Method addProjectEntries desumes the target/classes and target/test-classes from maven metadata, ignoring eclipse settings completely, which is wrong cause does not permit to have a differentiated Eclipse/Maven target directory, or at least lets Eclipse use target/classes whenever it needs to run something. M2E installs its own MavenRuntimeClasspathProvider when a new configuration is created, Magma should obviate this M2E behaviour extending the Maven classpath provider so that the target-eclipse folder is used for Magma projects.
        Hide
        Simone Gianni added a comment -

        In fact, it ends up to org.maven.ide.eclipse.jdt.internal.launch.MavenRuntimeClasspathProvider that is ignoring project output settings. Searching to understand what the problem is.

        Show
        Simone Gianni added a comment - In fact, it ends up to org.maven.ide.eclipse.jdt.internal.launch.MavenRuntimeClasspathProvider that is ignoring project output settings. Searching to understand what the problem is.

          People

          • Assignee:
            Simone Gianni
            Reporter:
            Simone Gianni
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development