Skip to content

Commit

Permalink
Change checkstyle to run on every sub project, so it will also run wh…
Browse files Browse the repository at this point in the history
…en you build an individual module
  • Loading branch information
spark404 committed Jan 9, 2014
1 parent 1b5f8e2 commit 7c8facf
Show file tree
Hide file tree
Showing 7 changed files with 94 additions and 39 deletions.
10 changes: 10 additions & 0 deletions awsapi/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,16 @@
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${cs.checkstyle.version}</version>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
Expand Down
22 changes: 22 additions & 0 deletions deps/XenServerJava/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,26 @@
<version>${cs.xmlrpc.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${cs.checkstyle.version}</version>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>checkstyle</artifactId>
<!-- this project.version differs -->
<version>${project.parent.version}</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
28 changes: 0 additions & 28 deletions plugins/network-elements/opendaylight/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -47,34 +47,6 @@
</testResource>
</testResources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<executions>
<execution>
<phase>process-classes</phase>
<goals>
<goal>check</goal>
</goals>
</execution>
</executions>
<configuration>
<failsOnError>true</failsOnError>
<configLocation>tooling/checkstyle.xml</configLocation>
<consoleOutput>true</consoleOutput>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<sourceDirectory>${project.basedir}</sourceDirectory>
<includes>**\/*.java,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat</includes>
<excludes>**\/target\/,**\/bin\/</excludes>
</configuration>
</plugin>
<plugin>
<groupId>com.mycila.maven-license-plugin</groupId>
<artifactId>maven-license-plugin</artifactId>
Expand Down
28 changes: 18 additions & 10 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@
</organization>

<modules>
<module>tools/checkstyle</module>
<module>api</module>
<module>agent</module>
<module>core</module>
Expand Down Expand Up @@ -447,7 +448,22 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<inherited>false</inherited>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${cs.checkstyle.version}</version>
<dependencies>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>checkstyle</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>

<executions>
<execution>
<phase>validate</phase>
Expand All @@ -458,22 +474,14 @@
</executions>
<configuration>
<failsOnError>true</failsOnError>
<configLocation>${project.basedir}/tools/checkstyle/cloud-style.xml</configLocation>
<configLocation>cloud-style.xml</configLocation>
<consoleOutput>true</consoleOutput>
<includeTestSourceDirectory>true</includeTestSourceDirectory>
<sourceDirectory>${project.basedir}</sourceDirectory>
<includes>**\/*.java</includes>
<excludes>**\/deps\/,**\/test\/,**\/target\/,**\/bin\/,**\/*.xml,**\/*.ini,**\/*.sh,**\/*.bat,**\/awsapi\/,**\/XenServerJava\/,**\/apidoc\/</excludes>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>${cs.checkstyle.version}</version>
</plugin>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<configuration>
Expand Down
2 changes: 1 addition & 1 deletion server/test/com/cloud/vpc/MockNetworkManagerImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import javax.inject.Inject;
import javax.naming.ConfigurationException;

import org.apache.cloudstack.acl.ControlledEntity;
import org.apache.log4j.Logger;
import org.springframework.stereotype.Component;

import org.apache.cloudstack.acl.ControlledEntity.ACLType;
import org.apache.cloudstack.api.command.admin.network.DedicateGuestVlanRangeCmd;
import org.apache.cloudstack.api.command.admin.network.ListDedicatedGuestVlanRangesCmd;
Expand Down
43 changes: 43 additions & 0 deletions tools/checkstyle/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http:https://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
<project xmlns="http:https://maven.apache.org/POM/4.0.0" xmlns:xsi="http:https://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http:https://maven.apache.org/POM/4.0.0 http:https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<name>Apache CloudStack Developer Tools - Checkstyle Configuration</name>
<groupId>org.apache.cloudstack</groupId>
<artifactId>checkstyle</artifactId>
<version>4.4.0-SNAPSHOT</version>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.11</version>
<executions>
<execution>
<phase>none</phase>
</execution>
</executions>
</plugin>
</plugins>
</build>

</project>
File renamed without changes.

0 comments on commit 7c8facf

Please sign in to comment.