diff --git a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java index ce7f213d..82d84b82 100644 --- a/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java +++ b/src/main/java/org/apache/maven/plugins/checkstyle/exec/DefaultCheckstyleExecutor.java @@ -584,6 +584,20 @@ private Properties getOverridingProperties( CheckstyleExecutorRequest request ) } } + //${config_loc} for the origin dir of the configLocation, just like eclipsecs + // so we config such as `${config_loc}/checkstyle-suppressions.xml` + final String configLocation = request.getConfigLocation(); + final int idx = configLocation.lastIndexOf( '/' ); + final String configLoc; + if ( idx == -1 ) + { + configLoc = ""; + } + else + { + configLoc = configLocation.substring( 0, idx ); + } + p.setProperty( "config_loc", configLoc ); return p; }