You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Si_Simon <si...@purpleblade.net> on 2007/07/13 22:22:03 UTC

Maven checkstyle plugin - how to get this working

So I configured my pom to use the checkstyle plugin.
It is looking for the configuration files.  Not wanting to create them from
scratch, I then downloaded the .zip for checkstyle-4.3 that has these config
files but when I point to them in the pom.xml there are many, many problems
(variables not set) so am assuming I am going about this the wrong way.

Is there a location that shows how to get going with maven checkstyle
plugin?  The page on the checkstyle plugin tells you what to put in the pom
but not where to get the default config files that work with the plugin. 
confusing.

si'mon
-- 
View this message in context: http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11586890
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven checkstyle plugin - how to get this working

Posted by Dennis Lundberg <de...@apache.org>.
These are not configuration files, they are Checkstyle reports in xml 
format. Just leave them as they are.

The answers to the rest of your questions can be found on the plugin site:
   http://maven.apache.org/plugins/maven-checkstyle-plugin/


Si_Simon wrote:
> thanks, I took the config param out (pointing to the checks file) and it
> works.  
> 
> The problem is that we have many modules and a new checkstyle config file
> gets created on the fly and put into each subdirectory.  I suppose it is
> hardcoded in the jar or something to generate one.

> I suppose all of these config files are the same and can take one of them to
> use as a template.  Ultimately I want all modules to use the same
> configuration file and not generate one as it is running and put it in the
> target/ directory.
> 
> I need to figure this one out.  Would also like to figure out how to create
> one html report for all modules.  Right now it creates separate xml files
> for each module.  Would you know what setting I could use to generate html
> reports instead of xml?  I did not see a setting the maven docs.
> 
> thanks
> 
> Si'mon
> 
> 
> Thanks
> 
> 
> Si'mon
> 
> 
> jason r tibbetts wrote:
>> Si_Simon wrote:
>>> So I configured my pom to use the checkstyle plugin.
>>> It is looking for the configuration files.  Not wanting to create them
>>> from
>>> scratch, I then downloaded the .zip for checkstyle-4.3 that has these
>>> config
>>> files but when I point to them in the pom.xml there are many, many
>>> problems
>>> (variables not set) so am assuming I am going about this the wrong way.
>>>
>>> Is there a location that shows how to get going with maven checkstyle
>>> plugin?  The page on the checkstyle plugin tells you what to put in the
>>> pom
>>> but not where to get the default config files that work with the plugin. 
>>> confusing.
>> I don't quite understand what you're asking. The default config files 
>> are already in the plugin; you don't have to do anything. Do a 'mvn 
>> site' and you'll get a checkstyle report.
>>
>> If you /do/ want to change the configuration, you set the configLocation 
>> property to point to the new config files. There are some other 
>> properties that can be customized as well, such as propertiesFile and 
>> suppressionsFile.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>
> 


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven checkstyle plugin - how to get this working

Posted by Mick Knutson <mi...@gmail.com>.
for multi-modules like mine and yours, this worked great:

http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html




On 7/13/07, Si_Simon <si...@purpleblade.net> wrote:
>
>
> thanks, I took the config param out (pointing to the checks file) and it
> works.
>
> The problem is that we have many modules and a new checkstyle config file
> gets created on the fly and put into each subdirectory.  I suppose it is
> hardcoded in the jar or something to generate one.
>
> I suppose all of these config files are the same and can take one of them
> to
> use as a template.  Ultimately I want all modules to use the same
> configuration file and not generate one as it is running and put it in the
> target/ directory.
>
> I need to figure this one out.  Would also like to figure out how to
> create
> one html report for all modules.  Right now it creates separate xml files
> for each module.  Would you know what setting I could use to generate html
> reports instead of xml?  I did not see a setting the maven docs.
>
> thanks
>
> Si'mon
>
>
> Thanks
>
>
> Si'mon
>
>
> jason r tibbetts wrote:
> >
> > Si_Simon wrote:
> >> So I configured my pom to use the checkstyle plugin.
> >> It is looking for the configuration files.  Not wanting to create them
> >> from
> >> scratch, I then downloaded the .zip for checkstyle-4.3 that has these
> >> config
> >> files but when I point to them in the pom.xml there are many, many
> >> problems
> >> (variables not set) so am assuming I am going about this the wrong way.
> >>
> >> Is there a location that shows how to get going with maven checkstyle
> >> plugin?  The page on the checkstyle plugin tells you what to put in the
> >> pom
> >> but not where to get the default config files that work with the
> plugin.
> >> confusing.
> >
> > I don't quite understand what you're asking. The default config files
> > are already in the plugin; you don't have to do anything. Do a 'mvn
> > site' and you'll get a checkstyle report.
> >
> > If you /do/ want to change the configuration, you set the configLocation
> > property to point to the new config files. There are some other
> > properties that can be customized as well, such as propertiesFile and
> > suppressionsFile.
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11587736
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: Maven checkstyle plugin - how to get this working

