Hello.
I've been trying to get a custom check installed and can't get it run.
I've followed the directions from the maven site almost to the letter
but it keeps failing on the packagenames.xml. If I take my custom check
out of the checkstyle.xml it still fails but on another check. It seems
to find the file packagenames.xml but not load it. CLI output and files
are below. Any help would be greatly appreciated.
Thanks
maven output:
[EMAIL PROTECTED]> mvn -e -X checkstyle:checkstyle
+ Error stacktraces are turned on.
Maven version: 2.0.7
Java version: 1.6.0-dp
OS name: "mac os x" version: "10.4.10" arch: "ppc"
[DEBUG] Building Maven user-level plugin registry from:
'/Users/michaelfortin/.m2/plugin-registry.xml'
[DEBUG] Building Maven global-level plugin registry from:
'/java/maven/conf/plugin-registry.xml'
[INFO] Scanning for projects...
[DEBUG] Searching for parent-POM: com.monetizeit:monetizeit::1.0-a1 of
project: com.monetizeit:foundation:ejb:3.0-a1 in relative path: ../pom.xml
[DEBUG] Using parent-POM from the project hierarchy at: '../pom.xml'
for project: com.monetizeit:foundation:ejb:3.0-a1
[INFO] Searching repository for plugin with prefix: 'checkstyle'.
[DEBUG] Loading plugin prefixes from group: org.apache.maven.plugins
[DEBUG] Loading plugin prefixes from group: org.codehaus.mojo
[DEBUG] maven-checkstyle-plugin: resolved to version 2.1 from
repository central
[DEBUG] Retrieving parent-POM: org.apache.maven.plugins:maven-plugins::1
for project: null:maven-checkstyle-plugin:maven-plugin:2.1
from the repository.
[DEBUG] Retrieving parent-POM: org.apache.maven:maven-parent::1 for
project: org.apache.maven.plugins:maven-plugins:pom:1 from the repository.
[DEBUG] Retrieving parent-POM: org.apache:apache::1 for project:
org.apache.maven:maven-parent:pom:1 from the repository.
[DEBUG] Initialising extension: com.monetizeit:checkstyle
[INFO] snapshot com.monetizeit:checkstyle:1.0-SNAPSHOT: checking for
updates from spring
[DEBUG] repository metadata for: 'snapshot
com.monetizeit:checkstyle:1.0-SNAPSHOT' could not be found on repository: spring
[INFO] snapshot com.monetizeit:checkstyle:1.0-SNAPSHOT: checking for
updates from apache-snapshots
[DEBUG] repository metadata for: 'snapshot
com.monetizeit:checkstyle:1.0-SNAPSHOT' could not be found on repository: apache-snapshots
[INFO] snapshot com.monetizeit:checkstyle:1.0-SNAPSHOT: checking for
updates from central
[DEBUG] repository metadata for: 'snapshot
com.monetizeit:checkstyle:1.0-SNAPSHOT' could not be found on repository: central
[DEBUG] checkstyle: using locally installed snapshot
[DEBUG] com.monetizeit:foundation:ejb:3.0-a1 (selected for null)
[DEBUG] checkstyle:checkstyle:jar:4.3:runtime (selected for runtime)
[DEBUG] antlr:antlr:jar:2.7.6:runtime (selected for runtime)
[DEBUG]
commons-beanutils:commons-beanutils-core:jar:1.7.0:runtime (selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0:runtime
(selected for runtime)
[DEBUG] commons-collections:commons-collections:jar:2.0:runtime
(selected for runtime)
[DEBUG] commons-cli:commons-cli:jar:1.0:runtime (selected for runtime)
[DEBUG] commons-lang:commons-lang:jar:1.0:runtime (selected for
runtime)
[DEBUG] junit:junit:jar:3.7:runtime (selected for runtime)
[DEBUG] commons-collections:commons-collections:jar:2.0:runtime
(removed - nearer found: 2.1)
[DEBUG] commons-collections:commons-collections:jar:2.1:runtime
(selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0:runtime (removed
- nearer found: 1.0.3)
[DEBUG] commons-logging:commons-logging:jar:1.0.3:runtime
(selected for runtime)
[DEBUG] com.monetizeit:checkstyle:jar:1.0-SNAPSHOT:runtime
(selected for runtime)
[DEBUG] Retrieving parent-POM: org.codehaus.plexus:plexus::1.0.4 for
project: null:plexus-utils:jar:1.1 from the repository.
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime (selected
for runtime)
[DEBUG] checkstyle: using locally installed snapshot
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/checkstyle/checkstyle/4.3/checkstyle-4.3.jar
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/com/monetizeit/checkstyle/1.0-SNAPSHOT/checkstyle-1.0-SNAPSHOT.jar
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/commons-collections/commons-collections/2.1/commons-collections-2.1.jar
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[DEBUG] Adding to extension classpath:
/Users/michaelfortin/.m2/repository/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar
-----------------------------------------------------
this realm = app0.child-container[extensions]
urls[0] =
file:/Users/michaelfortin/.m2/repository/checkstyle/checkstyle/4.3/checkstyle-4.3.jar
urls[1] =
file:/Users/michaelfortin/.m2/repository/commons-logging/commons-logging/1.0.3/commons-logging-1.0.3.jar
urls[2] =
file:/Users/michaelfortin/.m2/repository/com/monetizeit/checkstyle/1.0-SNAPSHOT/checkstyle-1.0-SNAPSHOT.jar
urls[3] =
file:/Users/michaelfortin/.m2/repository/commons-collections/commons-collections/2.1/commons-collections-2.1.jar
urls[4] =
file:/Users/michaelfortin/.m2/repository/antlr/antlr/2.7.6/antlr-2.7.6.jar
urls[5] =
file:/Users/michaelfortin/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
urls[6] =
file:/Users/michaelfortin/.m2/repository/commons-beanutils/commons-beanutils-core/1.7.0/commons-beanutils-core-1.7.0.jar
Number of imports: 0
this realm = plexus.core
urls[0] = file:/java/maven/lib/maven-core-2.0.7-uber.jar
Number of imports: 0
-----------------------------------------------------
[INFO]
----------------------------------------------------------------------------
[INFO] Building Foundation
[INFO] task-segment: [checkstyle:checkstyle]
[INFO]
----------------------------------------------------------------------------
[DEBUG]
org.apache.maven.plugins:maven-checkstyle-plugin:maven-plugin:2.1:runtime (selected for runtime)
[DEBUG] Retrieving parent-POM:
org.apache.maven.reporting:maven-reporting::2.0 for project:
null:maven-reporting-impl:jar:2.0 from the repository.
[DEBUG] Retrieving parent-POM: org.apache.maven:maven::2.0 for project:
org.apache.maven.reporting:maven-reporting:pom:2.0 from the repository.
[DEBUG] Adding managed dependencies for unknown:maven-reporting-impl
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG]
org.apache.maven.reporting:maven-reporting-impl:jar:2.0:runtime (selected for runtime)
[DEBUG] Adding managed dependencies for unknown:maven-project
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG] org.apache.maven:maven-project:jar:2.0:runtime (selected
for runtime)
[DEBUG] Adding managed dependencies for unknown:maven-profile
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG] org.apache.maven:maven-profile:jar:2.0:runtime
(selected for runtime)
[DEBUG] Adding managed dependencies for org.apache.maven:maven-model
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG] org.apache.maven:maven-model:jar:2.0:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(selected for runtime)
[DEBUG]
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime (selected for runtime)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-model:jar:2.0:runtime (selected
for runtime)
[DEBUG] Adding managed dependencies for
org.apache.maven:maven-artifact-manager
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG] org.apache.maven:maven-artifact-manager:jar:2.0:runtime
(selected for runtime)
[DEBUG] Adding managed dependencies for
org.apache.maven:maven-repository-metadata
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG]
org.apache.maven:maven-repository-metadata:jar:2.0:runtime (selected for runtime)
[DEBUG] Adding managed dependencies for org.apache.maven:maven-artifact
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG] org.apache.maven:maven-artifact:jar:2.0:runtime
(selected for runtime)
[DEBUG]
org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5:runtime (selected for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-artifact:jar:2.0:runtime
(selected for runtime)
[DEBUG]
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime (selected for runtime)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG] commons-validator:commons-validator:jar:1.1.4:runtime
(selected for runtime)
[DEBUG] Adding managed dependencies for org.apache.maven:maven-plugin-api
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0:runtime
(selected for runtime)
[DEBUG] oro:oro:jar:2.0.7:runtime (selected for runtime)
[DEBUG] Adding managed dependencies for unknown:maven-reporting-api
[DEBUG] org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4
[DEBUG] org.apache.maven.wagon:wagon-provider-api:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-ssh:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-file:jar:1.0-alpha-5
[DEBUG] org.apache.maven.wagon:wagon-http-lightweight:jar:1.0-alpha-5
[DEBUG]
org.apache.maven.reporting:maven-reporting-api:jar:2.0:runtime (selected for runtime)
[DEBUG] doxia:doxia-sink-api:jar:1.0-alpha-4:runtime (selected
for runtime)
[DEBUG] doxia:doxia-core:jar:1.0-alpha-4:runtime (selected for runtime)
[DEBUG] checkstyle:checkstyle-optional:jar:4.1:runtime (selected
for runtime)
[DEBUG] checkstyle:checkstyle:jar:4.1:runtime (selected for runtime)
[DEBUG] antlr:antlr:jar:2.7.2:runtime (selected for runtime)
[DEBUG]
commons-beanutils:commons-beanutils-core:jar:1.7.0:runtime (selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0:runtime
(selected for runtime)
[DEBUG]
commons-collections:commons-collections:jar:2.0:runtime (selected for runtime)
[DEBUG] commons-collections:commons-collections:jar:2.0:runtime
(removed - nearer found: 2.1)
[DEBUG] commons-collections:commons-collections:jar:2.1:runtime
(selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0:runtime
(removed - nearer found: 1.0.3)
[DEBUG] commons-logging:commons-logging:jar:1.0.3:runtime
(selected for runtime)
[DEBUG] checkstyle:checkstyle:jar:4.1:runtime (selected for runtime)
[DEBUG] antlr:antlr:jar:2.7.2:runtime (selected for runtime)
[DEBUG]
commons-beanutils:commons-beanutils-core:jar:1.7.0:runtime (selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0:runtime
(selected for runtime)
[DEBUG] commons-collections:commons-collections:jar:2.0:runtime
(selected for runtime)
[DEBUG] commons-collections:commons-collections:jar:2.0:runtime
(removed - nearer found: 2.1)
[DEBUG] commons-collections:commons-collections:jar:2.1:runtime
(selected for runtime)
[DEBUG] commons-logging:commons-logging:jar:1.0:runtime (removed
- nearer found: 1.0.3)
[DEBUG] commons-logging:commons-logging:jar:1.0.3:runtime
(selected for runtime)
[DEBUG] org.apache.maven:maven-plugin-api:jar:2.0:runtime (selected
for runtime)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.0.4:runtime (removed
- nearer found: 1.1)
[DEBUG] org.codehaus.plexus:plexus-utils:jar:1.1:runtime (selected
for runtime)
[DEBUG] org.codehaus.plexus:plexus-velocity:jar:1.1.2:runtime
(selected for runtime)
[DEBUG] Retrieving parent-POM: plexus:plexus-containers::1.0.2 for
project: org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-7
from the repository.
[DEBUG] Retrieving parent-POM: plexus:plexus-root::1.0.3 for project:
plexus:plexus-containers:pom:1.0.2 from the repository.
[DEBUG]
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-8:runtime (removed - nearer found: 1.0-alpha-7)
[DEBUG]
org.codehaus.plexus:plexus-container-default:jar:1.0-alpha-7:runtime (selected for runtime)
[DEBUG] junit:junit:jar:3.8.1:runtime (selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime
(selected for runtime)
[DEBUG] classworlds:classworlds:jar:1.1-alpha-2:runtime (selected
for runtime)
[DEBUG] commons-collections:commons-collections:jar:2.0:runtime
(removed - nearer found: 2.1)
[DEBUG] commons-logging:commons-logging-api:jar:1.0.4:runtime
(selected for runtime)
[DEBUG] velocity:velocity:jar:1.4:runtime (selected for runtime)
[DEBUG] velocity:velocity-dep:jar:1.4:runtime (selected for runtime)
[INFO] Setting property: classpath.resource.loader.class =>
'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] **************************************************************
[INFO] Starting Jakarta Velocity v1.4
[INFO] RuntimeInstance initializing.
[INFO] Default Properties File:
org/apache/velocity/runtime/defaults/velocity.properties
[INFO] Default ResourceManager initializing. (class
org.apache.velocity.runtime.resource.ResourceManagerImpl)
[INFO] Resource Loader Instantiated:
org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader
[INFO] ClasspathResourceLoader : initialization starting.
[INFO] ClasspathResourceLoader : initialization complete.
[INFO] ResourceCache : initialized. (class
org.apache.velocity.runtime.resource.ResourceCacheImpl)
[INFO] Default ResourceManager initialization complete.
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Literal
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Macro
[INFO] Loaded System Directive: org.apache.velocity.runtime.directive.Parse
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Include
[INFO] Loaded System Directive:
org.apache.velocity.runtime.directive.Foreach
[INFO] Created: 20 parsers.
[INFO] Velocimacro : initialization starting.
[INFO] Velocimacro : adding VMs from VM library template :
VM_global_library.vm
[ERROR] ResourceManager : unable to find resource
'VM_global_library.vm' in any resource loader.
[INFO] Velocimacro : error using VM library template
VM_global_library.vm :
org.apache.velocity.exception.ResourceNotFoundException: Unable to
find resource 'VM_global_library.vm'
[INFO] Velocimacro : VM library template macro registration complete.
[INFO] Velocimacro : allowInline = true : VMs can be defined inline
in templates
[INFO] Velocimacro : allowInlineToOverride = false : VMs defined
inline may NOT replace previous VM definitions
[INFO] Velocimacro : allowInlineLocal = false : VMs defined inline
will be global in scope if allowed.
[INFO] Velocimacro : initialization complete.
[INFO] Velocity successfully started.
[DEBUG] Configuring mojo
'org.apache.maven.plugins:maven-checkstyle-plugin:2.1:checkstyle' -->
[DEBUG] (f) cacheFile =
/Users/michaelfortin/Projects/omp/monetizeit/foundation/target/checkstyle-cachefile
[DEBUG] (f) configLocation = src/main/config/checkstyle.xml
[DEBUG] (f) consoleOutput = false
[DEBUG] (f) enableFilesSummary = true
[DEBUG] (f) enableRSS = true
[DEBUG] (f) enableRulesSummary = true
[DEBUG] (f) enableSeveritySummary = true
[DEBUG] (f) failsOnError = false
[DEBUG] (f) format = sun
[DEBUG] (f) headerFile =
/Users/michaelfortin/Projects/omp/monetizeit/foundation/LICENSE.txt
[DEBUG] (f) headerLocation = LICENSE.txt
[DEBUG] (f) includes = **/*.java
[DEBUG] (f) linkXRef = true
[DEBUG] (f) outputDirectory =
/Users/michaelfortin/Projects/omp/monetizeit/foundation/target/site
[DEBUG] (f) outputFile =
/Users/michaelfortin/Projects/omp/monetizeit/foundation/target/checkstyle-result.xml
[DEBUG] (f) outputFileFormat = xml
[DEBUG] (f) packageNamesLocation =
src/main/config/checkstyle-packages.xml
[DEBUG] (f) project = [EMAIL PROTECTED]
[DEBUG] (f) sourceDirectory =
/Users/michaelfortin/Projects/omp/monetizeit/foundation/src/main/java
[DEBUG] (f) xrefLocation =
/Users/michaelfortin/Projects/omp/monetizeit/foundation/target/site/xref
[DEBUG] -- end configuration --
[INFO] [checkstyle:checkstyle]
[DEBUG] resolveLocation(src/main/config/checkstyle.xml,
checkstyle-checker.xml)
[DEBUG] Location is not a URL.
[DEBUG] Potential File:
/Users/michaelfortin/Projects/omp/monetizeit/foundation/src/main/config/checkstyle.xml
[DEBUG] resolveLocation(null, checkstyle-checker.properties)
[DEBUG] resolveLocation(LICENSE.txt, checkstyle-header.txt)
[DEBUG] Location is not a URL.
[DEBUG] Location is not a File.
[DEBUG] Potential Resource:
jar:file:/java/maven/lib/maven-core-2.0.7-uber.jar!/LICENSE.txt
[DEBUG] resolveLocation(src/main/config/checkstyle-packages.xml,
checkstyle-packages.xml)
[DEBUG] Location is not a URL.
[DEBUG] Potential File:
/Users/michaelfortin/Projects/omp/monetizeit/foundation/src/main/config/checkstyle-packages.xml
[DEBUG] resolveLocation(null, checkstyle-suppressions.xml)
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] An error has occurred in Checkstyle report generation.
Embedded error: Failed during checkstyle configuration
Unable to instantiate com.monetizeit.checkstyle.BlanklineCheckCheck
[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: An error has
occurred in Checkstyle report generation.
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:564)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
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:589)
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)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error
has occurred in Checkstyle report generation.
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:79)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:539)
... 16 more
Caused by: org.apache.maven.reporting.MavenReportException: Failed
during checkstyle configuration
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:488)
at
org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:98)
at
org.apache.maven.reporting.AbstractMavenReport.execute(AbstractMavenReport.java:73)
... 18 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
cannot initialize module TreeWalker - Unable to instantiate
com.monetizeit.checkstyle.BlanklineCheck
at
com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:165)
at
com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:209)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeCheckstyle(CheckstyleReport.java:723)
at
org.apache.maven.plugin.checkstyle.CheckstyleReport.executeReport(CheckstyleReport.java:484)
... 20 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
Unable to instantiate com.monetizeit.checkstyle.BlanklineCheck
at
com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:152)
at
com.puppycrawl.tools.checkstyle.TreeWalker.setupChild(TreeWalker.java:213)
at
com.puppycrawl.tools.checkstyle.api.AutomaticBean.configure(AutomaticBean.java:209)
at
com.puppycrawl.tools.checkstyle.Checker.setupChild(Checker.java:144)
... 23 more
Caused by: com.puppycrawl.tools.checkstyle.api.CheckstyleException:
Unable to instantiate com.monetizeit.checkstyle.BlanklineCheckCheck
at
com.puppycrawl.tools.checkstyle.PackageObjectFactory.doMakeObject(PackageObjectFactory.java:94)
at
com.puppycrawl.tools.checkstyle.PackageObjectFactory.createModule(PackageObjectFactory.java:149)
... 26 more
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 33 seconds
[INFO] Finished at: Sat Sep 08 10:06:30 EDT 2007
[INFO] Final Memory: 6M/12M
[INFO]
------------------------------------------------------------------------
maven file:
...
<build>
<extensions>
<extension>
<groupId>com.monetizeit</groupId>
<artifactId>checkstyle</artifactId>
<version>1.0-SNAPSHOT</version>
</extension>
</extensions>
...
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
<configuration>
<configLocation>src/main/config/checkstyle.xml</configLocation>
<packageNamesLocation>src/main/config/checkstyle-packages.xml</packageNamesLocation>
</configuration>
</plugin>
</plugins>
</reporting>
...
checkstyle.xml:
<?xml version="1.0" ?>
<!DOCTYPE module PUBLIC "-//Puppy Crawl//DTD Check Configuration
1.2//EN" "http://www.puppycrawl.com/dtds/configuration_1_2.dtd">
<module name="Checker">
<module name="NewlineAtEndOfFile" />
<module name="Translation" />
<module name="TreeWalker">
<property name="cacheFile" value="${checkstyle.cache.file}" />
<module name="com.monetizeit.checkstyle.BlanklineCheck" />
<module name="JavadocType" />
...
<module name="UpperEll" />
</module>
</module>
checkstyle-packages.xml
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE checkstyle-packages PUBLIC
"-//Puppy Crawl//DTD Package Names 1.0//EN"
"http://www.puppycrawl.com/dtds/packages_1_0.dtd">
<checkstyle-packages>
<package name="com.monetizeit" >
<package name="checkstyle"/>
</package>
<package name="com.puppycrawl.tools.checkstyle">
<package name="checks">
<package name="blocks"/>
<package name="coding"/>
<package name="design"/>
<package name="duplicates"/>
<package name="header"/>
<package name="imports"/>
<package name="indentation"/>
<package name="javadoc"/>
<package name="metrics"/>
<package name="modifier"/>
<package name="naming"/>
<package name="sizes"/>
<package name="whitespace"/>
</package>
<package name="filters"/>
</package>
</checkstyle-packages>
BlankLineCheck.class
package com.monetizeit.checkstyle;
import com.puppycrawl.tools.checkstyle.api.*;
/**
*
* @author Michael Fortin
* @version $Id$
*/
public class BlanklineCheck extends Check
{
private static final int[] ints = new int[]{
TokenTypes.LITERAL_CASE,
TokenTypes.LITERAL_CONTINUE,
TokenTypes.LITERAL_DO,
TokenTypes.LITERAL_FOR,
TokenTypes.LITERAL_IF,
TokenTypes.LITERAL_RETURN,
TokenTypes.LITERAL_SWITCH,
TokenTypes.LITERAL_TRY,
TokenTypes.LITERAL_WHILE
};
public int[] getDefaultTokens()
{
return ints;
}
@Override
public int[] getRequiredTokens()
{
return getDefaultTokens();
}
@Override
public void visitToken(DetailAST ast)
{
switch (ast.getType()) {
case TokenTypes.LITERAL_CASE:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_CONTINUE:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_DO:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_FOR:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_IF:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_RETURN:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_SWITCH:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_TRY:
startsLine(ast);
blankLineRequired(ast);
break;
case TokenTypes.LITERAL_WHILE:
startsLine(ast);
blankLineOptional(ast);
break;
}
log(ast.getLineNo(),ast.getText());
}
void startsLine(DetailAST ast) {
int line = ast.getLineNo();
DetailAST previous = ast.getPreviousSibling();
int previousLine = previous.getLineNo();
if(line == previousLine)
log(line,"Must start the line");
}
void blankLineRequired(DetailAST ast) {
int line = ast.getLineNo();
DetailAST previous = ast.getPreviousSibling();
int previousLine = previous.getLineNo();
if(line == previousLine)
log(line,"Must be preceded by a blank line");
}
void blankLineOptional(DetailAST ast) {
int line = ast.getLineNo();
DetailAST previous = ast.getPreviousSibling();
int previousLine = previous.getLineNo();
if(line == previousLine)
log(line,"Must be preceded by a blank line or curly brace");
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]