Maven 2.x Checkstyle Plugin

multimodule project requires src/main/java after 2.5 update

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.5
  • Fix Version/s: 2.6
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows 7
  • Number of attachments :
    2

Description

Updated to 2.5, it seems that src/main/java is now required.

[INFO] [checkstyle:check {execution: checkstyle}]
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] basedir D:\projects\multimoduleproject\src\main\java does not exist
[INFO] ------------------------------------------------------------------------
[INFO] Trace
java.lang.IllegalStateException: basedir D:\projects\multimoduleproject\src\main\java does not exist
at org.codehaus.plexus.util.DirectoryScanner.scan(DirectoryScanner.java:550)
at org.codehaus.plexus.util.FileUtils.getFileAndDirectoryNames(FileUtils.java:1717)
at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1645)
at org.codehaus.plexus.util.FileUtils.getFileNames(FileUtils.java:1627)
at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1601)
at org.codehaus.plexus.util.FileUtils.getFiles(FileUtils.java:1584)
at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getFilesToProcess(DefaultCheckstyleExecutor.java:407)
at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeCheckstyle(DefaultCheckstyleExecutor.java:89)
at org.apache.maven.plugin.checkstyle.CheckstyleViolationCheckMojo.execute(CheckstyleViolationCheckMojo.java:393)
at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)

Issue Links

Activity

Hide
Olivier Lamy added a comment -

Hi,
I have added an it with a multi modules project and I can't reproduce this.
Do you have a simple project to help to reproduce this issue ?
Thanks

Show
Olivier Lamy added a comment - Hi, I have added an it with a multi modules project and I can't reproduce this. Do you have a simple project to help to reproduce this issue ? Thanks
Hide
Dennis Kieselhorst added a comment -

Small testcase

Show
Dennis Kieselhorst added a comment - Small testcase
Hide
Olivier Lamy added a comment -

Thanks.
But I don't have the same exception with your testcase :

[INFO] Caused by: org.apache.maven.plugin.checkstyle.CheckstyleExecutorException
: Unable to find configuration file at location checkstyle-dekies.xml
[INFO]  at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfi
gFile(DefaultCheckstyleExecutor.java:466)
[INFO]  at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfi
guration(DefaultCheckstyleExecutor.java:238)
[INFO]  at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeC
heckstyle(DefaultCheckstyleExecutor.java:175)
[INFO]  at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Che
ckstyleReport.java:576)
[INFO]  ... 18 more
[INFO] Caused by: org.codehaus.plexus.resource.loader.ResourceNotFoundException:
 Could not find resource 'checkstyle-dekies.xml'.

This one looks reasonnable as the location is defined as this

<configLocation>checkstyle-dekies.xml</configLocation>

So the child can't find it (even with 2.4 version).
btw I have added your sample project in the sources as an it test.

Show
Olivier Lamy added a comment - Thanks. But I don't have the same exception with your testcase :
[INFO] Caused by: org.apache.maven.plugin.checkstyle.CheckstyleExecutorException
: Unable to find configuration file at location checkstyle-dekies.xml
[INFO]  at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfi
gFile(DefaultCheckstyleExecutor.java:466)
[INFO]  at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.getConfi
guration(DefaultCheckstyleExecutor.java:238)
[INFO]  at org.apache.maven.plugin.checkstyle.DefaultCheckstyleExecutor.executeC
heckstyle(DefaultCheckstyleExecutor.java:175)
[INFO]  at org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(Che
ckstyleReport.java:576)
[INFO]  ... 18 more
[INFO] Caused by: org.codehaus.plexus.resource.loader.ResourceNotFoundException:
 Could not find resource 'checkstyle-dekies.xml'.
This one looks reasonnable as the location is defined as this
<configLocation>checkstyle-dekies.xml</configLocation>
So the child can't find it (even with 2.4 version). btw I have added your sample project in the sources as an it test.
Hide
Dennis Kieselhorst added a comment -

Hmm...in my environment the sample works with 2.4 and produces the exception with 2.5.

Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200)
Java version: 1.6.0_17
Java home: D:\java\jdk1.6.0_17\jre
Default locale: de_DE, platform encoding: Cp1252
OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows"

I've removed the custom config from the sample.

Show
Dennis Kieselhorst added a comment - Hmm...in my environment the sample works with 2.4 and produces the exception with 2.5. Apache Maven 2.2.1 (r801777; 2009-08-06 21:16:01+0200) Java version: 1.6.0_17 Java home: D:\java\jdk1.6.0_17\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 7" version: "6.1" arch: "amd64" Family: "windows" I've removed the custom config from the sample.
Hide
Olivier Lamy added a comment -

ok my bad !
You are using checkstyle:check and not checkstyle:checkstyle

Show
Olivier Lamy added a comment - ok my bad ! You are using checkstyle:check and not checkstyle:checkstyle
Hide
Olivier Lamy added a comment -

fixed rev 911212

Show
Olivier Lamy added a comment - fixed rev 911212

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: