Benjamin Hawkes-Lewis created MCHECKSTYLE-228:
-------------------------------------------------

             Summary: Default suppressions file lookup from a Checkstyle 
configuration in a shared artefact fails
                 Key: MCHECKSTYLE-228
                 URL: https://jira.codehaus.org/browse/MCHECKSTYLE-228
             Project: Maven Checkstyle Plugin
          Issue Type: Bug
            Reporter: Benjamin Hawkes-Lewis
            Priority: Minor


Checkstyle SuppressionFilter allows you to specify a default suppressions file:

http://checkstyle.sourceforge.net/config.html#SuppressionFilter

Checkstyle Maven plugin allows you to depend on artefacts, such as a shared 
artefact containing your Checkstyle configuration XML.

If you specify this configuration XML file in {{configLocation}}, it is found, 
but the default suppressions XML file referenced in turn is not looked up using 
the same classloader/classpath and subsequently is not found, resulting in 
error like:

{code}
[ERROR] Failed to execute goal 
org.apache.maven.plugins:maven-checkstyle-plugin:2.12.1:check (default-cli) on 
project checked-module: Failed during checkstyle configuration: cannot 
initialize module SuppressionFilter - Cannot set property 'file' in module 
SuppressionFilter to 'suppressions.xml': unable to find suppressions.xml: 
InvocationTargetException -> [Help 1]
{code}

See also discussion of this issue over in the Checkstyle project:

https://github.com/checkstyle/checkstyle/issues/62

I've attempted to create a minimal test case that demonstrates the problem over 
at:

https://github.com/benjaminhawkeslewis/maven-checkstyle-plugin-default-suppressions-lookup-bug

Backstory: The reason why I want to put a suppressions file inside my shared 
checkstyle configuration artefact is to allow projects using my shared 
configuration to (optionally) include a suppressions XML file specifying 
exemptions. I couldn't find a way to make this optional, without providing a 
default (blank) suppressions file.





--
This message was sent by Atlassian JIRA
(v6.1.6#6162)

Reply via email to