Posted by Si_Simon <si...@purpleblade.net>.
thanks, I took the config param out (pointing to the checks file) and it
works.  

The problem is that we have many modules and a new checkstyle config file
gets created on the fly and put into each subdirectory.  I suppose it is
hardcoded in the jar or something to generate one.

I suppose all of these config files are the same and can take one of them to
use as a template.  Ultimately I want all modules to use the same
configuration file and not generate one as it is running and put it in the
target/ directory.

I need to figure this one out.  Would also like to figure out how to create
one html report for all modules.  Right now it creates separate xml files
for each module.  Would you know what setting I could use to generate html
reports instead of xml?  I did not see a setting the maven docs.

thanks

Si'mon


Thanks


Si'mon


jason r tibbetts wrote:
> 
> Si_Simon wrote:
>> So I configured my pom to use the checkstyle plugin.
>> It is looking for the configuration files.  Not wanting to create them
>> from
>> scratch, I then downloaded the .zip for checkstyle-4.3 that has these
>> config
>> files but when I point to them in the pom.xml there are many, many
>> problems
>> (variables not set) so am assuming I am going about this the wrong way.
>> 
>> Is there a location that shows how to get going with maven checkstyle
>> plugin?  The page on the checkstyle plugin tells you what to put in the
>> pom
>> but not where to get the default config files that work with the plugin. 
>> confusing.
> 
> I don't quite understand what you're asking. The default config files 
> are already in the plugin; you don't have to do anything. Do a 'mvn 
> site' and you'll get a checkstyle report.
> 
> If you /do/ want to change the configuration, you set the configLocation 
> property to point to the new config files. There are some other 
> properties that can be customized as well, such as propertiesFile and 
> suppressionsFile.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11587736
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven checkstyle plugin - how to get this working

Posted by Mick Knutson <mi...@gmail.com>.
I tried this just today,  and find that the plug-in is missing generics
support.
So, I took the one from the plug-in, then made my updates. I attached the
version plus generics here.. (hope this works)

Then, here is my plug-in declaration
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>

C:/viewstore/esp_lynx_dap/esp/dap/utilities/common/build-tools/src/main/resources/sun_checks.xml
                    </configLocation>
                </configuration>
            </plugin>


Notice I force the plugin to use mine.
This works great now.






On 7/13/07, jason r tibbetts <ti...@verdi.iisd.sra.com> wrote:
>
> Si_Simon wrote:
> > So I configured my pom to use the checkstyle plugin.
> > It is looking for the configuration files.  Not wanting to create them
> from
> > scratch, I then downloaded the .zip for checkstyle-4.3 that has these
> config
> > files but when I point to them in the pom.xml there are many, many
> problems
> > (variables not set) so am assuming I am going about this the wrong way.
> >
> > Is there a location that shows how to get going with maven checkstyle
> > plugin?  The page on the checkstyle plugin tells you what to put in the
> pom
> > but not where to get the default config files that work with the plugin.
> > confusing.
>
> I don't quite understand what you're asking. The default config files
> are already in the plugin; you don't have to do anything. Do a 'mvn
> site' and you'll get a checkstyle report.
>
> If you /do/ want to change the configuration, you set the configLocation
> property to point to the new config files. There are some other
> properties that can be customized as well, such as propertiesFile and
> suppressionsFile.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: Maven checkstyle plugin - how to get this working

Posted by jason r tibbetts <ti...@verdi.iisd.sra.com>.
Si_Simon wrote:
> So I configured my pom to use the checkstyle plugin.
> It is looking for the configuration files.  Not wanting to create them from
> scratch, I then downloaded the .zip for checkstyle-4.3 that has these config
> files but when I point to them in the pom.xml there are many, many problems
> (variables not set) so am assuming I am going about this the wrong way.
> 
> Is there a location that shows how to get going with maven checkstyle
> plugin?  The page on the checkstyle plugin tells you what to put in the pom
> but not where to get the default config files that work with the plugin. 
> confusing.

I don't quite understand what you're asking. The default config files 
are already in the plugin; you don't have to do anything. Do a 'mvn 
site' and you'll get a checkstyle report.

