Repository: incubator-fluo Updated Branches: refs/heads/master edbad3460 -> 80833efa1
fixes #430 added checks to ensure log4j and logback are not used directly Project: http://git-wip-us.apache.org/repos/asf/incubator-fluo/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-fluo/commit/c0483959 Tree: http://git-wip-us.apache.org/repos/asf/incubator-fluo/tree/c0483959 Diff: http://git-wip-us.apache.org/repos/asf/incubator-fluo/diff/c0483959 Branch: refs/heads/master Commit: c0483959af72dc9905398dee40f51ca12d29eb99 Parents: c896fc1 Author: Keith Turner <ktur...@apache.org> Authored: Thu Dec 15 18:48:32 2016 -0500 Committer: Keith Turner <ktur...@apache.org> Committed: Fri Dec 16 12:39:31 2016 -0500 ---------------------------------------------------------------------- modules/api/pom.xml | 30 ++++++++++++++++++++++++++++++ modules/core/pom.xml | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-fluo/blob/c0483959/modules/api/pom.xml ---------------------------------------------------------------------- diff --git a/modules/api/pom.xml b/modules/api/pom.xml index 290967a..823eb5d 100644 --- a/modules/api/pom.xml +++ b/modules/api/pom.xml @@ -54,6 +54,36 @@ <build> <plugins> <plugin> + <!-- This configuration is merged with the checkstyle config in the parent pom. The + reason its here is because these logging checks are only needed for a subset of + child modules. Could not figure out a way to put the config in the parent pom + and only have some children use it. So this config is duplicated in the api and + core poms. If making changes, make them in both places. --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <executions> + <execution> + <id>logging-impl-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <checkstyleRules> + <module name="Checker"> + <module name="TreeWalker"> + <module name="IllegalImport"> + <!-- make sure no code imports logging implementations. Should only use slf4j --> + <property name="illegalPkgs" value="org.apache.log4j,ch.qos.logback" /> + </module> + </module> + </module> + </checkstyleRules> + <failOnViolation>true</failOnViolation> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>net.revelc.code</groupId> <artifactId>apilyzer-maven-plugin</artifactId> <version>1.0.1</version> http://git-wip-us.apache.org/repos/asf/incubator-fluo/blob/c0483959/modules/core/pom.xml ---------------------------------------------------------------------- diff --git a/modules/core/pom.xml b/modules/core/pom.xml index ec1526b..de20ac5 100644 --- a/modules/core/pom.xml +++ b/modules/core/pom.xml @@ -96,4 +96,38 @@ <scope>test</scope> </dependency> </dependencies> + <build> + <plugins> + <plugin> + <!-- This configuration is merged with the checkstyle config in the parent pom. The + reason its here is because these logging checks are only needed for a subset of + child modules. Could not figure out a way to put the config in the parent pom + and only have some children use it. So this config is duplicated in the api and + core poms. If making changes, make them in both places. --> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-checkstyle-plugin</artifactId> + <executions> + <execution> + <id>logging-impl-check</id> + <goals> + <goal>check</goal> + </goals> + <configuration> + <checkstyleRules> + <module name="Checker"> + <module name="TreeWalker"> + <module name="IllegalImport"> + <!-- make sure no code imports logging implementations. Should only use slf4j --> + <property name="illegalPkgs" value="org.apache.log4j,ch.qos.logback" /> + </module> + </module> + </module> + </checkstyleRules> + <failOnViolation>true</failOnViolation> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> </project>