You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Philipp Kraus <ph...@flashpixx.de> on 2015/02/13 21:28:00 UTC
Maven 3 with newest Checkstyle 6.3
Hello,
I'm using Maven 3.2.5 and I would like to use the Checkstyle plugin in the newest version (6.3).
The default installation is 5.8, so how can I add the 6.3 version of the plugin at my pom.xml and
use it on the check goal at the validate phase?
I don’t found the correct pom entries to do that.
Thanks a lot
Phil
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: Maven 3 with newest Checkstyle 6.3
Posted by Vincent Latombe <vi...@gmail.com>.
The configuration you did binds an execution to the validate phase. Calling
checkstyle:checkstyle won't pick up this configuration.
The error you get when calling mvn validate (or any later phase) is
because RedundantThrowsCheck
has been removed in Checkstyle 6.2 (according to Checkstyle release notes
http://checkstyle.sourceforge.net/releasenotes.html).
Vincent
2015-02-13 22:21 GMT+01:00 Philipp Kraus <ph...@flashpixx.de>:
>
> Thanks I have read these instructions, but check style uses the
> sun_checks.xml
> I have add to my build section:
>
> <pluginManagement>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-checkstyle-plugin</artifactId>
> <version>2.14</version>
> <dependencies>
> <dependency>
> <groupId>com.puppycrawl.tools</groupId>
> <artifactId>checkstyle</artifactId>
> <version>6.3</version>
> </dependency>
> </dependencies>
> </plugin>
> </plugins>
> </pluginManagement>
>
> <plugins>
> <plugin>
> <groupId>org.apache.maven.plugins</groupId>
> <artifactId>maven-checkstyle-plugin</artifactId>
> <version>2.14</version>
> <executions>
> <execution>
> <id>validate</id>
> <phase>validate</phase>
> <configuration>
>
> <configLocation>src/main/styleguide/style.xml</configLocation>
> <encoding>UTF-8</encoding>
> <consoleOutput>true</consoleOutput>
> <failsOnError>true</failsOnError>
> </configuration>
> <goals>
> <goal>check</goal>
> </goals>
> </execution>
> </executions>
> </plugin>
> </plugins>
>
> On running mvn check style:checkstyle I get:
>
> [WARNING] Unable to locate Source XRef to link to - DISABLED and it uses
> the sun_checks.xml
>
> On running mvn compile or package I get
>
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-checkstyle-plugin:2.14:check (validate) on
> project myProject: Failed during checkstyle configuration: cannot
> initialize module TreeWalker - Unable to instantiate RedundantThrows:
> Unable to instantiate RedundantThrowsCheck -> [Help 1]
>
> so it seems that it uses the old 5.4 version.
>
> How can I fix this?
> I’m not confirm with the correct syntax & semantic structure of the pom.xml
>
> Thanks
>
> Phil
>
>
>
> Am 13.02.2015 um 21:45 schrieb Vincent Latombe <vincent.latombe@gmail.com
> >:
>
> > Hi,
> >
> > apply
> >
> http://maven.apache.org/plugins/maven-checkstyle-plugin/usage.html#Checking_for_Violations_as_Part_of_the_Build
> >
> > and
> >
> http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html
> >
> > Vincent
> >
> > 2015-02-13 21:28 GMT+01:00 Philipp Kraus <ph...@flashpixx.de>:
> >
> >> Hello,
> >>
> >> I'm using Maven 3.2.5 and I would like to use the Checkstyle plugin in
> the
> >> newest version (6.3).
> >> The default installation is 5.8, so how can I add the 6.3 version of the
> >> plugin at my pom.xml and
> >> use it on the check goal at the validate phase?
> >>
> >> I don’t found the correct pom entries to do that.
> >>
> >> Thanks a lot
> >>
> >> Phil
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >> For additional commands, e-mail: users-help@maven.apache.org
> >>
> >>
>
>
Re: Maven 3 with newest Checkstyle 6.3
Posted by Philipp Kraus <ph...@flashpixx.de>.
Thanks I have read these instructions, but check style uses the sun_checks.xml
I have add to my build section:
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.14</version>
<dependencies>
<dependency>
<groupId>com.puppycrawl.tools</groupId>
<artifactId>checkstyle</artifactId>
<version>6.3</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.14</version>
<executions>
<execution>
<id>validate</id>
<phase>validate</phase>
<configuration>
<configLocation>src/main/styleguide/style.xml</configLocation>
<encoding>UTF-8</encoding>
<consoleOutput>true</consoleOutput>
<failsOnError>true</failsOnError>
</configuration>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
On running mvn check style:checkstyle I get:
[WARNING] Unable to locate Source XRef to link to - DISABLED and it uses the sun_checks.xml
On running mvn compile or package I get
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.14:check (validate) on project myProject: Failed during checkstyle configuration: cannot initialize module TreeWalker - Unable to instantiate RedundantThrows: Unable to instantiate RedundantThrowsCheck -> [Help 1]
so it seems that it uses the old 5.4 version.
How can I fix this?
I’m not confirm with the correct syntax & semantic structure of the pom.xml
Thanks
Phil
Am 13.02.2015 um 21:45 schrieb Vincent Latombe <vi...@gmail.com>:
> Hi,
>
> apply
> http://maven.apache.org/plugins/maven-checkstyle-plugin/usage.html#Checking_for_Violations_as_Part_of_the_Build
>
> and
> http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html
>
> Vincent
>
> 2015-02-13 21:28 GMT+01:00 Philipp Kraus <ph...@flashpixx.de>:
>
>> Hello,
>>
>> I'm using Maven 3.2.5 and I would like to use the Checkstyle plugin in the
>> newest version (6.3).
>> The default installation is 5.8, so how can I add the 6.3 version of the
>> plugin at my pom.xml and
>> use it on the check goal at the validate phase?
>>
>> I don’t found the correct pom entries to do that.
>>
>> Thanks a lot
>>
>> Phil
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
Re: Maven 3 with newest Checkstyle 6.3
Posted by Vincent Latombe <vi...@gmail.com>.
Hi,
apply
http://maven.apache.org/plugins/maven-checkstyle-plugin/usage.html#Checking_for_Violations_as_Part_of_the_Build
and
http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/upgrading-checkstyle.html
Vincent
2015-02-13 21:28 GMT+01:00 Philipp Kraus <ph...@flashpixx.de>:
> Hello,
>
> I'm using Maven 3.2.5 and I would like to use the Checkstyle plugin in the
> newest version (6.3).
> The default installation is 5.8, so how can I add the 6.3 version of the
> plugin at my pom.xml and
> use it on the check goal at the validate phase?
>
> I don’t found the correct pom entries to do that.
>
> Thanks a lot
>
> Phil
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>