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

Only include **/*.java in Java source directories

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.5.1
    • Fix Version/s: 2.6
    • Component/s: None
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      2

      Description

      Since Maven only recognizes *.java files in Java source directories (src/main/java, or src/test/java, for example), it would be nice if the plugin produced .classpath files configured the same way. Right now, a developer can inadvertently leave a non-Java resource in one of those directories, and everything will work fine in Eclipse. But when the time comes to produce a package, that artifact will be missing since Maven won't pick it up.

      1. MECLIPSE-443.2.patch
        1.0 kB
        Michael Johns
      2. MECLIPSE-443.patch
        1 kB
        Michael Johns

        Issue Links

          Activity

          Hide
          Michael Johns added a comment -

          First patch was incomplete. Sorry about that.

          Show
          Michael Johns added a comment - First patch was incomplete. Sorry about that.
          Hide
          Barrie Treloar added a comment -

          Applied suggested patch by Michael Johns and updated expected test files.

          Show
          Barrie Treloar added a comment - Applied suggested patch by Michael Johns and updated expected test files.
          Hide
          Arnaud Heritier added a comment -

          Are we sure it won't break many projects which stored other files (like properties, xml) in the java dir (even it's a bad practice)
          What is the behavior of the compiler plugin in maven ??
          Is it strict like this ?

          Show
          Arnaud Heritier added a comment - Are we sure it won't break many projects which stored other files (like properties, xml) in the java dir (even it's a bad practice) What is the behavior of the compiler plugin in maven ?? Is it strict like this ?
          Hide
          Michael Johns added a comment -

          Yes, that's the default behavior of the compiler plugin: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java?view=markup

          You can override that behavior to include other types of files. I suppose this plugin should follow that same pattern.

          Show
          Michael Johns added a comment - Yes, that's the default behavior of the compiler plugin: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-compiler-plugin/src/main/java/org/apache/maven/plugin/CompilerMojo.java?view=markup You can override that behavior to include other types of files. I suppose this plugin should follow that same pattern.
          Hide
          marc schipperheyn added a comment -

          This fix has a really annoying side effect of force including */.java on src/main/resources folders every time you maven-update the project. I haven't been able to turn this off by specifying <sourceIncludes><sourceInclude>*/src/main/resources//</sourceInclude></sourceIncludes> in the configuration of the plugin.

          Show
          marc schipperheyn added a comment - This fix has a really annoying side effect of force including * / .java on src/main/resources folders every time you maven-update the project. I haven't been able to turn this off by specifying <sourceIncludes><sourceInclude>* /src/main/resources/ / </sourceInclude></sourceIncludes> in the configuration of the plugin.

            People

            • Assignee:
              Barrie Treloar
              Reporter:
              Michael Johns
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: