sonatype-nexus-community / nexus-blobstore-google-cloud

Nexus Repository Manager Blobstore backed by Google Cloud Storage
https://help.sonatype.com/en/configuring-blob-stores.html#google-cloud-blob-store
Eclipse Public License 1.0
39 stars 16 forks source link

update to NXRM 3.14 and latest Google Cloud Storage library #15

Closed nblair closed 6 years ago

nblair commented 6 years ago

This pull request makes the following changes:

The BlobStore interface in NXRM 3.14 includes a new method to test if the blobstore is in fact writable. The implementation defines that the blobstore is writable if the IAM permissions includes both [ storage.objects.create, storage.objects.delete ].

nblair commented 6 years ago

While build and integration tests all pass, in it's current form this plugin won't startup successfully in NXRM 3.14. Here's the failure:

Caused by: org.osgi.service.resolver.ResolutionException: Unable to resolve root: missing requirement [root] osgi.identity; osgi.identity=nexus-core-feature; type=karaf.feature; version=0; filter:="(&(osgi.identity=nexus-core-feature)(type=karaf.feature)(version>=0.0.0))" [caused by: Unable to resolve nexus-core-feature/3.15.0.SNAPSHOT: missing requirement [nexus-core-feature/3.15.0.SNAPSHOT] osgi.identity; osgi.identity=nexus-blobstore-google-cloud; type=karaf.feature; version="[0.4.0.SNAPSHOT,0.4.0.SNAPSHOT]" [caused by: Unable to resolve nexus-blobstore-google-cloud/0.4.0.SNAPSHOT: missing requirement [nexus-blobstore-google-cloud/0.4.0.SNAPSHOT] osgi.identity; osgi.identity=com.google.http-client.google-http-client; type=osgi.bundle; version="[1.24.1,1.24.1]"; resolution:=mandatory [caused by: Unable to resolve com.google.http-client.google-http-client/1.24.1: missing requirement [com.google.http-client.google-http-client/1.24.1] osgi.wiring.package; filter:="(&(osgi.wiring.package=com.google.common.base)(version>=20.0.0)(!(version>=21.0.0)))"]]]
        at org.apache.felix.resolver.ResolutionError.toException(ResolutionError.java:42)
        at org.apache.felix.resolver.ResolverImpl.doResolve(ResolverImpl.java:389)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:375)
        at org.apache.felix.resolver.ResolverImpl.resolve(ResolverImpl.java:347)
        at org.apache.karaf.features.internal.region.SubsystemResolver.resolve(SubsystemResolver.java:216)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:263)
        at org.apache.karaf.features.internal.service.Deployer.deploy(Deployer.java:259)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl.doProvision(FeaturesServiceImpl.java:1176)
        at org.apache.karaf.features.internal.service.FeaturesServiceImpl$1.call(FeaturesServiceImpl.java:1074)
        at java.util.concurrent.FutureTask.run(FutureTask.java:266)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

Working with @mcculls, came up with an idea to re-wrap the google-http-client dependency. Tried several combinations of the following added to feature.xml:

<bundle>wrap:${mvn:protobuf-java-util}$overwrite=merge&amp;Import-Package=com.google.common.*,*</bundle>
<bundle>wrap:${mvn:grpc-core}$Bundle-SymbolicName=grpc-core</bundle>
<bundle>wrap:${mvn:grpc-context}$Bundle-SymbolicName=grpc-context&amp;Fragment-Host=grpc-core</bundle>
<bundle>wrap:${mvn:google-api-client}$overwrite=merge&amp;Import-Package=*</bundle>
<bundle>wrap:${mvn:google-http-client}$overwrite=merge&amp;Import-Package=*</bundle>
<bundle>wrap:${mvn:google-http-client-appengine}$overwrite=merge&amp;Import-Package=*</bundle>
<bundle>wrap:${mvn:google-http-client-jackson}$overwrite=merge&amp;Import-Package=*</bundle>
<bundle>wrap:${mvn:google-http-client-jackson2}$overwrite=merge&amp;Import-Package=*</bundle>
<bundle>wrap:${mvn:google-http-client-protobuf}$overwrite=merge&amp;Import-Package=*</bundle>
<bundle>wrap:${mvn:google-oauth-client}$overwrite=merge&amp;Import-Package=*</bundle>

along with the appropriate excludedArtifactIds in the karaf-maven-plugin config:

<id>google-api-client</id>
<id>google-http-client</id>
<id>google-http-client-appengine</id>
<id>google-http-client-jackson</id>
<id>google-http-client-jackson2</id>
<id>google-http-client-protobuf</id>
<id>google-oauth-client</id>

No luck though still, same error. Capturing here so I can get some additional eyes and/or pick up where I left off.

nblair commented 6 years ago

Going to close this and split the concerns so the 3.14 upgrade bits can go through separately.