Bug 207957 - Support for OSGi wrappers using external:$ENVPROP$
Support for OSGi wrappers using external:$ENVPROP$
Status: NEW
Product: apisupport
Classification: Unclassified
Component: Harness
7.2
PC Windows 7
: P2 (vote)
: 7.3
Assigned To: Martin Kozeny
issues@apisupport
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-31 16:26 UTC by Tomas Pavek
Modified: 2013-05-30 14:47 UTC (History)
2 users (show)

See Also:
Issue Type: ENHANCEMENT
:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Pavek 2012-01-31 16:26:13 UTC
Currently it's difficult to have a project depend on an OSGi bundle that has additional JARs on classpath. The build system/project system seems to ignore the Bundle-ClassPath manifest element.

It's not easily possibly to use classes from the wrapped JAR, the build fails and also the IDE shows errors for usages of the classes. Workaround is to add the JAR to cp.extra project property. It becomes awkward quickly when it needs to be used often, duplicating the paths in build property files.

As an example, take jdeveloper/external/oracle.javatools-nodeps.jar that has the following in its manifest:

Bundle-SymbolicName: oracle.javatools-nodeps
Bundle-ClassPath: .,external:$ORACLE_HOME$/jdeveloper/modules/oracle.javatools_11.1.1/javatools-nodeps.jar

The requirement is that setting up a dependency to "oracle.javatools-nodeps" (e.g. from a module suite project) should simply allow to use classes (build, edit) from the complete bundle's classpath, including the target javatools-nodeps.jar. The 'Bundle-ClassPath' element should be processed and classpath composed from it. That should also include resolving the property in the path ($ORACLE_HOME$).
Comment 1 Jesse Glick 2012-02-14 21:49:58 UTC
While supporting Bundle-ClassPath in various places including the build harness would be desirable, the external:$ORACLE_HOME$ syntax is nonstandard and nonportable. Bundle-ClassPath may only be used for JARs embedded in the bundle (i.e. nested ZIP entries). I would suggest fixing this on the JDev side first.
Comment 2 Jaroslav Tulach 2012-03-02 12:19:13 UTC
I'd like to define ORACLE_HOME=${jdeveloper.dir} in the suite/nbproject/platform.properties and convince both harness and editor to use such value when processing external:.... references.
Comment 3 Jesse Glick 2012-03-02 23:41:54 UTC
This sounds like a bad approach. If there is a plain old JAR somewhere that should be made visible from an OSGi bundle, add OSGi headers to it and include it in the binary cluster path.
Comment 4 Jaroslav Tulach 2012-03-05 07:40:12 UTC
The customer may not have permission to modify some of the JARs, I am afraid. Other JARs are reused in different products and possibly owned by teams which have not adopted OSGi yet and as such it is hard to include OSGi manifests in there.

Anyway "external:" protocol is Equinox officially supported extension and as NetBeans IDE uses Equinox since 7.1, it make sense to include this support in harness too.
Comment 5 Jaroslav Tulach 2012-06-07 04:18:01 UTC
I will not able to handle this for 7.2 version.
Comment 6 Marian Mirilovic 2012-06-07 07:13:01 UTC
(In reply to comment #5)
> I will not able to handle this for 7.2 version.

... and is this the reason to DEFECT -> TASK transfer ?
Comment 7 Jaroslav Tulach 2012-06-07 13:58:19 UTC
(In reply to comment #6)
> (In reply to comment #5)
> > I will not able to handle this for 7.2 version.
> 
> ... and is this the reason to DEFECT -> TASK transfer ?

Yes. If I fixed it by the release, I would not care about the type of the issue.
Comment 8 Marian Mirilovic 2012-06-07 15:29:24 UTC
> > > I will not able to handle this for 7.2 version.
> > 
> > ... and is this the reason to DEFECT -> TASK transfer ?
> 
> Yes. If I fixed it by the release, I would not care about the type of the
> issue.

Yes, but P2 DEFECT - means to be fixed in 7.2 .... P2 TASK - means nobody really cares about this bug ...


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo