You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@creadur.apache.org by John W Vines <jo...@ugov.gov> on 2011/11/28 22:23:38 UTC

Rat Maven Plugin - A few comments & questions

I'm attempting to use RAT to validate apache headers on my project. RAT has some great properties, but from a POM perspective my options seem extremely limited (as far as I can tell from your documentation).

1. Generated thrift code - I can't seem to get the RAT module working in this regard. They have a common header, so I was hoping to add the "Autogenerated by thrift" header to the licenses so they would be ignored, but I cannot set licenses in the pom. It would be great if I could provide a license in the pom which would be interpreted as such.

2. Ignore files by size - I saw in the website that with ant I could do a filter based on file size, but I couldn't find anything in the pom. Does this feature exist?

3. useEclipseDefaultExcludes while including subProjects - it looks like this successfully ignores the .project, etc. files in teh root of the project, but it does not ignore these files in the subprojects. I don't know if this is a bug or if I am missing something.

Sorry to just start hurling questions your way, I'm trying to figure out what I can do to fully utilize RAT for my project.

Thanks
John

Re: Rat Maven Plugin - A few comments & questions

Posted by sebb <se...@gmail.com>.
On 29 November 2011 10:12, Jochen Wiedmann <jo...@gmail.com> wrote:
> On Mon, Nov 28, 2011 at 10:23 PM, John W Vines <jo...@ugov.gov> wrote:
>> 2. Ignore files by size - I saw in the website that with ant I could do a filter based on file size, but I couldn't find anything in the pom. Does this feature exist?
>
> Is there a JIRA issue for that one?

https://issues.apache.org/jira/browse/RAT-2

mentions ignoring empty files and says that the Ant task supports
selection by size.

> Jochen
>
>
> --
> Capitalism is the astounding belief that the most wickedest of men
> will do the most wickedest of things for the greatest good of
> everyone.
>
> John Maynard Keynes (http://en.wikiquote.org/wiki/Keynes)
>
> https://linuxcounter.net/user/221257.html

Re: Rat Maven Plugin - A few comments & questions

Posted by Jochen Wiedmann <jo...@gmail.com>.
On Mon, Nov 28, 2011 at 10:23 PM, John W Vines <jo...@ugov.gov> wrote:
> 2. Ignore files by size - I saw in the website that with ant I could do a filter based on file size, but I couldn't find anything in the pom. Does this feature exist?

Is there a JIRA issue for that one?

Jochen


-- 
Capitalism is the astounding belief that the most wickedest of men
will do the most wickedest of things for the greatest good of
everyone.

John Maynard Keynes (http://en.wikiquote.org/wiki/Keynes)

https://linuxcounter.net/user/221257.html

Re: Rat Maven Plugin - A few comments & questions

Posted by John W Vines <jo...@ugov.gov>.
----- Original Message -----
| From: "Stefan Bodewig" <bo...@apache.org>
| To: rat-dev@incubator.apache.org
| Sent: Tuesday, November 29, 2011 4:35:14 AM
| Subject: Re: Rat Maven Plugin - A few comments & questions
| Hi John,
| 
| I can't say I was an expert for the Maven plugin, quite the opposite,
| but I'll try.
| 
| On 2011-11-28, John W Vines wrote:
| 
| > 1. Generated thrift code - I can't seem to get the RAT module
| > working
| > in this regard. They have a common header, so I was hoping to add
| > the
| > "Autogenerated by thrift" header to the licenses so they would be
| > ignored, but I cannot set licenses in the pom. It would be great if
| > I
| > could provide a license in the pom which would be interpreted as
| > such.
| 
| You should be able to make this header detected by using a custom
| license. Once it is detected it doesn't mean it is approved. You have
| to perform both steps documented at
| 
| <http://incubator.apache.org/rat/apache-rat-plugin/examples/custom-license.html>

So this is what I want to do, but I can't seem to get it working right. I'm trying to use the custom license stuff to get it to ignore generated thrift code (I put in a ticket to get it fixed with a patch). I do the following:
              <licenses>
                <license implementation="org.apache.rat.analysis.license.SimplePatternBasedLicense">
                  <licenseFamilyCategory>GEN</licenseFamilyCategory>
                  <licenseFamilyName>Generated Code</licenseFamilyName>
                  <notes>I don't know the proper way to do this, I just want to
                    ignore thrift generated code</notes>
                  <patterns>
                    <pattern>.*Autogenerated by Thrift.*</pattern>
                  </patterns>
                </license>
              </licenses>
              <licenseFamily implementation="org.apache.rat.license.SimpleLicenseFamily">
                <familyName>Generated Code</familyName>
              </licenseFamily>

I've tried tweaking it numerous different ways, but I can't get it to ignore the files. They have the header 
/**
 * Autogenerated by Thrift
 *
 * DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
 */

I've tried trailing wildcards, etc. to see if it works, but nothing.

| 
| > 2. Ignore files by size - I saw in the website that with ant I could
| > do a filter based on file size, but I couldn't find anything in the
| > pom. Does this feature exist?
| 
| Honestly I don't know enough about Maven's resource selection process
| but I think only pattern based includes/excludes are possible for the
| plugin.
| 
| > 3. useEclipseDefaultExcludes while including subProjects - it looks
| > like this successfully ignores the .project, etc. files in teh root
| > of
| > the project, but it does not ignore these files in the subprojects.
| > I
| > don't know if this is a bug or if I am missing something.
| 
| Sounds like a bug to me. It would be good if you could open a JIRA
| ticket (even better if it contained a testcase, and the usual stuff
| you
| tell people who report bugs on Thrift ;-)

Ticket's in, though I missed that part about testcase when I created it...


| 
| > Sorry to just start hurling questions your way,
| 
| No, please keep bringing them here.
| 
| Stefan


John

Re: Rat Maven Plugin - A few comments & questions

Posted by Stefan Bodewig <bo...@apache.org>.
Hi John,

I can't say I was an expert for the Maven plugin, quite the opposite,
but I'll try.

On 2011-11-28, John W Vines wrote:

> 1. Generated thrift code - I can't seem to get the RAT module working
> in this regard. They have a common header, so I was hoping to add the
> "Autogenerated by thrift" header to the licenses so they would be
> ignored, but I cannot set licenses in the pom. It would be great if I
> could provide a license in the pom which would be interpreted as such.

You should be able to make this header detected by using a custom
license.  Once it is detected it doesn't mean it is approved.  You have
to perform both steps documented at

<http://incubator.apache.org/rat/apache-rat-plugin/examples/custom-license.html>

> 2. Ignore files by size - I saw in the website that with ant I could
> do a filter based on file size, but I couldn't find anything in the
> pom. Does this feature exist?

Honestly I don't know enough about Maven's resource selection process
but I think only pattern based includes/excludes are possible for the
plugin.

> 3. useEclipseDefaultExcludes while including subProjects - it looks
> like this successfully ignores the .project, etc. files in teh root of
> the project, but it does not ignore these files in the subprojects. I
> don't know if this is a bug or if I am missing something.

Sounds like a bug to me.  It would be good if you could open a JIRA
ticket (even better if it contained a testcase, and the usual stuff you
tell people who report bugs on Thrift ;-)

> Sorry to just start hurling questions your way,

No, please keep bringing them here.

Stefan