You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@jclouds.apache.org by GitBox <gi...@apache.org> on 2021/01/09 18:12:59 UTC

[GitHub] [jclouds] gurkerl83 commented on pull request #78: Replace embedded and repackaged GSON library

gurkerl83 commented on pull request #78:
URL: https://github.com/apache/jclouds/pull/78#issuecomment-757345535


   Hi all,
   
   The Guava version fixed to 22.0 in the master branch was already set before the refactoring performed in this branch. 
   
   Different versions of Guava were allowed in an OSGi environment by overriding the 22 version (derived from the Maven dependencies) with a range of 22.0 -> 30.0.0.
   
   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 this 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 unnoticed branch.
   
   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 is heard. Extensive adjustments are also performed.
   
   At this point, it should be noted that the import policy in the okio will probably have to be extracted again because standalone OSGi metadata may be provided.  
   
   Translated with www.DeepL.com/Translator (free version)


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org