jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Maven 2.x Checkstyle Plugin
  • MCHECKSTYLE-101

Skip should skip everything including the Velocity initialization

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 2.2
  • Fix Version/s: 2.3
  • Labels:
    None

Description

The "skip" configuration property prevents the check from happening, however, Velocity still gets initialized. For a small project, this takes the build time from 5 seconds without checkstyle in the pom to 13 seconds with it in and skip=true. While 8 seconds does not seem like much, it adds up over the course of days and weeks. Note that we have checkstyle hooked in at the verify/check phase/goal to cause the build to fail on a checkstyle violation during a typical developer's compilation they do all the time.

Build output with skip=true:

[INFO] Preparing checkstyle:check
[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.
[INFO] [checkstyle:checkstyle]
[INFO] [checkstyle:check {execution: default}]

See also MCHECKSTYLE-71.

Issue Links

relates to

Bug - A problem which impairs or prevents the functions of the product. MCHECKSTYLE-123 remove use of Serviceable (to be compatible wih maven 3.x)

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
nicolas de loof added a comment - 13/May/09 10:53 AM

As the Velocity context is created from a plexus @component VelocityComponent, we cannot check for skip parameter befor it get initialized.

Show
nicolas de loof added a comment - 13/May/09 10:53 AM As the Velocity context is created from a plexus @component VelocityComponent, we cannot check for skip parameter befor it get initialized.
Hide
Permalink
Steve Gilbert added a comment - 13/May/09 11:59 AM

Perhaps not using an annotation can be considered.

Show
Steve Gilbert added a comment - 13/May/09 11:59 AM Perhaps not using an annotation can be considered.
Hide
Permalink
nicolas de loof added a comment - 13/May/09 12:41 PM

we use a shared plexus component that is dependency-injected by plexus container.
What's wrong with this component beeing initialized ? only some undesirable logs ?

Show
nicolas de loof added a comment - 13/May/09 12:41 PM we use a shared plexus component that is dependency-injected by plexus container. What's wrong with this component beeing initialized ? only some undesirable logs ?
Hide
Permalink
Steve Gilbert added a comment - 13/May/09 12:56 PM

The logs are not the problem. It's time. The point of skipping checkstyle is to save individual developer build time. When Velocity initializes, it takes a lot of time, as much time as it does for checkstyle to do the checking. In our environment we have checkstyle hooked into the install goal so the time lost accumulates over many iterations and is significant.

Show
Steve Gilbert added a comment - 13/May/09 12:56 PM The logs are not the problem. It's time. The point of skipping checkstyle is to save individual developer build time. When Velocity initializes, it takes a lot of time, as much time as it does for checkstyle to do the checking. In our environment we have checkstyle hooked into the install goal so the time lost accumulates over many iterations and is significant.
Hide
Permalink
nicolas de loof added a comment - 14/May/09 4:47 AM

Using Serviceable & ServiceLocator can avoid pre-configuration of the VelocityComponent

Show
nicolas de loof added a comment - 14/May/09 4:47 AM Using Serviceable & ServiceLocator can avoid pre-configuration of the VelocityComponent
Hide
Permalink
nicolas de loof added a comment - 15/May/09 2:37 AM

Fixed in SVN

Show
nicolas de loof added a comment - 15/May/09 2:37 AM Fixed in SVN

People

  • Assignee:
    nicolas de loof
    Reporter:
    Steve Gilbert
Vote (0)
Watch (0)

Dates

  • Created:
    15/Aug/08 10:13 AM
    Updated:
    06/Sep/09 2:24 AM
    Resolved:
    15/May/09 2:37 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.