like .class files. Maybe is not the nicest way but it works perfect
On 17 mayo, 23:29,
lionel.spine...@free.fr wrote:
> Hello Fernando,
>
> an other solution is to build your jar including the external jar classes and resources automatically. To do so, it is possible to include a specific command in your ant build task (if you use ant) to ask it to automaticaly get the files of the external jar and include them into your plugin jar. The line to add in the jar target of the ant build task is something like: <zipgroupfileset dir="lib" includes="**/*.jar"/> (I would be able to bring you a more precise example when I will get back to my code next monday).
> Note that if the external jar contains specific signature it must be removed from its manifest file before.
>
> cheers
>
> Lionel
>
> ----- Mail original -----
> De: "Jason Montojo" <
jrr...@gmail.com>
> À:
cytoscap...@googlegroups.com
> Envoyé: Jeudi 17 Mai 2012 22:40:15
> Objet: Re: [Cytoscape-discuss] External Jar needed in the plugin
>
> Hi Fernando,
>
> Class.getResource() only works on things that are in the ClassLoader's classpath. The ClassLoader that's used to load your plugin only includes your plugin's JAR file in its classpath. That means other JARs in the plugin folder won't be visible to your plugin through getResource().
>
> If your plugin depends on external JARs, you need to unpack those JARs and package them inside your JAR. So if you have a file foo.txt, you can use MyPlugin.class.getResource("/foo.txt") to access it. The leading "/" is important because it tells Java not to use MyPlugin's package name when trying to resolve the location of foo.txt.
>
> Is there a particular reason you're trying to get the JAR file's URI? Or is your end goal to get some resource within the JAR file?
>
> Hope this helps,
> Jason
>