[ 
https://issues.apache.org/jira/browse/DERBY-6069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13613766#comment-13613766
 ] 

Rick Hillegas commented on DERBY-6069:
--------------------------------------

Thanks, Christian. No, there are no plans to migrate Derby's build machinery to 
maven. We may need to write a custom ant task for this. I agree that simply 
hard-coding today's result sounds like a brittle solution.

It doesn't appear to me derbynet.jar has any OSGi annotation in it. I suppose 
that we should add OSGi annotations to all of the Derby jar files except for 
the message localizations. The exports would look like this:

derby.jar:

    org.apache.derby.agg
    org.apache.derby.authentication
    org.apache.derby.catalog
    org.apache.derby.jdbc
    org.apache.derby.mbeans
    org.apache.derby.security
    org.apache.derby.vti

derbynet.jar:

    org.apache.derby.drda
    org.apache.derby.mbeans.drda

derbyclient.jar:

    org.apache.derby.jdbc

derbytools.jar:

    org.apache.derby.tools

I'm troubled by the presence of org.apache.derby.jdbc in both derby.jar and 
derbyclient.jar. This seems to be a forbidden practice: 
http://wiki.osgi.org/wiki/Split_Packages. However, I don't think that it would 
give rise to any new problems. I would expect sealing violations if a 
classloader actually loaded classes from derbyclient.jar and derby.jar 
together. From the Apache ServiceMix manifest which you attached, I see that 
they have worked around this problem by dumping the contents of derbyclient.jar 
and derby.jar into one jar file (along with the contents of derbynet.jar). I 
think that this splitting of packages across two jar files is an awkwardness in 
Derby's architecture. It doesn't work for OSGi and I don't think it will work 
well with the module factoring we'll want to consider when we align ourselves 
with Jigsaw in JDK 9.

We could also add OSGi annotations to the localization jars. They would all 
export the following packages:

    org/apache/derby/info
    org/apache/derby/loc/drda
    org/apache/derby/loc

Since this would be another example of the split package problem, I would 
recommend moving slowly on this one. Let's not bother annotating the 
localization jars right now.

Thanks,
-Rick
                
> Derby doesn't export the version number in its OSGI exported packages
> ---------------------------------------------------------------------
>
>                 Key: DERBY-6069
>                 URL: https://issues.apache.org/jira/browse/DERBY-6069
>             Project: Derby
>          Issue Type: Bug
>    Affects Versions: 10.9.1.0, 10.8.3.0
>            Reporter: Christian Müller
>              Labels: osgi
>         Attachments: MANIFEST.MF
>
>
> Derby doesn't export the version number in its OSGI exported packages. See 
> the following exports:
> {noformat}
> karaf@root> headers 259
> Apache Derby 10.8 (259)
> -----------------------
> Manifest-Version = 1.0
> Ant-Version = Apache Ant 1.7.0
> Class-Path = derbyLocale_cs.jar derbyLocale_de_DE.jar derbyLocale_es.jar 
> derbyLocale_fr.jar derbyLocale_hu.jar derbyLocale_it.jar derbyLocal
> e_ja_JP.jar derbyLocale_ko_KR.jar derbyLocale_pl.jar derbyLocale_pt_BR.jar 
> derbyLocale_ru.jar derbyLocale_zh_CN.jar derbyLocale_zh_TW.jar
> Sealed = true
> Created-By = 2.4 (IBM Corporation)
> Bundle-Vendor = Apache Software Foundation
> Bundle-Activator = org.apache.derby.osgi.EmbeddedActivator
> Bundle-Name = Apache Derby 10.8
> Bundle-SymbolicName = derby
> Bundle-Version = 10.8.3000000.1405108
> Bundle-ManifestVersion = 2
> DynamicImport-Package =
>         *
> Export-Package =
>         org.apache.derby.authentication,
>         org.apache.derby.database,
>         org.apache.derby.io,
>         org.apache.derby.jdbc,
>         org.apache.derby.vti
> {noformat}
> {noformat}
> karaf@root> headers 250
> Apache Derby 10.9 (250)
> -----------------------
> Manifest-Version = 1.0
> Ant-Version = Apache Ant 1.7.1
> Class-Path = derbyLocale_cs.jar derbyLocale_de_DE.jar derbyLocale_es.jar 
> derbyLocale_fr.jar derbyLocale_hu.jar derbyLocale_it.jar derbyLocal
> e_ja_JP.jar derbyLocale_ko_KR.jar derbyLocale_pl.jar derbyLocale_pt_BR.jar 
> derbyLocale_ru.jar derbyLocale_zh_CN.jar derbyLocale_zh_TW.jar
> Sealed = true
> Created-By = 20.6-b01-415 (Apple Inc.)
> Bundle-Vendor = Apache Software Foundation
> Bundle-Activator = org.apache.derby.osgi.EmbeddedActivator
> Bundle-Name = Apache Derby 10.9
> Bundle-SymbolicName = derby
> Bundle-Version = 10.9.1000000.1344872
> Bundle-ManifestVersion = 2
> DynamicImport-Package =
>         *
> Export-Package =
>         org.apache.derby.authentication,
>         org.apache.derby.database,
>         org.apache.derby.io,
>         org.apache.derby.jdbc,
>         org.apache.derby.vti
> {noformat}
> This leads to problems, if other bundles imports derby packages with a 
> specific version or version range (like spring-jdbc do):
> {noformat}
> karaf@root> headers 251
> Spring JDBC (251)
> -----------------
> Manifest-Version = 1.0
> ...
> Import-Package =
>         ...
>         org.apache.derby.impl.io;resolution:=optional;version="[10.5.0, 
> 11.0.0)",
>         org.apache.derby.jdbc;resolution:=optional;version="[10.5.0, 11.0.0)",
> ...
> {noformat}

--
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

Reply via email to