If your checkstyle file isn't in your source tree, you can set your checkstyle
config like that :
http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html
Emmanuel
Adrian Herscu a écrit :
This happens whenever the maven-checkstyle-plugin does not find the
specified configuration file.
Adrian.
Ziv Ben-Eliahu wrote:
Short description of the problem
*********************************
When running "mvn release:perform", "Checkstyle" report plugin fails on:
[WARNING] Unable to load parent project from repository: Could not
find the model file
'D:\projectParent\projectA\target\checkout\..\pom.xml'.
[INFO] Skipped "Maven Surefire Report" report, file
"surefire-report.html" already exists f
[INFO] Generate "Checkstyle" report.
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] String index out of range: -1
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.StringIndexOutOfBoundsException: String index out of
range: -1
at java.lang.String.substring(String.java:1768)
at
org.codehaus.classworlds.UrlUtils.normalizeUrlPath(UrlUtils.java:28)
at
org.codehaus.classworlds.DefaultClassRealm.getResource(DefaultClassRealm.java:284)
at
org.codehaus.classworlds.RealmClassLoader.getResource(RealmClassLoader.java:237)
at
org.apache.maven.plugin.checkstyle.Locator.resolveLocation(Locator.java:117)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.getConfigFile(CheckstyleReport.j
Long description of the problem
*********************************
The project structure looks like this:
Parent-1.0-alpha-4
+A-1.0-alpha-3-SNAPSHOT
The parent hold checkstyle configuration.
Project A-1.0-alpha-3-SNAPSHOT have these in the pom.xml:
<reporting>
<plugins>
<plugin>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>${basedir}/../src/config/checkstyle/my-checks.xml</configLocation>
</configuration>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-surefire-report-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>jdepend-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.0</version>
</plugin>
</plugins>
</reporting>
In project A-1.0-alpha-3-SNAPSHOT (under the parent) I do the
following with Maven2:
> mvn site
SUCCESS and give complete report
> mvn release:clean release:prepare
SUCCESS
> mvn release:perform
BUILD ERROR
cause: as specified above, in the short description.
A possible meaning of the cause - it tried to get to the parent
pom.xml. But since it is under target\checkout the parent is not one
directory up.
When I removed the configuration line:
<configLocation>${basedir}/../src/config/checkstyle/my-checks.xml</configLocation>
and did a new release:preform, the checkstyle still had the same
problem but it continued to SUCCESS by using a default checkstyle
settings instead of my settings. The message was:
[WARNING] Unable to load parent project from repository: Could not
find the model file
'D:\projectParent\projectA\target\checkout\..\pom.xml'.
[INFO] Skipped "Maven Surefire Report" report, file
"surefire-report.html" already exists for the English version.
[INFO] Generate "Checkstyle" report.
[INFO] There are 511 checkstyle errors.
[WARNING] Unable to locate Source XRef to link to - DISABLED
[ERROR] VM #displayTree: error : too few arguments to macro.
Wanted 2 got 0
[ERROR] VM #menuItem: error : too few arguments to macro. Wanted 1
got 0
[INFO] Generate "JavaDocs" report.
Does someone have an idea why this is happening?
Thanks, Ziv.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]