[shrinkwrap-issues] [JBoss JIRA] (SHRINKRES-26) Make Shrinkwrap resolver work in a modular environment

Karel Piwko (JIRA) issues at jboss.org
Thu Feb 13 03:39:28 EST 2014


     [ https://issues.jboss.org/browse/SHRINKRES-26?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Karel Piwko resolved SHRINKRES-26.
----------------------------------

         Assignee: Karel Piwko
    Fix Version/s: 2.1.0
       Resolution: Done


Modular tests - with different classloader are used in ShrinkWrap Maven Plugin Dependecy Tree goal. Maven has a modular classpath handled by Plexu ClassWorlds and we require specific classpath setup in order to execute ShrinkWrap Resolver from Maven Plugin.

The only issue is that classloader that is used to load Resolvers/Maven class must be the same as the one passed to API or the must be parent-child relationship.

This happens due to fact that casting to generic types might fail with ClassCastException if Generic type Erasure was loaded by different classloader.

I don't see that as an issue, hence closing the issue, marking as resolved. Please file a new bug if you need more complicated classloader handling.
                
> Make Shrinkwrap resolver work in a modular environment
> ------------------------------------------------------
>
>                 Key: SHRINKRES-26
>                 URL: https://issues.jboss.org/browse/SHRINKRES-26
>             Project: ShrinkWrap Resolvers
>          Issue Type: Enhancement
>          Components: impl-maven
>    Affects Versions: 1.1.0-alpha-1
>            Reporter: Galder Zamarreño
>            Assignee: Karel Piwko
>             Fix For: 2.1.0
>
>
> The subsystem I'm building requires dependencies of my war to downloaded and resolved at runtime or deploy time.
> So, that means that I need to create a set of JBoss AS7 modules for Shrinkwrap resolver. However, the way classloader works to load META-INF/services/org.jboss.shrinkwrap.resolver.api.maven.MavenDependencyResolver is a bit crap cos it uses thread context classloader in DependencyBuilderInstantiator.
> Can this be rewritten so that classloading can work in a modular environment as well?
> The problem is that the thread context classloader at runtime is:
> {code}ModuleClassLoader for Module "org.jboss.as.server:main" from local module loader @5d2412e7 (roots: ...){code}
> I can probably workaround this setting the module's classloader as thread context classloader temporarily, but this is not nice.
> Thoughts?

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the shrinkwrap-issues mailing list