dev@glassfish.java.net

Re: Unresolved constraint in bundle - external jar for module

From: Harsha Godugu <Harsha.Godugu_at_Sun.COM>
Date: Wed, 07 Jan 2009 13:26:22 -0800

On 01/07/09 12:31, Claudio Miranda wrote:
> On Wed, Jan 7, 2009 at 5:41 PM, Harsha Godugu <Harsha.Godugu_at_sun.com> wrote:
>
>> Before answering the question, how did this module get compiled?, with these
>> dependencies in place. Are they stored in then maven local repo?
>>
>
> That is for sure, with mvn install:install-file
>
The above is not a viable solution, unless this is just a temporary
trial / test work. Consider that once your module is stabilized,
checked-in with these 3rd party dependents, how do we tell other
developers to use these 3rd party dependents? (Can't ask everyone to
use the mojo style 3rd party jar installation into local repo.)
Instead, your module's pom.xml should have mechanics to do this
silently. All it needs is, to add the external repository location, if
these external jars have a maven style repo. If they don't, then publish
them under one of our glassfish repos. (Remember: these jars need to be
QAed before publishing)


>
>> or used some classpath trick? Take a look at "external" dir in v3 on how
>> repackaging the external jars is done! That would help resolving the osgi
>> loading errors.
>>
>
> The "external" dir you refer to is domains/domain1/lib/ext extension
> directory ? I also tried that with no success.
>
No. What I meant was, v3/distributions/external dir.
( One shouldn't place jars in an installed location, then make server
run. That's a hack ;-) Now, with OSGi that practise does not work.)
When your module depends on 3rd party, your module should also bundle
these 3rd party jars too. Take a look at pom.xml under any of the
v3/distributions/external sub-dirs.
Make the OSGi wiring for imported and exported packaged for these 3rd
party modules. Before all this, I'm assuming that, you have already
contacted Jerome/ Abhijit, that this module is inducing new 3rd party
dependencies for v3. (all legal /risk stuff!).

thanks,
Harsha

> Can you point to an example or svn path where can I find more
> information about how to repackage those jars ?
>
> I am using glassfish v3 b31 (./asadmin version --verbose)
>
> http://download.java.net/glassfish/v3/nightly/glassfish-v3-b30-01_05_2009.zip
>
> I found it odd asadmin shows a different version of the downloaded one.
>
>