This is an automated email from the ASF dual-hosted git repository.

gaul pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/jclouds.git

commit 85666982ae3e47e84cc6d1b68e0ffe225fad9629
Author: gurkerl83 <[email protected]>
AuthorDate: Sat Jan 9 19:25:53 2021 +0100

    Add OSGi version ranges, guice, okio
    
    In the present feature, the two properties
    - guava.osgi.import and
    - okhttp.version
    have not been attached to the build process (Bnd plugin), but have been 
recorded as comments only.
    
    Before the resolution method is considered, the problem of Guava and its 
close coupling with Guice must be examined.
    
    The Guice project possesses, differently to GSON no explicit configuration, 
how its dependencies are regarded in an OSGi execution environment.
    
    Guice / Guava
    - 4.1.0 / 19.0
    - 4.2.0 /  [23.6,24)
    - 4.2.1 / [25.1,26)
    - 4.2.3 / [27.1,28) => used
    - 5.0.0.BETA-1 / [27.1,28)
    
    The version of Guice built into JClouds is 4.2.3. Increasing to this 
version number was not the subject of the current branch.
    
    To avoid backward compatibility problems between Guice and Guava (e.g. 
Guice 4.2.3 -> Guava 24) this means that the version of Guava integrated in 
JClouds must be at least version 27.1. Guice puts this in its dependencies.
    
    In my opinion, consumers (JClouds, as well as consumers of JClouds) should 
take this minimum barrier into account.
    
    Resolution
    To understand the resolution, please consider the following previously 
unmerged feature.
    https://github.com/apache/jclouds/pull/86
    
    In order to add a Guava verison range to the bundles rolled out by JClouds, 
the following import rule is added in the BND Configuration of the Project 
Module.
    
    Import Package: \
        com.google.common.*;version="[27.1,30.1.0)", \
        okio.*;version="[1.2.0,1.3)", \
        *
    
    In the output of each JClouds module that uses Guava (and there are some) 
the configuration to the range version is observed. The bnd built into the 
JClouds project modules acts as a base of other bnd configurations, and should 
also apply in the Lab and Co repositories. Adjusted artefacts only become valid 
when a release is available or the build of these repositories is triggered 
again.
    
    Output - Core Module
    
    Import package:
       com.google.common.base;version="[27.1,30.1.0)",
       com.google.common.cache;version="[27.1,30.1.0)",
       com.google.common.collect;version="[27.1,30.1.0)",
       ...
       com.google.gson;version="[2.8,3)",
       ...
    
    Output - Blobstore Module
    
    Import package:
       com.google.common.base;version="[27.1,30.1.0)",
       com.google.common.collect;version="[27.1,30.1.0)",
       com.google.common.hash;version="[27.1,30.1.0)",
       ...
       com.google.inject;version="[1.4,2)",
       ...
    
    Oki version range
    The okhttp dependency requires okio version 1.2. The ok* libraries 
respectively the dependencies used in these libraries do not have OSGi 
instructions. For this reason, the previously integrated configuration is used.
    
    Local tests show that the import directive can also be set globally, see 
above. An explicit specification in the bnd file of the JClouds okHTTP module 
is not useful because this JClouds module also uses Guava.
    
    Output - OkHTTP Module
    
    Import package:
       com.google.common.base;version="[27.1,30.1.0)",
       com.google.common.collect;version="[27.1,30.1.0)",
       okio;version="[1.2.0,1.3)",
       com.google.inject;version="[1.4,2)",
       ...
    
    Note:
    In the following feature, the version of the "ok" framework has been 
significantly increased.  Extensive adjustments are also performed.
    
    At this point, it should be noted that the import policy in the okio will 
probably have to be removed again because standalone OSGi metadata may be 
provided.
---
 project/bnd.bnd | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/project/bnd.bnd b/project/bnd.bnd
index c751a54..7c4e658 100644
--- a/project/bnd.bnd
+++ b/project/bnd.bnd
@@ -23,4 +23,9 @@ X-Compile-Source-JDK: \
     ${maven.compile.source}
 
 X-Compile-Target-JDK: \
-    ${maven.compile.target}
\ No newline at end of file
+    ${maven.compile.target}
+
+Import-Package: \
+    com.google.common.*;version="[27.1,30.1.0)", \
+    okio.*;version="[1.2.0,1.3)", \
+    *
\ No newline at end of file

Reply via email to