If you /do/ want to change the configuration, you set the configLocation 
property to point to the new config files. There are some other 
properties that can be customized as well, such as propertiesFile and 
suppressionsFile.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven checkstyle plugin - how to get this working

Posted by Si_Simon <si...@purpleblade.net>.
For some reason it will only generate xml reports and not html.  I am using
the default config file.  I thought I remembered using at one time a setting
in the pom <configuration> of the plugin to force html instead of xml.

thanks for all the help.



Mick Knutson-4 wrote:
> 
> 1.
> 
>     <reporting>
> ....
>         <plugins>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-checkstyle-plugin</artifactId>
>                 <configuration>
>                     <configLocation>
> 
> C:/viewstore/esp_lynx_dap/esp/dap/utilities/common/build-tools/src/main/resources/sun_checks.xml
>                     </configLocation>
>                 </configuration>
>             </plugin>
> 
> This generates the checkstyle HTML during the site command.
> 
> 2. Not that I know of...
> 
> 
> 
> 
> On 7/13/07, Si_Simon <si...@purpleblade.net> wrote:
>>
>>
>> I got it working out of the box, now just need to tune some things.  We
>> have
>> multiple maven modules each with it's own pom.  A
>> target/checkstyle-report.xml is created for each module.
>>
>> Would you know what setting will dump out an html report instead?  I did
>> not
>> see the option on the website anywhere.
>>
>> Also is it possible to have checkstyle dump out one report for all
>> modules
>> in one file?
>>
>> thanks for the help
>>
>>
>> Si'mon
>>
>>
>> Dennis Lundberg-2 wrote:
>> >
>> > Getting a sample Checkstyle configuration file from Checkstyle
>> > themselves is a good way to start. I'll try to add an FAQ for the
>> plugin
>> > site:
>> >    "Where can I find a good configuration file for Checkstyle?"
>> >
>> > What kind of problems are your experiencing? Is the
>> > maven-checkstyle-plugin not working? Does it find problems in your
>> code?
>> >
>> > Please note that the currently released maven-checkstyle-plugin uses
>> > Checkstyle 4.1. So if you try to use checks that were introduced in a
>> > later version of Checkstyle - it will fail.
>> >
>> > Si_Simon wrote:
>> >> So I configured my pom to use the checkstyle plugin.
>> >> It is looking for the configuration files.  Not wanting to create them
>> >> from
>> >> scratch, I then downloaded the .zip for checkstyle-4.3 that has these
>> >> config
>> >> files but when I point to them in the pom.xml there are many, many
>> >> problems
>> >> (variables not set) so am assuming I am going about this the wrong
>> way.
>> >>
>> >> Is there a location that shows how to get going with maven checkstyle
>> >> plugin?  The page on the checkstyle plugin tells you what to put in
>> the
>> >> pom
>> >> but not where to get the default config files that work with the
>> plugin.
>> >> confusing.
>> >>
>> >> si'mon
>> >
>> >
>> > --
>> > Dennis Lundberg
>> >
>> > ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> > For additional commands, e-mail: users-help@maven.apache.org
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11587775
>> Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
> 
> 
> -- 
> ---
> Thanks,
> Mick Knutson
> 
> http://www.baselogic.com
> http://www.blincmagazine.com
> http://www.djmick.com
> http://www.myspace.com/mickknutson
> http://www.myspace.com/djmick_dot_com
> http://www.myspace.com/sexybeotches
> http://www.thumpradio.com
> ---
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11588268
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven checkstyle plugin - how to get this working

Posted by Mick Knutson <mi...@gmail.com>.
1.

    <reporting>
....
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-checkstyle-plugin</artifactId>
                <configuration>
                    <configLocation>

C:/viewstore/esp_lynx_dap/esp/dap/utilities/common/build-tools/src/main/resources/sun_checks.xml
                    </configLocation>
                </configuration>
            </plugin>

This generates the checkstyle HTML during the site command.

2. Not that I know of...




