Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help running gradle build #98

Closed
joshua-gould opened this issue Feb 6, 2023 · 7 comments
Closed

Help running gradle build #98

joshua-gould opened this issue Feb 6, 2023 · 7 comments

Comments

@joshua-gould
Copy link

Tried using ./gradlew script and system installed gradle. Thanks.

~/code/raw2ometiff$ ./gradlew build

FAILURE: Build failed with an exception.

* What went wrong:
Could not initialize class org.codehaus.groovy.runtime.InvokerHelper
> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 574ms
~/code/raw2ometiff$ gradle build
> Task :compileJava FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':compileJava'.
> Could not resolve all files for configuration ':compileClasspath'.
   > Could not resolve com.bc.zarr:jzarr:0.3.5.
     Required by:
         project :
      > Could not resolve com.bc.zarr:jzarr:0.3.5.
         > Could not get resource 'https://artifacts.glencoesoftware.com/artifactory/ome.releases/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
            > Could not GET 'https://artifacts.glencoesoftware.com/artifactory/ome.releases/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.bc.zarr:jzarr:0.3.5.
         > Could not get resource 'https://artifacts.glencoesoftware.com/artifactory/unidata-releases/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
            > Could not GET 'https://artifacts.glencoesoftware.com/artifactory/unidata-releases/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.bc.zarr:jzarr:0.3.5.
         > Could not get resource 'https://repo.glencoesoftware.com/repository/bioformats2raw2ometiff/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
            > Could not GET 'https://repo.glencoesoftware.com/repository/bioformats2raw2ometiff/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.bc.zarr:jzarr:0.3.5.
         > Could not get resource 'https://nexus.senbox.net/nexus/content/groups/public/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
            > Could not GET 'https://nexus.senbox.net/nexus/content/groups/public/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.bc.zarr:jzarr:0.3.5.
         > Could not get resource 'https://repo.glencoesoftware.com/repository/jzarr-snapshots/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
            > Could not GET 'https://repo.glencoesoftware.com/repository/jzarr-snapshots/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve com.bc.zarr:jzarr:0.3.5.
         > Could not get resource 'https://maven.scijava.org/content/groups/public/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
            > Could not GET 'https://maven.scijava.org/content/groups/public/com/bc/zarr/jzarr/0.3.5/jzarr-0.3.5.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve ome:formats-bsd:6.11.1.
     Required by:
         project :
      > Could not resolve ome:formats-bsd:6.11.1.
         > Could not get resource 'https://artifacts.glencoesoftware.com/artifactory/ome.releases/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
            > Could not GET 'https://artifacts.glencoesoftware.com/artifactory/ome.releases/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve ome:formats-bsd:6.11.1.
         > Could not get resource 'https://artifacts.glencoesoftware.com/artifactory/unidata-releases/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
            > Could not GET 'https://artifacts.glencoesoftware.com/artifactory/unidata-releases/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve ome:formats-bsd:6.11.1.
         > Could not get resource 'https://repo.glencoesoftware.com/repository/bioformats2raw2ometiff/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
            > Could not GET 'https://repo.glencoesoftware.com/repository/bioformats2raw2ometiff/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve ome:formats-bsd:6.11.1.
         > Could not get resource 'https://nexus.senbox.net/nexus/content/groups/public/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
            > Could not GET 'https://nexus.senbox.net/nexus/content/groups/public/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve ome:formats-bsd:6.11.1.
         > Could not get resource 'https://repo.glencoesoftware.com/repository/jzarr-snapshots/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
            > Could not GET 'https://repo.glencoesoftware.com/repository/jzarr-snapshots/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
      > Could not resolve ome:formats-bsd:6.11.1.
         > Could not get resource 'https://maven.scijava.org/content/groups/public/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
            > Could not GET 'https://maven.scijava.org/content/groups/public/ome/formats-bsd/6.11.1/formats-bsd-6.11.1.pom'.
               > The server may not support the client's requested TLS protocol versions: (TLSv1.2, TLSv1.3). You may need to configure the client to allow other protocols to be used. See: https://docs.gradle.org/7.6/userguide/build_environment.html#gradle_system_properties
                  > PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use '--warning-mode all' to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

See https://docs.gradle.org/7.6/userguide/command_line_interface.html#sec:command_line_warnings
@sbesson
Copy link
Member

sbesson commented Feb 7, 2023

> Exception java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache [in thread "Daemon worker"]

Which Java version are you using which leads to this NoClassDefFoundError with the Gradle wrapper?

For the second stack trace, what is the output of gradle --version? The current wrapper is using 6.2.1 but from the stack trace it looks like you are using Gradle 7.x which is an build upgrade we might have to review.

@joshua-gould
Copy link
Author

I've managed to get the ./gradlew script to run with Java 11 (on Mac Monterey) but I get the error I received previously using the system provided gradle (The server may not support the client's requested TLS protocol versions). What version of the JVM do you use to build successfully? Thanks.

@joshua-gould
Copy link
Author

I also get the TLS error using Ubuntu and Java 8. Thanks.

@sbesson
Copy link
Member

sbesson commented Feb 7, 2023

What version of the JVM do you use to build successfully?

The library itself requires Java 8+ at the moment but I am also usually building using JDK 11.

I also get the TLS error using Ubuntu and Java 8. Thanks.

Thanks. Same question as above, which version of Ubuntu and Gradle?

While investigating this issue, I noticed that JDK 17 is not working with the version of Gradle supplied in the wrapper so I'll probably open a PR to upgrade this anyways.

@joshua-gould
Copy link
Author

Ubuntu 20.04.5 LTS and Gradle 6 gives the TLS error using both Java 8 and Java 11.

@sbesson
Copy link
Member

sbesson commented Feb 14, 2023

@joshua-gould thanks for the additional information. Re system Gradle, I tried reproducing your issue with the following Docker environment but I could not reproduce the issue you are seeing

FROM ubuntu:20.04

RUN apt-get update && \
    DEBIAN_FRONTEND=noninteractive apt install -yqq default-jdk gradle git
RUN git clone https://github.com/glencoesoftware/raw2ometiff /tmp/raw2ometiff

WORKDIR /tmp/raw2ometiff
ENTRYPOINT ["gradle"]

Is there any key store set-up in your environment and configured via the javax.net.ssl.trustStore property as this could possibly lead to the types of exceptions described here?

Most importantly, the Gradle wrapper is the main build workflow we are supporting for these utilities at the moment. From the above, I understand this approach is correctly working for you with JDK 11. Do you still have a configuration where ./gradlew build is failing which blocks your development?

@melissalinkert
Copy link
Member

Closing in the absence of further information, as the Gradle wrapper should work as previously indicated. Feel free to re-open if there is a scenario where ./gradlew build fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants