Do not run some Checkstyle rules in a specific Maven profile

2015-06-07 Thread WonderCsabo
We use a different profile for development, and a different profile for the
CI. The latter is more strict in the manner of Checkstyle rules. My question
is: how can i easily *turn off executing some of the rules in the
development profile*? One possible solution is just using `configLocation`
property in the `maven-checkstyle-plugin`, and adding the different configs
in two locations:

profile
idCI/id

build
plugins
plugin
artifactIdmaven-checkstyle-plugin/artifactId
configuration

configLocationci-checks.xml/configLocation
/configuration
/plugin
/plugins
/build
/profile

profile
iddevelopment/id

build
plugins
plugin
artifactIdmaven-checkstyle-plugin/artifactId
configuration

configLocationdev-checks.xml/configLocation
/configuration
/plugin
/plugins
/build
/profile

However this leads to the duplication of the check file. Is there a way to
dynamically skip parts of the file?

**Edit**: my motivation is that we run the Checkstyle rules when developing
in Eclipse, in the incremental compilation (every time when a file is saved)
and also when compiling from Maven command line. This is very convenient,
but there are some rules which take a [long time][1], and that makes this
kind of development impossible, so i want to turn them off.

Question copied from [here][2].


  [1]: http://github.com/checkstyle/checkstyle/issues/1064
  [2]:
http://stackoverflow.com/questions/30691673/do-not-run-some-checkstyle-rules-in-a-specific-maven-profile





--
View this message in context: 
http://maven.40175.n5.nabble.com/Do-not-run-some-Checkstyle-rules-in-a-specific-Maven-profile-tp5836995.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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



Re: Do not run some Checkstyle rules in a specific Maven profile

2015-06-07 Thread Christopher
I don't think that's possible currently. I have a similar use case
(which is also not possible): I want to use a provided xml
configuration file (Google Style), but with some project-specific
alterations. There's no way to merge these configurations. I'm sure
others have wanted to do the same (some basic additions to the
sun_checks.xml without rewriting it).

It would be nice if there was a way to have a given style, and with an
option, provide additions/removals. This option could be activated in
a profile, and would satisfy your use case as well as mine.

--
Christopher L Tubbs II
http://gravatar.com/ctubbsii


On Sun, Jun 7, 2015 at 9:41 AM, WonderCsabo kozakcs...@gmail.com wrote:
 We use a different profile for development, and a different profile for the
 CI. The latter is more strict in the manner of Checkstyle rules. My question
 is: how can i easily *turn off executing some of the rules in the
 development profile*? One possible solution is just using `configLocation`
 property in the `maven-checkstyle-plugin`, and adding the different configs
 in two locations:

 profile
 idCI/id

 build
 plugins
 plugin
 
 artifactIdmaven-checkstyle-plugin/artifactId
 configuration
 
 configLocationci-checks.xml/configLocation
 /configuration
 /plugin
 /plugins
 /build
 /profile

 profile
 iddevelopment/id

 build
 plugins
 plugin
 
 artifactIdmaven-checkstyle-plugin/artifactId
 configuration
 
 configLocationdev-checks.xml/configLocation
 /configuration
 /plugin
 /plugins
 /build
 /profile

 However this leads to the duplication of the check file. Is there a way to
 dynamically skip parts of the file?

 **Edit**: my motivation is that we run the Checkstyle rules when developing
 in Eclipse, in the incremental compilation (every time when a file is saved)
 and also when compiling from Maven command line. This is very convenient,
 but there are some rules which take a [long time][1], and that makes this
 kind of development impossible, so i want to turn them off.

 Question copied from [here][2].


   [1]: http://github.com/checkstyle/checkstyle/issues/1064
   [2]:
 http://stackoverflow.com/questions/30691673/do-not-run-some-checkstyle-rules-in-a-specific-maven-profile





 --
 View this message in context: 
 http://maven.40175.n5.nabble.com/Do-not-run-some-Checkstyle-rules-in-a-specific-Maven-profile-tp5836995.html
 Sent from the Maven - Users mailing list archive at Nabble.com.

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


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