[ http://jira.codehaus.org/browse/MCHECKSTYLE-59?page=comments#action_79119
]
Carsten Karkola commented on MCHECKSTYLE-59:
--------------------------------------------
Thank you for your hint, I tried the suggested solution. In the parent pom I
have:
<suppressionsLocation>de/mms_dresden/checkstyle/suppressions.xml</suppressionsLocation>
<headerLocation>de/mms_dresden/checkstyle/mms_header_regexp.txt</headerLocation>
On the console I get:
...
[INFO] Generate "Checkstyle" report.
[DEBUG] resolveLocation(de/mms_dresden/checkstyle/t_cruiting_checks.xml,
checkstyle-checker.xml)
[DEBUG] Location is not a URL.
[DEBUG] Location is not a File.
[DEBUG] Potential Resource:
jar:file:/D:/ckk/m2/de/telekom/mms-dresden/checkstyle/1.0/checkstyle-1.0.jar!/de/mms_dresden
/checkstyle/t_cruiting_checks.xml
[DEBUG] resolveLocation(null, checkstyle-checker.properties)
[DEBUG] resolveLocation(de/mms_dresden/checkstyle/mms_header_regexp.txt,
checkstyle-header.txt)
[DEBUG] Location is not a URL.
[DEBUG] Location is not a File.
[DEBUG] Potential Resource:
jar:file:/D:/ckk/m2/de/telekom/mms-dresden/checkstyle/1.0/checkstyle-1.0.jar!/de/mms_dresden
/checkstyle/mms_header_regexp.txt
[DEBUG] resolveLocation(null, checkstyle-packages.xml)
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error during page generation
Embedded error: Error rendering Maven report: Failed during checkstyle
configuration
Property ${checkstyle.suppressions.location} has not been set
[INFO] ------------------------------------------------------------------------
The header variable is resolved, but the suppresions variable not?
> Checkstyle Report fails if propertyExpansion contains file names
> ----------------------------------------------------------------
>
> Key: MCHECKSTYLE-59
> URL: http://jira.codehaus.org/browse/MCHECKSTYLE-59
> Project: Maven 2.x Checkstyle Plugin
> Issue Type: Bug
> Affects Versions: 2.1
> Environment: Windows XP, JDK 1.4, Maven 2.0.4
> Reporter: Carsten Karkola
> Assigned To: Joakim Erdfelt
>
> The chechkstyle plugin fails on windows plattforms, if the propertyExpansion
> element contains file names like
>
> mms.suppressions.file=${basedir}/../../project/resources/checkstyle/suppressions.xml
> The backslashes in ${basedir} (like D:\foo\bar) are missing (D:foobar) and
> checkstyle fails. It seems to be an issue with StringInputStream.
> I've replaced the following old code in CheckstyleReport.java
> if ( StringUtils.isNotEmpty( propertyExpansion ) )
> {
> p.load( new StringInputStream( propertyExpansion ) );
> }
> with the new Code
> if ( StringUtils.isNotEmpty( propertyExpansion ) ) {
> BufferedReader reader = new BufferedReader(new
> StringReader(propertyExpansion));
> String line = reader.readLine();
> while (line != null) {
> int delimPosition = line.indexOf('=');
> if (delimPosition > -1) {
> String name = line.substring(0, delimPosition).trim();
> delimPosition++;
> if (delimPosition < line.length()) {
> String value = line.substring(delimPosition).trim();
> if (value.length() > 0) {
> p.put(name, value);
> getLog().info("Property: " + name + " = " +
> p.getProperty(name));
> }
> }
> }
> line = reader.readLine();
> }
> reader.close();
> }
> and it works.
> Regards, carsten
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.codehaus.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira