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 and 3.x Site Plugin
  • MSITE-60

Report Classloaders out of sync when executed from within the site:site goal.

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Won't Fix
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None

Description

When testing the classloaders from within a mojo and a report the following is discovered.

    1. Direct Mojo execution from command line.

mvn -e dummy:dump
Thread.currentThread().getContextClassLoader() = RealmDelegatingClassLoader for dummy:dump.
this.getClass().getClassLoader() = RealmClassLoader for dummy:dump.

    1. Report execution via site:site

mvn -e site:site
Thread.currentThread().getContextClassLoader() = RealmDelegatingClassLoader for site:site.
this.getClass().getClassLoader() = RealmClassLoader for dummy:report.

When a report is executing, relying on the Thread.currentThread().getContextClassLoader() to obtain resources out of jar files (for example) will fail.

This discovery was as a result of debugging MCHECKSTYLE-10

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. File
    dummy-maven-plugin.tar.bz2
    28/Dec/05 2:23 PM
    2 kB
    Joakim Erdfelt
  2. Text File
    MNG-1901.patch
    28/Dec/05 5:03 PM
    1.0 kB
    Joakim Erdfelt

Issue Links

is depended upon by

Bug - A problem which impairs or prevents the functions of the product. MCHECKSTYLE-10 Exception when creating Checkstyle report as part of a 'site' build

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is related to

Bug - A problem which impairs or prevents the functions of the product. MNG-1898 Plugin classpath broken from 2.0 to 2.0.1

  • Blocker - Blocks development and/or testing work, production could not run
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
relates to

Bug - A problem which impairs or prevents the functions of the product. MNG-2795 Classloader problem loading a resource from a build extension Jar : difference between 2.0.4 and (future) 2.0.5

  • Major - Major loss of function.
  • 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
Joakim Erdfelt added a comment - 28/Dec/05 2:29 PM

The classloader differences from within a Report vs a Mojo makes it difficult to find resources that are needed by the checkstyle plugin.

Either the Thread.currentThread().getContextClassLoader() should be the one for the specific report, or there should be a gotcha for report developers to use this.getClass().getClassLoader() instead.

But that kind of limitation could pose problems for classloader issues in non-reports, such as checkstyle internals, or commons-logging internals.

Show
Joakim Erdfelt added a comment - 28/Dec/05 2:29 PM The classloader differences from within a Report vs a Mojo makes it difficult to find resources that are needed by the checkstyle plugin. Either the Thread.currentThread().getContextClassLoader() should be the one for the specific report, or there should be a gotcha for report developers to use this.getClass().getClassLoader() instead. But that kind of limitation could pose problems for classloader issues in non-reports, such as checkstyle internals, or commons-logging internals.
Hide
Permalink
Joakim Erdfelt added a comment - 28/Dec/05 5:03 PM

Attached is a simple patch against the maven-site-plugin that corrects the classloader situation.

Show
Joakim Erdfelt added a comment - 28/Dec/05 5:03 PM Attached is a simple patch against the maven-site-plugin that corrects the classloader situation.
Hide
Permalink
Vincent Siveton added a comment - 01/Feb/06 8:08 PM

I tried your dummy project with site goal (from trunk) and m2 2.0.2. All sounds good for me.
Do you think that we could close this issue?

Show
Vincent Siveton added a comment - 01/Feb/06 8:08 PM I tried your dummy project with site goal (from trunk) and m2 2.0.2. All sounds good for me. Do you think that we could close this issue?
Hide
Permalink
Brett Porter added a comment - 07/Feb/06 7:18 AM

its not reproducible because the fix was added directly to the checkstyle plugin.

I think we resolved to fix this in the core eventually, and to work around it in individual plugins for now. Please reopen if I'm mistaken.

Show
Brett Porter added a comment - 07/Feb/06 7:18 AM its not reproducible because the fix was added directly to the checkstyle plugin. I think we resolved to fix this in the core eventually, and to work around it in individual plugins for now. Please reopen if I'm mistaken.

People

  • Assignee:
    Brett Porter
    Reporter:
    Joakim Erdfelt
Vote (1)
Watch (2)

Dates

  • Created:
    28/Dec/05 2:23 PM
    Updated:
    12/Oct/08 1:44 PM
    Resolved:
    07/Feb/06 7:18 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.