Skip to content
Permalink
Browse files
ACCUMULO-1641 Add checkstyle plugin for API check
  • Loading branch information
milleruntime committed Nov 1, 2017
1 parent 9059622 commit cb7804799c316d7e05b715ac5d9baabb9627dc05
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
@@ -19,7 +19,7 @@ main_class="$1"
main_args="${*:2}"

if command -v accumulo > /dev/null 2>&1 ; then
av_arg="-Daccumulo.version=`accumulo version`"
av_arg="-Daccumulo.version=`accumulo version | tail -n 1`"
fi

mvn -q exec:java -Dexec.mainClass="org.apache.accumulo.examples.$main_class" $av_arg -Dexec.args="$main_args"
@@ -0,0 +1,28 @@
<?xml version="1.0"?>
<!--
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://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.
-->
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration 1.3//EN" "http://www.puppycrawl.com/dtds/configuration_1_3.dtd">
<module name="Checker">
<property name="charset" value="UTF-8"/>
<module name="TreeWalker">
<module name="RegexpSinglelineJava">
<!--check that only Accumulo public APIs are imported-->
<property name="format" value="import\s+org\.apache\.accumulo\.(.*\.(impl|thrift|crypto)\..*|(?!core|minicluster|examples).*|core\.(?!client|data|security|cli|iterators).*)"/>
<property name="ignoreComments" value="true" />
<property name="message" value="Accumulo non-public classes imported" />
</module>
</module>
</module>

11 pom.xml
@@ -113,6 +113,17 @@
</execution>
</executions>
</plugin>
<plugin>
<!-- This was added to ensure project only uses public API. Run with the following:
mvn checkstyle:checkstyle
-->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<version>2.17</version>
<configuration>
<configLocation>checkstyle.xml</configLocation>
</configuration>
</plugin>
</plugins>
</build>

0 comments on commit cb78047

Please sign in to comment.