glencoesoftware / raw2ometiff

Raw format to OME-TIFF converter
GNU General Public License v2.0
46 stars 20 forks source link

Help running gradle build #98

Closed joshua-gould closed 1 year ago

joshua-gould commented 1 year ago

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 commented 1 year ago
> 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 commented 1 year ago

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 commented 1 year ago

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

sbesson commented 1 year ago

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 commented 1 year ago

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

sbesson commented 1 year ago

@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 commented 1 year ago

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.