On 7/13/07, Si_Simon <si...@purpleblade.net> wrote:
>
>
> I got it working out of the box, now just need to tune some things.  We
> have
> multiple maven modules each with it's own pom.  A
> target/checkstyle-report.xml is created for each module.
>
> Would you know what setting will dump out an html report instead?  I did
> not
> see the option on the website anywhere.
>
> Also is it possible to have checkstyle dump out one report for all modules
> in one file?
>
> thanks for the help
>
>
> Si'mon
>
>
> Dennis Lundberg-2 wrote:
> >
> > Getting a sample Checkstyle configuration file from Checkstyle
> > themselves is a good way to start. I'll try to add an FAQ for the plugin
> > site:
> >    "Where can I find a good configuration file for Checkstyle?"
> >
> > What kind of problems are your experiencing? Is the
> > maven-checkstyle-plugin not working? Does it find problems in your code?
> >
> > Please note that the currently released maven-checkstyle-plugin uses
> > Checkstyle 4.1. So if you try to use checks that were introduced in a
> > later version of Checkstyle - it will fail.
> >
> > Si_Simon wrote:
> >> So I configured my pom to use the checkstyle plugin.
> >> It is looking for the configuration files.  Not wanting to create them
> >> from
> >> scratch, I then downloaded the .zip for checkstyle-4.3 that has these
> >> config
> >> files but when I point to them in the pom.xml there are many, many
> >> problems
> >> (variables not set) so am assuming I am going about this the wrong way.
> >>
> >> Is there a location that shows how to get going with maven checkstyle
> >> plugin?  The page on the checkstyle plugin tells you what to put in the
> >> pom
> >> but not where to get the default config files that work with the
> plugin.
> >> confusing.
> >>
> >> si'mon
> >
> >
> > --
> > Dennis Lundberg
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11587775
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
---
Thanks,
Mick Knutson

http://www.baselogic.com
http://www.blincmagazine.com
http://www.djmick.com
http://www.myspace.com/mickknutson
http://www.myspace.com/djmick_dot_com
http://www.myspace.com/sexybeotches
http://www.thumpradio.com
---

Re: Maven checkstyle plugin - how to get this working

Posted by Si_Simon <si...@purpleblade.net>.
I got it working out of the box, now just need to tune some things.  We have
multiple maven modules each with it's own pom.  A
target/checkstyle-report.xml is created for each module.

Would you know what setting will dump out an html report instead?  I did not
see the option on the website anywhere.

Also is it possible to have checkstyle dump out one report for all modules
in one file?

thanks for the help


Si'mon


Dennis Lundberg-2 wrote:
> 
> Getting a sample Checkstyle configuration file from Checkstyle 
> themselves is a good way to start. I'll try to add an FAQ for the plugin 
> site:
>    "Where can I find a good configuration file for Checkstyle?"
> 
> What kind of problems are your experiencing? Is the 
> maven-checkstyle-plugin not working? Does it find problems in your code?
> 
> Please note that the currently released maven-checkstyle-plugin uses 
> Checkstyle 4.1. So if you try to use checks that were introduced in a 
> later version of Checkstyle - it will fail.
> 
> Si_Simon wrote:
>> So I configured my pom to use the checkstyle plugin.
>> It is looking for the configuration files.  Not wanting to create them
>> from
>> scratch, I then downloaded the .zip for checkstyle-4.3 that has these
>> config
>> files but when I point to them in the pom.xml there are many, many
>> problems
>> (variables not set) so am assuming I am going about this the wrong way.
>> 
>> Is there a location that shows how to get going with maven checkstyle
>> plugin?  The page on the checkstyle plugin tells you what to put in the
>> pom
>> but not where to get the default config files that work with the plugin. 
>> confusing.
>> 
>> si'mon
> 
> 
> -- 
> Dennis Lundberg
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Maven-checkstyle-plugin---how-to-get-this-working-tf4076713s177.html#a11587775
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Maven checkstyle plugin - how to get this working

Posted by Dennis Lundberg <de...@apache.org>.
Getting a sample Checkstyle configuration file from Checkstyle 
themselves is a good way to start. I'll try to add an FAQ for the plugin 
site:
   "Where can I find a good configuration file for Checkstyle?"

What kind of problems are your experiencing? Is the 
maven-checkstyle-plugin not working? Does it find problems in your code?

Please note that the currently released maven-checkstyle-plugin uses 
Checkstyle 4.1. So if you try to use checks that were introduced in a 
later version of Checkstyle - it will fail.

Si_Simon wrote:
> So I configured my pom to use the checkstyle plugin.
> It is looking for the configuration files.  Not wanting to create them from
> scratch, I then downloaded the .zip for checkstyle-4.3 that has these config
> files but when I point to them in the pom.xml there are many, many problems
> (variables not set) so am assuming I am going about this the wrong way.
> 
> Is there a location that shows how to get going with maven checkstyle
> plugin?  The page on the checkstyle plugin tells you what to put in the pom
> but not where to get the default config files that work with the plugin. 
> confusing.
> 
> si'mon


-- 
Dennis Lundberg

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org