Maven Eclipse Plugin
  1. Maven Eclipse Plugin
  2. MECLIPSE-173

Project should be considered a Java project if it has at least one source folder even if the language of its artifact handler is not java

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: PDE support
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      Use case:

      • I have non java source files in src/main/foo (for example a UML model)
      • the "foo" artifact handler builds a zip containing the "foo" source files and its language is not "java" (for example the UML model zipped)
      • I have a "bar" plugin which generates "bar" java source files from the "foo" source files in target/generated-sources/bar. (for example an MDA plugin)
      • The "bar" plugin also builds a jar containing the target/generated-sources/bar java source files and attachs it with a "bar" classifier.

      So even if the language of my project's artifact handler is not set to "java", since my project contains java source code (generated), my project should be considered a java project so that it can be referenced in multiproject mode by other projects in their build path.

      The effect is obtained by replacing :
      isJavaProject = "java".equals( artifactHandler.getLanguage() ) && !"ear".equals( packaging );

      by

      isJavaProject = ("java".equals(artifactHandler.getLanguage()) || sourceDirs.length > 0)
      && !"ear".equals(packaging);

      and moving the code which builds the sourceDirs from the EclipsePlugin#writeConfiguration( IdeDependency[] deps ) to the EclipsePlugin#setup() method.

      Regards,

      CÚdric

        Activity

        Hide
        CÚdric Vidal added a comment -

        The patch has been created with TortoiseSVN relative to the root of the maven-eclipse-plugin.

        Regards.

        Show
        CÚdric Vidal added a comment - The patch has been created with TortoiseSVN relative to the root of the maven-eclipse-plugin. Regards.
        Hide
        CÚdric Vidal added a comment -

        BTW, the patch has been created against R463022.

        Show
        CÚdric Vidal added a comment - BTW, the patch has been created against R463022.
        Hide
        Graham Leggett added a comment -

        The v2.4 plugin contains a patch that forced the project to be considered a Java project if the PDE mode was enabled.

        This in theory should solve this problem.

        Show
        Graham Leggett added a comment - The v2.4 plugin contains a patch that forced the project to be considered a Java project if the PDE mode was enabled. This in theory should solve this problem.
        Hide
        Arnaud Heritier added a comment -

        CÚdric, can you test if it is arlready fixed in the version 2.4 ?

        Show
        Arnaud Heritier added a comment - CÚdric, can you test if it is arlready fixed in the version 2.4 ?
        Hide
        CÚdric Vidal added a comment -

        Hi guys,

        Sorry for taking so long to test 2.4

        I finally tested it and yes, in pde mode, my project is considered a Java project. But ... because of MECLIPSE-142, I can't rely on this pde mode

        What's more, the pde mode in this case is a workaround, not the solution as my project is not a pde project. Is the modification I propose considered for inclusion in the codebase ? If a patch would make it easier, I can write it.

        Kind regards,

        CÚdric

        Show
        CÚdric Vidal added a comment - Hi guys, Sorry for taking so long to test 2.4 I finally tested it and yes, in pde mode, my project is considered a Java project. But ... because of MECLIPSE-142 , I can't rely on this pde mode What's more, the pde mode in this case is a workaround, not the solution as my project is not a pde project. Is the modification I propose considered for inclusion in the codebase ? If a patch would make it easier, I can write it. Kind regards, CÚdric
        Hide
        Michael Osipov added a comment -

        Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

        Show
        Michael Osipov added a comment - Please refer to https://cwiki.apache.org/confluence/display/MAVEN/The+Great+JIRA+Cleanup+of+2014 if you're wondering why this issue was closed out.

          People

          • Assignee:
            Unassigned
            Reporter:
            CÚdric Vidal
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: