[forge-issues] [JBoss JIRA] (FORGE-308) Need a way of supplying JARs to Plugins (e.g. Hibernate Tools)

Lincoln Baxter III (JIRA) jira-events at lists.jboss.org
Wed Feb 15 11:08:36 EST 2012


    [ https://issues.jboss.org/browse/FORGE-308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12666823#comment-12666823 ] 

Lincoln Baxter III edited comment on FORGE-308 at 2/15/12 11:07 AM:
--------------------------------------------------------------------

It should also be possible to load the JARs directly in the plugin. This would be a simpler solution. Simply create a new ClassLoader and ask it for the JARs.

Forge could bundle a utility for this:

{code}Class<?> clazz = ForgeLibApi.loadClass("my.jdbc.Driver");{code}

This could either take a resource/path to the JAR file, or simply load everything in $FORGE_HOME/lib (not currently a real folder) and check for the class in JARs found in that directory.
                
      was (Author: lincolnthree):
    It should also be possible to load the JARs directly in the plugin. This would be a simpler solution. Simply create a new ClassLoader and ask it for the JARs.

Forge could bundle a utility for this:

{code}Class<?> clazz = ForgeLibApi.loadClass("my.jdbc.Driver");{code}
                  
> Need a way of supplying JARs to Plugins (e.g. Hibernate Tools) 
> ---------------------------------------------------------------
>
>                 Key: FORGE-308
>                 URL: https://issues.jboss.org/browse/FORGE-308
>             Project: Forge
>          Issue Type: Feature Request
>          Components: Plugin API, Usability
>    Affects Versions: 1.0.0.Beta2
>            Reporter: Lincoln Baxter III
>             Fix For: 1.0.0.Final
>
>
> You could (in theory) add a JAR to the plugin module where it is installed:
> .forge/plugins/org/jboss/hibernate/forge/hibernate-tools-plugin/dependencies/1.0.0-SNAPSHOT-***
> and also add that jar as a resource in the module.xml file
> .forge/plugins/org/jboss/hibernate/forge/hibernate-tools-plugin/dependencies/1.0.0-SNAPSHOT-***/modules.xml
> That should do it, but it's not easy. This needs to be streamlined

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the forge-issues mailing list