Maven 1.x Checkstyle Plugin

How import my own checks into plugin checkstyle-maven

Details

  • Type: Wish Wish
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 2.5
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    XP Sp1, eclipse 3.0.1 with plugin Maven 1.0.0
  • Number of attachments :
    2

Description

Hello,
i write to you this mail because i would like to know steps by steps the way to put my checks into the plugin maven-checkstyle.
Indeed i am using : maven 1.0.2 and plugin-maven-checkstyle 2.5
I have my own checks in checks.jar (.class and a message.properties) but i don't know how to integrate this checks with maven.
So how steps by steps integrate my own checks so as to generate with Maven a report with others checks that Sun checks.
Thx

Loïc

  1. maven.xml
    28/Nov/06 10:46 AM
    0.2 kB
    Romain PELISSE
  2. patch-maven1.xml
    28/Nov/06 10:45 AM
    1 kB
    Romain PELISSE

Activity

Hide
Arnaud Heritier added a comment -

You certainly can use your own checks if you add them as a dependency in your project (thus you must add them in your repository or override the dependency).
Perhaps you'll need to declare it in the root classloader (where ant is loaded) :
<dependency>
...
<properties>
<classloader>root</classloader>
</properties>
</dependency>

Then you can use your own rules with something like that in your project.properties :
maven.checkstyle.header.file = ${basedir}/checkstyle.license
maven.checkstyle.suppressions.file = ${basedir}/checkstyle-suppressions.xml
maven.checkstyle.properties = ${basedir}/checkstyle.xml

can you test it. If it works we'll add this to the doc and we'll close the issue.

thanks

Show
Arnaud Heritier added a comment - You certainly can use your own checks if you add them as a dependency in your project (thus you must add them in your repository or override the dependency). Perhaps you'll need to declare it in the root classloader (where ant is loaded) : <dependency> ... <properties> <classloader>root</classloader> </properties> </dependency> Then you can use your own rules with something like that in your project.properties : maven.checkstyle.header.file = ${basedir}/checkstyle.license maven.checkstyle.suppressions.file = ${basedir}/checkstyle-suppressions.xml maven.checkstyle.properties = ${basedir}/checkstyle.xml can you test it. If it works we'll add this to the doc and we'll close the issue. thanks
Hide
Loïc added a comment -

After many tries, i suggest this solution to import ur own checks

Step 1 : i put in my project.properties : maven.jar.mychecks = D:/eclipse/workspace/myproject/lib/mychecks.jar

Step 2 : I put into my project.xml

<dependency>

<groupId>mychecks</groupId>

<artifactId>mychecks</artifactId>

<type>jar</type>

<properties>

<classloader>root</classloader>

</properties>
</dependency>

Step 3 : Into C:\Documents and Settings\LTAN\.maven\cache\maven-checkstyle-plugin-2.5\plugin-resources put the file mychecks_checks.xml. Don't forget to put "_checks" at the end of the name of xml file.

Final step : Into C:\Documents and Settings\LTAN\.maven\cache\maven-checkstyle-plugin-2.5 modify into plugin.properties the line "maven.checkstyle.format" like this : maven.checkstyle.format = mychecks
Don't precise "_checks", Maven goes to add "mychecks" and the string "_checks".

Now i can use only my own checks and not for example Sun's checks

Show
Loïc added a comment - After many tries, i suggest this solution to import ur own checks Step 1 : i put in my project.properties : maven.jar.mychecks = D:/eclipse/workspace/myproject/lib/mychecks.jar Step 2 : I put into my project.xml <dependency> <groupId>mychecks</groupId> <artifactId>mychecks</artifactId> <type>jar</type> <properties> <classloader>root</classloader> </properties> </dependency> Step 3 : Into C:\Documents and Settings\LTAN\.maven\cache\maven-checkstyle-plugin-2.5\plugin-resources put the file mychecks_checks.xml. Don't forget to put "_checks" at the end of the name of xml file. Final step : Into C:\Documents and Settings\LTAN\.maven\cache\maven-checkstyle-plugin-2.5 modify into plugin.properties the line "maven.checkstyle.format" like this : maven.checkstyle.format = mychecks Don't precise "_checks", Maven goes to add "mychecks" and the string "_checks". Now i can use only my own checks and not for example Sun's checks
Hide
Romain PELISSE added a comment -

Just call the other file , i post to ease integration of the ant-task in a maven 1 build.

Show
Romain PELISSE added a comment - Just call the other file , i post to ease integration of the ant-task in a maven 1 build.
Hide
Romain PELISSE added a comment -

A ANT task that "automatize" the customising process describ by Loic.

Show
Romain PELISSE added a comment - A ANT task that "automatize" the customising process describ by Loic.
Hide
Romain PELISSE added a comment -

Ok, i should post my comment before the files sorry.

Loic, I used your "trick" with success, but i didn't need to do Step 1 ( i didn't get what it was all about anyway).

The two files i posted ( an Ant file and a maven.xml ) allow to easily integrate this "process" in your maven 1 build ( to be sure not to forget to update the checks ).

Hope it'll help some of you, while this issue is open...

Show
Romain PELISSE added a comment - Ok, i should post my comment before the files sorry. Loic, I used your "trick" with success, but i didn't need to do Step 1 ( i didn't get what it was all about anyway). The two files i posted ( an Ant file and a maven.xml ) allow to easily integrate this "process" in your maven 1 build ( to be sure not to forget to update the checks ). Hope it'll help some of you, while this issue is open...

People

  • Assignee:
    Unassigned
    Reporter:
    Loïc
Vote (0)
Watch (1)

Dates

  • Created:
    Updated: