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
    • Priority: Major Major
    • Resolution: Won't Fix
    • Affects Version/s: 2.2
    • Fix Version/s: None
    • Component/s: PDE support
    • Labels:
      None
    • Flags:
      Patch

      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

        Cédric Vidal created issue -
        c.vidal made changes -
        Field Original Value New Value
        Attachment MECLIPSE-173.patch [ 23467 ]
        fabrizio giustina made changes -
        Fix Version/s 2.3 [ 12556 ]
        Fix Version/s 2.4 [ 13001 ]
        Brian Fox made changes -
        Fix Version/s 2.4 [ 13001 ]
        Fix Version/s 2.5 [ 13593 ]
        Arnaud HERITIER made changes -
        Fix Version/s 2.5 [ 13593 ]
        Arnaud HERITIER made changes -
        Patch Submitted [Yes]
        Michael Osipov made changes -
        Resolution Won't Fix [ 2 ]
        Status Open [ 1 ] Closed [ 6 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 10:00:37 UTC 2015 [ 1428228037919 ]
        Mark Thomas made changes -
        Workflow jira [ 12720589 ] Default workflow, editable Closed status [ 12750863 ]
        Mark Thomas made changes -
        Patch attached Yes [ 10860 ]
        Flags Patch [ 10430 ]
        Mark Thomas made changes -
        Patch Submitted Yes [ 10763 ]
        Mark Thomas made changes -
        Project Import Sun Apr 05 23:47:18 UTC 2015 [ 1428277638729 ]
        Mark Thomas made changes -
        Workflow jira [ 12958622 ] Default workflow, editable Closed status [ 12995508 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved:

              Development