Uploaded image for project: 'Maven Source Plugin'
  1. Maven Source Plugin
  2. MSOURCES-6

Sources plugin ignores resource includes/excludes

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 2.0.1
    • 2.0.3
    • None
    • Patch

    Description

      The sources plugin appears to ignore the <includes> and <excludes> filters on <resource> items. I discovered this because I have a project that needs to package certain files that appear in the project root; e.g. <directory>.</directory>, and then I <include> certain files.

      Trouble is, when the source plugin runs, it packages up EVERYTHING - including the stuff in the "target" (output) directory! This leads to a source attachment that's much too large. Worse, if you forget to clean between builds, the size of the source jar will increase exponentially with each build.

      Checking out the source code at http://svn.apache.org/viewvc/maven/plugins/trunk/maven-source-plugin/src/main/java/org/apache/maven/plugin/source/AbstractJarSourceMojo.java?view=markup, I think the problem is in the addDirectories() method, which is simply adding resource.getDirectory() and dropping the other information on the floor.

      Attachments

        1. maven-source-plugin-2.0.2.patch
          16 kB
          Richard van der Hoff
        2. maven-source-plugin-2.0.2-patches-take2.zip
          4 kB
          Richard van der Hoff
        3. maven-sources-plugin-patches_v1.1.zip
          6 kB
          Micah Whitacre
        4. maven-sources-plugin-patches.zip
          3 kB
          Micah Whitacre
        5. patch.txt
          4 kB
          Matthew Beermann

        Issue Links

          Activity

            People

              snicoll Stephane Nicoll
              mbeerman Matthew Beermann
              Votes:
              22 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: