Apache Rat
  1. Apache Rat
  2. RAT-126

Default excludes do not ignore .git/ repository

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 0.8
    • Fix Version/s: 0.9
    • Component/s: maven
    • Labels:
      None
    • Environment:
      Windows 7, Maven 3.0.4, Oracle JDK 1.7.0_11, Eclipse

      Description

      When running the RAT 0.8 maven plugin from command line (no POM entry for the plugin) in a Eclipse+Maven project which is checked out from .git/ the plugin will not by default exclude the repository dotdir.

      C:\ws\proj>\ws\apache-maven-3.0.4\bin\mvn -s ..\empty.xml org.apache.rat:apache-rat-plugin:check
      ...
      [INFO] — apache-rat-plugin:0.8:check (default-cli) @ et-otp —
      [INFO] No excludes
      ...

      The excludes should eighter be contained in the eclipse defaults or have its own dotfile or scm category. A workaround would be to specify the excludes, unfortunatelly there seems to be no expression associated with the exclude property of the mojo.

        Activity

        Hide
        Robert Burrell Donkin added a comment -

        Hi Bernd

        We're pushing towards releasing Apache Rat 0.9 very soon. If you could supply a patch including appropriate tests, we might be able to squeeze a fix in. Otherwise, it will probably need to wait until 0.10 (though I hope we'll be able to release more often in the new future).

        Robert

        Show
        Robert Burrell Donkin added a comment - Hi Bernd We're pushing towards releasing Apache Rat 0.9 very soon. If you could supply a patch including appropriate tests, we might be able to squeeze a fix in. Otherwise, it will probably need to wait until 0.10 (though I hope we'll be able to release more often in the new future). Robert
        Hide
        Bernd Eckenfels added a comment -

        Hello, I just noticed that according to the Source and Comments the defaultExcludes should already contain .git. And the defaultExcludes are also turned on bye default. At least this is what the -X debug run of Maven tells me. But still it says "No Excludes". So I am a bit confused. Maybe it was fixed since 0.8 (there are some changes but no obvious fix). Can anybody confirm that the excludes feature is excluding any default directorries?

        [DEBUG] Configuring mojo 'org.apache.rat:apache-rat-plugin:0.8:check' with basic configurator -->
        [DEBUG] (f) addDefaultLicenseMatchers = true
        [DEBUG] (f) addLicenseHeaders = false
        [DEBUG] (f) basedir = C:\ws\github\proj
        [DEBUG] (f) excludeSubProjects = true
        [DEBUG] (f) numUnapprovedLicenses = 0
        [DEBUG] (f) reportFile = C:\ws\github\proj\target\rat.txt
        [DEBUG] (f) reportStyle = plain
        [DEBUG] (f) useDefaultExcludes = true # should match .git
        [DEBUG] (f) useEclipseDefaultExcludes = true # should match .project
        [DEBUG] (f) useIdeaDefaultExcludes = true
        [DEBUG] (f) useMavenDefaultExcludes = true
        [DEBUG] – end configuration –
        [INFO] No excludes

        The default list in plexus DirectoryScanner includes:

        "*/~", "*/##", "*/.#", "*/%%", "*/._",
        // CVS
        "*/CVS", "/CVS/", "*/.cvsignore",
        // RCS
        "*/RCS", "/RCS/*",
        // SCCS
        "*/SCCS", "/SCCS/*",
        // Visual SourceSafe
        "**/vssver.scc",
        // MKS
        "**/project.pj",
        // Subversion
        "*/.svn", "/.svn/*",
        // Arch
        "*/.arch-ids", "/.arch-ids/*",
        //Bazaar
        "*/.bzr", "/.bzr/*",
        //SurroundSCM
        "**/.MySCMServerInfo",
        // Mac
        "**/.DS_Store",
        // Serena Dimensions Version 10
        "*/.metadata", "/.metadata/*",
        // Mercurial
        "*/.hg", "/.hg/*",
        // git
        "*/.git", "/.gitignore", "/.gitattributes", "/.git/*",
        // BitKeeper
        "*/BitKeeper", "/BitKeeper/", "/ChangeSet", "/ChangeSet/*",
        // darcs
        "*/_darcs", "/_darcs/", "/.darcsrepo", "/.darcsrepo/", "/-darcs-backup", "**/.darcs-temp-mail" };

        Any idea?

        Show
        Bernd Eckenfels added a comment - Hello, I just noticed that according to the Source and Comments the defaultExcludes should already contain .git. And the defaultExcludes are also turned on bye default. At least this is what the -X debug run of Maven tells me. But still it says "No Excludes". So I am a bit confused. Maybe it was fixed since 0.8 (there are some changes but no obvious fix). Can anybody confirm that the excludes feature is excluding any default directorries? [DEBUG] Configuring mojo 'org.apache.rat:apache-rat-plugin:0.8:check' with basic configurator --> [DEBUG] (f) addDefaultLicenseMatchers = true [DEBUG] (f) addLicenseHeaders = false [DEBUG] (f) basedir = C:\ws\github\proj [DEBUG] (f) excludeSubProjects = true [DEBUG] (f) numUnapprovedLicenses = 0 [DEBUG] (f) reportFile = C:\ws\github\proj\target\rat.txt [DEBUG] (f) reportStyle = plain [DEBUG] (f) useDefaultExcludes = true # should match .git [DEBUG] (f) useEclipseDefaultExcludes = true # should match .project [DEBUG] (f) useIdeaDefaultExcludes = true [DEBUG] (f) useMavenDefaultExcludes = true [DEBUG] – end configuration – [INFO] No excludes The default list in plexus DirectoryScanner includes: "* / ~", "* /# #", "* /.# ", "* /% %", "* /._ ", // CVS "* /CVS", " /CVS/ ", " */.cvsignore", // RCS "* /RCS", " /RCS/ *", // SCCS "* /SCCS", " /SCCS/ *", // Visual SourceSafe "**/vssver.scc", // MKS "**/project.pj", // Subversion "* /.svn", " /.svn/ *", // Arch "* /.arch-ids", " /.arch-ids/ *", //Bazaar "* /.bzr", " /.bzr/ *", //SurroundSCM "**/.MySCMServerInfo", // Mac "**/.DS_Store", // Serena Dimensions Version 10 "* /.metadata", " /.metadata/ *", // Mercurial "* /.hg", " /.hg/ *", // git "* /.git", " /.gitignore", " /.gitattributes", " /.git/ *", // BitKeeper "* /BitKeeper", " /BitKeeper/ ", " /ChangeSet", " /ChangeSet/ *", // darcs "* /_darcs", " /_darcs/ ", " /.darcsrepo", " /.darcsrepo/ ", " /-darcs-backup ", "**/.darcs-temp-mail" }; Any idea?
        Hide
        Robert Burrell Donkin added a comment -

        Executing a freshly built 0.9-SNAPSHOT from the command line also indicates that there are no excludes:

        $ mvn org.apache.rat:apache-rat-plugin:0.9-SNAPSHOT:check
        [INFO] Scanning for projects...
        [INFO]
        [INFO] ------------------------------------------------------------------------
        [INFO] Building some-project 1.0-SNAPSHOT
        [INFO] ------------------------------------------------------------------------
        [INFO]
        [INFO] — apache-rat-plugin:0.9-SNAPSHOT:check (default-cli) @ some-project —
        [INFO] No excludes
        [INFO] Rat check: Summary of files. Unapproved: 3 unknown: 3 generated: 0 approved: 0 licence.
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD FAILURE
        [INFO] ------------------------------------------------------------------------
        [INFO] Total time: 2.673s
        [INFO] Finished at: Tue Feb 26 20:38:26 GMT 2013
        [INFO] Final Memory: 6M/245M
        [INFO] ------------------------------------------------------------------------
        [ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.9-SNAPSHOT:check (default-cli) on project some-project: Too many files with unapproved license: 3 See RAT report in: /opt/development/2012/kata/temp/some-project/target/rat.txt -> [Help 1]
        [ERROR]
        [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
        [ERROR] Re-run Maven using the -X switch to enable full debug logging.
        [ERROR]
        [ERROR] For more information about the errors and possible solutions, please read the following articles:
        [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

        Show
        Robert Burrell Donkin added a comment - Executing a freshly built 0.9-SNAPSHOT from the command line also indicates that there are no excludes: $ mvn org.apache.rat:apache-rat-plugin:0.9-SNAPSHOT:check [INFO] Scanning for projects... [INFO] [INFO] ------------------------------------------------------------------------ [INFO] Building some-project 1.0-SNAPSHOT [INFO] ------------------------------------------------------------------------ [INFO] [INFO] — apache-rat-plugin:0.9-SNAPSHOT:check (default-cli) @ some-project — [INFO] No excludes [INFO] Rat check: Summary of files. Unapproved: 3 unknown: 3 generated: 0 approved: 0 licence. [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [INFO] ------------------------------------------------------------------------ [INFO] Total time: 2.673s [INFO] Finished at: Tue Feb 26 20:38:26 GMT 2013 [INFO] Final Memory: 6M/245M [INFO] ------------------------------------------------------------------------ [ERROR] Failed to execute goal org.apache.rat:apache-rat-plugin:0.9-SNAPSHOT:check (default-cli) on project some-project: Too many files with unapproved license: 3 See RAT report in: /opt/development/2012/kata/temp/some-project/target/rat.txt -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
        Hide
        Robert Burrell Donkin added a comment -

        The 'No excludes' message is quite confusing. I've improved this message and added extra debug logging.

        For me, mvn org.apache.rat:apache-rat-plugin:0.9-SNAPSHOT:check now ignores the .git/ directory, via plexus DirectoryScanner.DEFAULTEXCLUDES. I'm using mvn 3.0.5.

        So, I think this might be fixed. Please retest once the release candidate is available.

        Show
        Robert Burrell Donkin added a comment - The 'No excludes' message is quite confusing. I've improved this message and added extra debug logging. For me, mvn org.apache.rat:apache-rat-plugin:0.9-SNAPSHOT:check now ignores the .git/ directory, via plexus DirectoryScanner.DEFAULTEXCLUDES. I'm using mvn 3.0.5. So, I think this might be fixed. Please retest once the release candidate is available.
        Hide
        Bernd Eckenfels added a comment -

        The fix looks good, it (suddenly?) also ignores the .git directory. BTW: I wonder if it is better to list only ignored resources instead of the exclude patterns. Especially for the number printed this is much more interesting.

        Show
        Bernd Eckenfels added a comment - The fix looks good, it (suddenly?) also ignores the .git directory. BTW: I wonder if it is better to list only ignored resources instead of the exclude patterns. Especially for the number printed this is much more interesting.
        Hide
        Robert Burrell Donkin added a comment -

        Good - the plexus dependency has been updated for this release, which is where the standard

        I found printing the excludes useful for debugging, but yes, listing the ignored resources sounds useful. I'll see if it would be easy and safe to add before the release.

        Show
        Robert Burrell Donkin added a comment - Good - the plexus dependency has been updated for this release, which is where the standard I found printing the excludes useful for debugging, but yes, listing the ignored resources sounds useful. I'll see if it would be easy and safe to add before the release.
        Hide
        Olivier Lamy (*$^¨%`£) added a comment -

        yup 3.0.10 include more default excludes (for git) and more performant for directories scanning.
        And backward compatible

        Show
        Olivier Lamy (*$^¨%`£) added a comment - yup 3.0.10 include more default excludes (for git) and more performant for directories scanning. And backward compatible
        Hide
        Robert Burrell Donkin added a comment -

        I've committed a patch which prints those resources excluded and those included, for example

        [DEBUG] Adding plexus default exclusions...
        [DEBUG] Adding exclusions often needed by Maven projects...
        [DEBUG] Adding exclusions often needed by projects developed in Eclipse...
        [DEBUG] Adding exclusions often needed by projects developed in IDEA...
        [DEBUG] Finished creating list of implicit excludes.
        [INFO] 51 implicit excludes (use -debug for more details).
        [DEBUG] Implicit exclude: */~
        [DEBUG] Implicit exclude: */##
        [DEBUG] Implicit exclude: */.#
        [DEBUG] Implicit exclude: */%%
        [DEBUG] Implicit exclude: */._
        [DEBUG] Implicit exclude: **/CVS
        [DEBUG] Implicit exclude: */CVS/*
        [DEBUG] Implicit exclude: **/.cvsignore
        [DEBUG] Implicit exclude: **/RCS
        [DEBUG] Implicit exclude: */RCS/*
        [DEBUG] Implicit exclude: **/SCCS
        [DEBUG] Implicit exclude: */SCCS/*
        [DEBUG] Implicit exclude: **/vssver.scc
        [DEBUG] Implicit exclude: **/project.pj
        [DEBUG] Implicit exclude: **/.svn
        [DEBUG] Implicit exclude: */.svn/*
        [DEBUG] Implicit exclude: **/.arch-ids
        [DEBUG] Implicit exclude: */.arch-ids/*
        [DEBUG] Implicit exclude: **/.bzr
        [DEBUG] Implicit exclude: */.bzr/*
        [DEBUG] Implicit exclude: **/.MySCMServerInfo
        [DEBUG] Implicit exclude: **/.DS_Store
        [DEBUG] Implicit exclude: **/.metadata
        [DEBUG] Implicit exclude: */.metadata/*
        [DEBUG] Implicit exclude: **/.hg
        [DEBUG] Implicit exclude: */.hg/*
        [DEBUG] Implicit exclude: **/.git
        [DEBUG] Implicit exclude: **/.gitignore
        [DEBUG] Implicit exclude: **/.gitattributes
        [DEBUG] Implicit exclude: */.git/*
        [DEBUG] Implicit exclude: **/BitKeeper
        [DEBUG] Implicit exclude: */BitKeeper/*
        [DEBUG] Implicit exclude: **/ChangeSet
        [DEBUG] Implicit exclude: */ChangeSet/*
        [DEBUG] Implicit exclude: **/_darcs
        [DEBUG] Implicit exclude: */_darcs/*
        [DEBUG] Implicit exclude: **/.darcsrepo
        [DEBUG] Implicit exclude: */.darcsrepo/*
        [DEBUG] Implicit exclude: */-darcs-backup
        [DEBUG] Implicit exclude: **/.darcs-temp-mail
        [DEBUG] Implicit exclude: target/*/
        [DEBUG] Implicit exclude: cobertura.ser
        [DEBUG] Implicit exclude: release.properties
        [DEBUG] Implicit exclude: pom.xml.releaseBackup
        [DEBUG] Implicit exclude: .classpath
        [DEBUG] Implicit exclude: .project
        [DEBUG] Implicit exclude: .settings/*/
        [DEBUG] Implicit exclude: *.iml
        [DEBUG] Implicit exclude: *.ipr
        [DEBUG] Implicit exclude: *.iws
        [DEBUG] Implicit exclude: .idea/*/
        [INFO] No excludes explicitly specified.
        [DEBUG] Excluded 13 resources:
        [DEBUG] - excluded target/rat.txt
        [DEBUG] - excluded .git/info/exclude
        [DEBUG] - excluded .git/config
        [DEBUG] - excluded .git/hooks/applypatch-msg.sample
        [DEBUG] - excluded .git/hooks/pre-rebase.sample
        [DEBUG] - excluded .git/hooks/update.sample
        [DEBUG] - excluded .git/hooks/commit-msg.sample
        [DEBUG] - excluded .git/hooks/pre-commit.sample
        [DEBUG] - excluded .git/hooks/pre-applypatch.sample
        [DEBUG] - excluded .git/hooks/post-update.sample
        [DEBUG] - excluded .git/hooks/prepare-commit-msg.sample
        [DEBUG] - excluded .git/HEAD
        [DEBUG] - excluded .git/description
        [INFO] 3 resources included
        [DEBUG] - included src/test/java/org/example/AppTest.java
        [DEBUG] - included src/main/java/org/example/App.java
        [DEBUG] - included pom.xml
        [INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 3 licence.
        [INFO] ------------------------------------------------------------------------
        [INFO] BUILD SUCCESS
        [INFO] ------------------------------------------------------------------------

        Show
        Robert Burrell Donkin added a comment - I've committed a patch which prints those resources excluded and those included, for example [DEBUG] Adding plexus default exclusions... [DEBUG] Adding exclusions often needed by Maven projects... [DEBUG] Adding exclusions often needed by projects developed in Eclipse... [DEBUG] Adding exclusions often needed by projects developed in IDEA... [DEBUG] Finished creating list of implicit excludes. [INFO] 51 implicit excludes (use -debug for more details). [DEBUG] Implicit exclude: * / ~ [DEBUG] Implicit exclude: * /# # [DEBUG] Implicit exclude: * /.# [DEBUG] Implicit exclude: * /% % [DEBUG] Implicit exclude: * /._ [DEBUG] Implicit exclude: **/CVS [DEBUG] Implicit exclude: * /CVS/ * [DEBUG] Implicit exclude: **/.cvsignore [DEBUG] Implicit exclude: **/RCS [DEBUG] Implicit exclude: * /RCS/ * [DEBUG] Implicit exclude: **/SCCS [DEBUG] Implicit exclude: * /SCCS/ * [DEBUG] Implicit exclude: **/vssver.scc [DEBUG] Implicit exclude: **/project.pj [DEBUG] Implicit exclude: **/.svn [DEBUG] Implicit exclude: * /.svn/ * [DEBUG] Implicit exclude: **/.arch-ids [DEBUG] Implicit exclude: * /.arch-ids/ * [DEBUG] Implicit exclude: **/.bzr [DEBUG] Implicit exclude: * /.bzr/ * [DEBUG] Implicit exclude: **/.MySCMServerInfo [DEBUG] Implicit exclude: **/.DS_Store [DEBUG] Implicit exclude: **/.metadata [DEBUG] Implicit exclude: * /.metadata/ * [DEBUG] Implicit exclude: **/.hg [DEBUG] Implicit exclude: * /.hg/ * [DEBUG] Implicit exclude: **/.git [DEBUG] Implicit exclude: **/.gitignore [DEBUG] Implicit exclude: **/.gitattributes [DEBUG] Implicit exclude: * /.git/ * [DEBUG] Implicit exclude: **/BitKeeper [DEBUG] Implicit exclude: * /BitKeeper/ * [DEBUG] Implicit exclude: **/ChangeSet [DEBUG] Implicit exclude: * /ChangeSet/ * [DEBUG] Implicit exclude: **/_darcs [DEBUG] Implicit exclude: * /_darcs/ * [DEBUG] Implicit exclude: **/.darcsrepo [DEBUG] Implicit exclude: * /.darcsrepo/ * [DEBUG] Implicit exclude: * /-darcs-backup [DEBUG] Implicit exclude: **/.darcs-temp-mail [DEBUG] Implicit exclude: target/* / [DEBUG] Implicit exclude: cobertura.ser [DEBUG] Implicit exclude: release.properties [DEBUG] Implicit exclude: pom.xml.releaseBackup [DEBUG] Implicit exclude: .classpath [DEBUG] Implicit exclude: .project [DEBUG] Implicit exclude: .settings/* / [DEBUG] Implicit exclude: *.iml [DEBUG] Implicit exclude: *.ipr [DEBUG] Implicit exclude: *.iws [DEBUG] Implicit exclude: .idea/* / [INFO] No excludes explicitly specified. [DEBUG] Excluded 13 resources: [DEBUG] - excluded target/rat.txt [DEBUG] - excluded .git/info/exclude [DEBUG] - excluded .git/config [DEBUG] - excluded .git/hooks/applypatch-msg.sample [DEBUG] - excluded .git/hooks/pre-rebase.sample [DEBUG] - excluded .git/hooks/update.sample [DEBUG] - excluded .git/hooks/commit-msg.sample [DEBUG] - excluded .git/hooks/pre-commit.sample [DEBUG] - excluded .git/hooks/pre-applypatch.sample [DEBUG] - excluded .git/hooks/post-update.sample [DEBUG] - excluded .git/hooks/prepare-commit-msg.sample [DEBUG] - excluded .git/HEAD [DEBUG] - excluded .git/description [INFO] 3 resources included [DEBUG] - included src/test/java/org/example/AppTest.java [DEBUG] - included src/main/java/org/example/App.java [DEBUG] - included pom.xml [INFO] Rat check: Summary of files. Unapproved: 0 unknown: 0 generated: 0 approved: 3 licence. [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------
        Hide
        Robert Burrell Donkin added a comment -

        Could this issue be safely marked as fixed in 0.9...?

        Robert

        Show
        Robert Burrell Donkin added a comment - Could this issue be safely marked as fixed in 0.9...? Robert
        Hide
        Robert Burrell Donkin added a comment -

        I think this is fixed by the upgrade to the plexus dependency. Please reopen if not.

        Show
        Robert Burrell Donkin added a comment - I think this is fixed by the upgrade to the plexus dependency. Please reopen if not.

          People

          • Assignee:
            Robert Burrell Donkin
            Reporter:
            Bernd Eckenfels
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development