[
https://jira.codehaus.org/browse/MCHECKSTYLE-225?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=344684#comment-344684
]
Robert Scholte commented on MCHECKSTYLE-225:
--------------------------------------------
[~dennislundberg], the piece of code is a bit too small to see what's happening
here. The {{LicenseResourceManager}} has several ResourceLoader, such as jar,
file and this one. It will loop over these resourceLoaders until in has found
the resource. MCHECKSTYLE-219 shows that files from the maven-checkstyle-plugin
can leak. There's only one file which is allowed to be pulled from the plugin,
and that is the {{config/maven-header.txt}}. The next line after the
if-statement (but within the for-loop) tries to find the resource.
MCHECKSTYLE-225 shows there's another way to refer to a license, for which no
integration-test was written yet. This is an additional jar, which is added as
dependency so it ends up on the classpath. Right now there's a discussion about
immutable classpaths on the dev-list and this is a nice example. The
license-jar is just an additional jar and has nothing to do with the classpath
of the plugin. It could be any file, as long as the checkstyle-plugin knows how
to pick it up. We're working on a proposal for this, but it requires a
modification in the pom.xml.
For now we need to restore the ability to add a license by dependency, without
searching through the original dependencies of the plugin. I think I've found a
solution, but need to write some more tests to confirm that only the additional
jars are read.
> headerLocation no longer sets checkstyle.header.file
> ----------------------------------------------------
>
> Key: MCHECKSTYLE-225
> URL: https://jira.codehaus.org/browse/MCHECKSTYLE-225
> Project: Maven Checkstyle Plugin
> Issue Type: Bug
> Affects Versions: 2.12
> Environment: JDK 7u51 on OS X with Maven 3.1.0
> Reporter: Diwaker Gupta
> Assignee: Robert Scholte
>
> We use a multi-module configuration as described at
> https://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html
> This morning I tried upgraded to checkstyle-plugin 2.12 and our builds
> started failing with:
> {noformat}
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-checkstyle-plugin:2.12:check (default-cli) on
> project common: Failed during checkstyle execution: Failed during checkstyle
> configuration: unable to read /path/to/common/target/checkstyle-checker.xml -
> unable to parse configuration stream - Property ${checkstyle.header.file} has
> not been set -> [Help 1]
> {noformat}
> Our config hasn't changed in almost two years. We are currently using v2.11
> so this seems like a regression in 2.12
--
This message was sent by Atlassian JIRA
(v6.1.6#6162)