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

Build fails with latest maven docker image #27

Closed tonyfahrion closed 5 years ago

tonyfahrion commented 5 years ago

Hi,

[INFO] Changes detected - recompiling the module! [INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files [INFO] ------------------------------------------------------------- [ERROR] COMPILATION ERROR : [INFO] ------------------------------------------------------------- [ERROR] /build/nexus-blobstore-google-cloud-0.4.0/src/main/java/org/sonatype/nexus/blobstore/gcloud/internal/GoogleAttributesLocation.java:[1,1] 1. ERROR in /build/nexus-blobstore-google-cloud-0.4.0/src/main/java/org/sonatype/nexus/blobstore/gcloud/internal/GoogleAttributesLocation.java (at line 1) package org.sonatype.nexus.blobstore.gcloud.internal; ^ The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files

[ERROR] /build/nexus-blobstore-google-cloud-0.4.0/src/main/java/org/sonatype/nexus/blobstore/gcloud/internal/GoogleAttributesLocation.java:[1,1] 2. ERROR in /build/nexus-blobstore-google-cloud-0.4.0/src/main/java/org/sonatype/nexus/blobstore/gcloud/internal/GoogleAttributesLocation.java (at line 1) package org.sonatype.nexus.blobstore.gcloud.internal; ^ The type java.lang.String cannot be resolved. It is indirectly referenced from required .class files

[ERROR] /build/nexus-blobstore-google-cloud-0.4.0/src/main/java/org/sonatype/nexus/blobstore/gcloud/internal/GoogleAttributesLocation.java:[9,14] 3. ERROR in /build/nexus-blobstore-google-cloud-0.4.0/src/main/java/org/sonatype/nexus/blobstore/gcloud/internal/GoogleAttributesLocation.java (at line 9)

mattjohnson commented 5 years ago

Hi @tonyfahrion I confirmed I have the same issue. I tried pinning to JDK8 but also ran into issues with that. Hopefully I'll have it resolved soon. Also I plan on adding the build to the CI build so we'll catch this type of issue sooner.

tonyfahrion commented 5 years ago

Hi @mattjohnson, thank you for the quick response. As for me, using maven:3.6-jdk-8-alpine works. Maybe that helps a little bit 🙂

mattjohnson commented 5 years ago

I assume you replaced the RUN git ... line with a COPY . /build/. in the Dockerfile then? When I use that tag it can't find git. I was trying 3-jdk-8 which was giving the error Error: Could not find or load main class org.apache.maven.surefire.booter.ForkedBooter.

tonyfahrion commented 5 years ago

I added the following line to the build image:

ENV GOOGLE_PLUGIN_URL="https://github.com/sonatype-nexus-community/nexus-blobstore-google-cloud.git"
ENV GOOGLE_PLUGIN_VERSION="0.4.0"
RUN apk add --no-cache git && \
       git clone ${GOOGLE_PLUGIN_URL} --branch=${GOOGLE_PLUGIN_VERSION} --depth 1 . && \
       mvn clean package

I am not removing git later, because it's just the build image and gets dropped later anyway

mattjohnson commented 5 years ago

Yeah, I agree with changing from install to package. No need to run tests. I also think it should build the current workspace and not latest from master. Seems like some indirection there. I opened a PR with some changes that should resolve this.

tonyfahrion commented 5 years ago

very cool 🙂 Thank you!