ben-manes / gradle-versions-plugin

Gradle plugin to discover dependency updates
Apache License 2.0
3.88k stars 201 forks source link

Failure to find com.microsoft.sqlserver:mssql-jdbc version #869

Closed rob-elsevier closed 5 months ago

rob-elsevier commented 5 months ago

First off, thank you for making this plugin available!

I have one strange issue that I am struggling to get to the bottom of. I have the following dependency:

dependencies {
    implementation 'org.springframework.boot:spring-boot-starter-log4j2'
    implementation 'org.springframework.boot:spring-boot-starter-web'
    implementation 'org.springframework.boot:spring-boot-starter-validation'
    implementation 'org.springframework.boot:spring-boot-starter-webflux'

    // Database / JDBC Template Support
    implementation 'org.springframework.boot:spring-boot-starter-data-jdbc'
    implementation group: 'org.springframework', name: 'spring-jdbc', version: '6.1.8'
    implementation group: 'com.microsoft.sqlserver', name: 'mssql-jdbc', version: '12.6.2.jre11'
}

(Cut out some - but should give the idea)

And it is failing to find the mssql-jdbc for version checking:

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.microsoft.sqlserver:mssql-jdbc

But it's in the repo: https://mvnrepository.com/artifact/com.microsoft.sqlserver/mssql-jdbc

Adding --info the output is:

Failed to determine the latest version for the following dependencies (use --info for details):
 - com.microsoft.sqlserver:mssql-jdbc
The exception that is the cause of unresolved state: org.gradle.internal.resolve.ModuleVersionNotFoundException: Could not find any matches for com.microsoft.sqlserver:mssql-jdbc:+ as no versions of com.microsoft.sqlserver:mssql-jdbc are available.

Any help of suggestions would be appreciated. Thanks

ben-manes commented 5 months ago

Perhaps a resolution strategy is rejecting all candidate versions?

rob-elsevier commented 5 months ago

Perhaps a resolution strategy is rejecting all candidate versions?

Thanks for the reply - I did try removing the whole section and still get the same error - it was previously as follows, but still get the same problem without it

dependencyUpdates {
    checkForGradleUpdate = false
    gradleReleaseChannel = 'current'
    // Add a rule to reject pre-release versions and any we can not upgrade
    resolutionStrategy {
        componentSelection { rules ->
            rules.all { ComponentSelection selection ->
                boolean rejected = ['\\d-M\\d', '\\d-b\\d', '\\d-RC\\d', 'Alpha\\d', 'rc\\d', 'preview'].any { qualifier ->
                    selection.candidate.version ==~ /(?i).*[.-]${qualifier}[.\d-]*/
                }
                if (rejected) {
                    selection.reject('Release candidate')
                }
            }
        }
    }
}
ben-manes commented 5 months ago

That's a weird one! I see the same results but don't have any explanation for it. It is using Gradle's native features, so you can open an issue with them for help. Here is an example that fails for a dynamic version, +.

plugins {
  id 'java-library'
}

repositories {
  mavenCentral()
}

dependencies {
  implementation 'com.microsoft.sqlserver:mssql-jdbc:+'
}

Then when you run gradle dependencies it shows a failed resolution (trimmed, build scan).

------------------------------------------------------------
Root project 'gradle-versions-sample-groovy'
------------------------------------------------------------

compileClasspath - Compile classpath for source set 'main'.
\--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED

implementation - Implementation only dependencies for source set 'main'. (n)
\--- com.microsoft.sqlserver:mssql-jdbc:+ (n)

runtimeClasspath - Runtime classpath of source set 'main'.
\--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED

testCompileClasspath - Compile classpath for source set 'test'.
\--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED

testRuntimeClasspath - Runtime classpath of source set 'test'.
\--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED

The debug log shows that it is able to find the versions, but it is unclear why it failed to resolve any.

debug log ```console 2024-06-10T09:22:00.244-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for com.microsoft.sqlserver:mssql-jdbc:+ using repositories [MavenRepo] 2024-06-10T09:22:00.244-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Version listing in dynamic revision cache is expired: will perform fresh resolve of 'com.microsoft.sqlserver:mssql-jdbc:+' in 'MavenRepo' 2024-06-10T09:22:00.244-0700 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/maven-metadata.xml 2024-06-10T09:22:00.244-0700 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource metadata: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/maven-metadata.xml 2024-06-10T09:22:00.244-0700 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP HEAD: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/maven-metadata.xml 2024-06-10T09:22:00.244-0700 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default 2024-06-10T09:22:00.244-0700 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context 2024-06-10T09:22:00.244-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://repo.maven.apache.org:443][total available: 0; route allocated: 0 of 20; total allocated: 0 of 20] 2024-06-10T09:22:00.244-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 45][route: {s}->https://repo.maven.apache.org:443][total available: 0; route allocated: 1 of 20; total allocated: 1 of 20] 2024-06-10T09:22:00.244-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Opening connection {s}->https://repo.maven.apache.org:443 2024-06-10T09:22:00.391-0700 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connecting to repo.maven.apache.org/151.101.192.215:443 2024-06-10T09:22:00.391-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Connecting socket to repo.maven.apache.org/151.101.192.215:443 with timeout 30000 2024-06-10T09:22:00.404-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled protocols: [TLSv1.2, TLSv1.3] 2024-06-10T09:22:00.404-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Enabled cipher suites:[TLS_AES_256_GCM_SHA384, TLS_AES_128_GCM_SHA256, TLS_CHACHA20_POLY1305_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_RSA_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256, TLS_DHE_DSS_WITH_AES_256_GCM_SHA384, TLS_DHE_RSA_WITH_AES_128_GCM_SHA256, TLS_DHE_DSS_WITH_AES_128_GCM_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_RSA_WITH_AES_256_CBC_SHA256, TLS_DHE_DSS_WITH_AES_256_CBC_SHA256, TLS_DHE_RSA_WITH_AES_128_CBC_SHA256, TLS_DHE_DSS_WITH_AES_128_CBC_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_RSA_WITH_AES_256_GCM_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_RSA_WITH_AES_128_GCM_SHA256, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA384, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA256, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA256, TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_RSA_WITH_AES_256_CBC_SHA, TLS_DHE_DSS_WITH_AES_256_CBC_SHA, TLS_DHE_RSA_WITH_AES_128_CBC_SHA, TLS_DHE_DSS_WITH_AES_128_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, TLS_RSA_WITH_AES_256_GCM_SHA384, TLS_RSA_WITH_AES_128_GCM_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA256, TLS_RSA_WITH_AES_128_CBC_SHA256, TLS_RSA_WITH_AES_256_CBC_SHA, TLS_RSA_WITH_AES_128_CBC_SHA, TLS_EMPTY_RENEGOTIATION_INFO_SCSV] 2024-06-10T09:22:00.404-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Starting handshake 2024-06-10T09:22:00.420-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] Secure session established 2024-06-10T09:22:00.420-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated protocol: TLSv1.2 2024-06-10T09:22:00.420-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] negotiated cipher suite: TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 2024-06-10T09:22:00.420-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer principal: CN=repo.maven.apache.org 2024-06-10T09:22:00.420-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] peer alternative names: [repo.maven.apache.org] 2024-06-10T09:22:00.420-0700 [DEBUG] [org.apache.http.conn.ssl.SSLConnectionSocketFactory] issuer principal: CN=GlobalSign Atlas R3 DV TLS CA 2023 Q4, O=GlobalSign nv-sa, C=BE 2024-06-10T09:22:00.421-0700 [DEBUG] [org.apache.http.impl.conn.DefaultHttpClientConnectionOperator] Connection established 192.168.50.37:55686<->151.101.192.215:443 2024-06-10T09:22:00.421-0700 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-45: set socket timeout to 30000 2024-06-10T09:22:00.421-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request HEAD /maven2/com/microsoft/sqlserver/mssql-jdbc/maven-metadata.xml HTTP/1.1 2024-06-10T09:22:00.421-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED 2024-06-10T09:22:00.421-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED 2024-06-10T09:22:00.440-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely 2024-06-10T09:22:00.440-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection [id: 45][route: {s}->https://repo.maven.apache.org:443] can be kept alive indefinitely 2024-06-10T09:22:00.440-0700 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-45: set socket timeout to 0 2024-06-10T09:22:00.440-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 45][route: {s}->https://repo.maven.apache.org:443][total available: 1; route allocated: 1 of 20; total allocated: 1 of 20] 2024-06-10T09:22:00.441-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Metadata of https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/maven-metadata.xml' completed 2024-06-10T09:22:00.441-0700 [INFO] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Cached resource https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/maven-metadata.xml is up-to-date (lastModified: Thu May 23 16:53:44 PDT 2024). 2024-06-10T09:22:00.441-0700 [DEBUG] [org.gradle.api.internal.artifacts.repositories.maven.MavenMetadataLoader] parsing maven-metadata: org.gradle.internal.resource.local.DefaultLocallyAvailableExternalResource@1be2bbd8 2024-06-10T09:22:00.442-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.dynamicversions.DefaultModuleVersionsCache] Caching version list in module versions cache: Using '[6.1.0.jre7, 6.1.0.jre8, 6.1.2.jre7-preview, 6.1.2.jre8-preview, 6.1.3.jre7-preview, 6.1.3.jre8-preview, 6.1.4.jre7-preview, 6.1.4.jre8-preview, 6.1.5.jre7-preview, 6.1.5.jre8-preview, 6.1.6.jre7-preview, 6.1.6.jre8-preview, 6.1.7.jre7-preview, 6.1.7.jre8-preview, 6.2.0.jre7, 6.2.0.jre8, 6.2.1.jre7, 6.2.1.jre8, 6.2.2.jre7, 6.2.2.jre8, 6.3.0.jre7-preview, 6.3.0.jre8-preview, 6.3.1.jre7-preview, 6.3.1.jre7-preview-v2, 6.3.1.jre8-preview, 6.3.1.jre8-preview-v2, 6.3.2.jre7-preview, 6.3.2.jre8-preview, 6.3.3.jre7-preview, 6.3.3.jre8-preview, 6.3.4.jre7-preview, 6.3.4.jre8-preview, 6.3.5.jre7-preview, 6.3.5.jre8-preview, 6.3.6.jre7-preview, 6.3.6.jre8-preview, 6.4.0.jre7, 6.4.0.jre8, 6.4.0.jre9, 6.5.0.jre8-preview, 6.5.0.jre9-preview, 6.5.1.jre8-preview, 6.5.1.jre9-preview, 6.5.2.jre8-preview, 6.5.2.jre9-preview, 6.5.3.jre8-preview, 6.5.3.jre10-preview, 6.5.4.jre8-preview, 6.5.4.jre10-preview, 7.0.0.jre8, 7.0.0.jre10, 7.1.0.jre8-preview, 7.1.0.jre10-preview, 7.1.1.jre8-preview, 7.1.1.jre10-preview, 7.1.2.jre8-preview, 7.1.2.jre11-preview, 7.1.3.jre8-preview, 7.1.3.jre11-preview, 7.1.4.jre8-preview, 7.1.4.jre11-preview, 7.2.0.jre8, 7.2.0.jre11, 7.2.1.jre8, 7.2.1.jre11, 7.2.2.jre8, 7.2.2.jre11, 7.3.0.jre8-preview, 7.3.0.jre11-preview, 7.3.1.jre8-preview, 7.3.1.jre11-preview, 7.3.1.jre12-preview, 7.4.0.jre8, 7.4.0.jre11, 7.4.0.jre12, 7.4.1.jre8, 7.4.1.jre11, 7.4.1.jre12, 8.1.0.jre8-preview, 8.1.0.jre11-preview, 8.1.0.jre13-preview, 8.1.1.jre8-preview, 8.1.1.jre11-preview, 8.1.1.jre13-preview, 8.2.0.jre8, 8.2.0.jre11, 8.2.0.jre13, 8.2.1.jre8, 8.2.1.jre11, 8.2.1.jre13, 8.2.2.jre8, 8.2.2.jre11, 8.2.2.jre13, 8.3.0.jre8-preview, 8.3.0.jre11-preview, 8.3.0.jre14-preview, 8.3.1.jre8-preview, 8.3.1.jre11-preview, 8.3.1.jre14-preview, 8.4.0.jre8, 8.4.0.jre11, 8.4.0.jre14, 8.4.1.jre8, 8.4.1.jre11, 8.4.1.jre14, 9.1.0.jre8-preview, 9.1.0.jre11-preview, 9.1.0.jre15-preview, 9.1.1.jre8-preview, 9.1.1.jre11-preview, 9.1.1.jre15-preview, 9.2.0.jre8, 9.2.0.jre11, 9.2.0.jre15, 9.2.1.jre8, 9.2.1.jre11, 9.2.1.jre15, 9.3.0.jre8-preview, 9.3.0.jre11-preview, 9.3.0.jre15-preview, 9.3.1.jre8-preview, 9.3.1.jre11-preview, 9.3.1.jre15-preview, 9.4.0.jre8, 9.4.0.jre11, 9.4.0.jre16, 9.4.1.jre8, 9.4.1.jre8-preview, 9.4.1.jre11, 9.4.1.jre11-preview, 9.4.1.jre16, 9.4.1.jre16-preview, 9.5.0-SNAPSHOT.jre8-preview, 9.5.0-SNAPSHOT.jre11-preview, 9.5.0-SNAPSHOT.jre17-preview, 9.5.0.jre8-preview, 9.5.0.jre11-preview, 9.5.0.jre17-preview, 10.1.0.jre8-preview, 10.1.0.jre11-preview, 10.1.0.jre17-preview, 10.2.0-SNAPSHOT.jre8-preview, 10.2.0-SNAPSHOT.jre11-preview, 10.2.0-SNAPSHOT.jre17-preview, 10.2.0.jre8, 10.2.0.jre11, 10.2.0.jre17, 10.2.1.jre8, 10.2.1.jre11, 10.2.1.jre17, 10.2.2.jre8, 10.2.2.jre8-preview, 10.2.2.jre11, 10.2.2.jre11-preview, 10.2.2.jre17, 10.2.2.jre17-preview, 10.2.3.jre8, 10.2.3.jre11, 10.2.3.jre17, 11.1.0-SNAPSHOT.jre8-preview, 11.1.0-SNAPSHOT.jre11-preview, 11.1.0-SNAPSHOT.jre17-preview, 11.1.0.jre8-preview, 11.1.0.jre11-preview, 11.1.0.jre17-preview, 11.1.1.jre8-preview, 11.1.1.jre11-preview, 11.1.1.jre17-preview, 11.1.1.jre18-preview, 11.1.2.jre8-preview, 11.1.2.jre11-preview, 11.1.2.jre17-preview, 11.1.2.jre18-preview, 11.2.0.jre8, 11.2.0.jre11, 11.2.0.jre17, 11.2.0.jre18, 11.2.1.jre8, 11.2.1.jre11, 11.2.1.jre17, 11.2.1.jre18, 11.2.2.jre8, 11.2.2.jre11, 11.2.2.jre17, 11.2.2.jre18, 11.2.3.jre8, 11.2.3.jre11, 11.2.3.jre17, 11.2.3.jre18, 12.1.0.jre8-preview, 12.1.0.jre11-preview, 12.2.0.jre8, 12.2.0.jre11, 12.3.0.jre8-preview, 12.3.0.jre11-preview, 12.3.0.jre17-preview, 12.3.0.jre20-preview, 12.3.1.jre8-preview, 12.3.1.jre11-preview, 12.4.0.jre8, 12.4.0.jre8-preview, 12.4.0.jre11, 12.4.0.jre11-preview, 12.4.1.jre8, 12.4.1.jre11, 12.4.2.jre8, 12.4.2.jre11, 12.5.0.jre8-preview, 12.5.0.jre11-preview, 12.6.0.jre8, 12.6.0.jre11, 12.6.1.jre8, 12.6.1.jre11, 12.6.2.jre8, 12.6.2.jre11, 12.7.0, 12.7.0.jre8-preview, 12.7.0.jre11-preview]' for 'com.microsoft.sqlserver:mssql-jdbc' 2024-06-10T09:22:00.442-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Cached meta-data for missing module is expired: will perform fresh resolve of 'com.microsoft.sqlserver:mssql-jdbc:12.7.0' in 'MavenRepo' 2024-06-10T09:22:00.443-0700 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.DefaultExternalResourceArtifactResolver] Loading https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom 2024-06-10T09:22:00.443-0700 [DEBUG] [org.gradle.internal.resource.transfer.DefaultCacheAwareExternalResourceAccessor] Constructing external resource: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom 2024-06-10T09:22:00.443-0700 [DEBUG] [org.gradle.internal.resource.transport.http.HttpResourceAccessor] Constructing external resource: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom 2024-06-10T09:22:00.443-0700 [DEBUG] [org.gradle.internal.resource.transport.http.HttpClientHelper] Performing HTTP GET: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.client.protocol.RequestAddCookies] CookieSpec selected: default 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.client.protocol.RequestAuthCache] Auth cache not set in the context 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection request: [route: {s}->https://repo.maven.apache.org:443][total available: 1; route allocated: 1 of 20; total allocated: 1 of 20] 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection leased: [id: 45][route: {s}->https://repo.maven.apache.org:443][total available: 0; route allocated: 1 of 20; total allocated: 1 of 20] 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-45: set socket timeout to 30000 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-45: set socket timeout to 30000 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Executing request GET /maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom HTTP/1.1 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Target auth state: UNCHALLENGED 2024-06-10T09:22:00.443-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Proxy auth state: UNCHALLENGED 2024-06-10T09:22:00.459-0700 [DEBUG] [org.apache.http.impl.execchain.MainClientExec] Connection can be kept alive indefinitely 2024-06-10T09:22:00.460-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection [id: 45][route: {s}->https://repo.maven.apache.org:443] can be kept alive indefinitely 2024-06-10T09:22:00.460-0700 [DEBUG] [org.apache.http.impl.conn.DefaultManagedHttpClientConnection] http-outgoing-45: set socket timeout to 0 2024-06-10T09:22:00.460-0700 [DEBUG] [org.apache.http.impl.conn.PoolingHttpClientConnectionManager] Connection released: [id: 45][route: {s}->https://repo.maven.apache.org:443][total available: 1; route allocated: 1 of 20; total allocated: 1 of 20] 2024-06-10T09:22:00.460-0700 [INFO] [org.gradle.internal.resource.transport.http.HttpClientHelper] Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom] 2024-06-10T09:22:00.460-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Download https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom' completed 2024-06-10T09:22:00.460-0700 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] No meta-data file or artifact found for module 'com.microsoft.sqlserver:mssql-jdbc:12.7.0' in repository 'MavenRepo'. 2024-06-10T09:22:00.460-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.PersistentModuleMetadataCache] Recording absence of module descriptor in cache: com.microsoft.sqlserver:mssql-jdbc:12.7.0 [changing = false] 2024-06-10T09:22:00.460-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder] Flushing resolved configuration data in Binary store in /Users/ben/.gradle/.tmp/gradle4946463772548317961.bin. Wrote root 2. 2024-06-10T09:22:00.461-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve dependencies of :compileClasspath' completed 2024-06-10T09:22:00.461-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.0 secs) from Binary store in /Users/ben/.gradle/.tmp/gradle2833393030218076700.bin offset 0 exists? true 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] \--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] compileOnly - Compile only dependencies for source set 'main'. (n) 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] compileOnlyApi - Compile only API dependencies for source set 'main'. (n) 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] default - Configuration for default artifacts. (n) 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] implementation - Implementation only dependencies for source set 'main'. (n) 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] \--- com.microsoft.sqlserver:mssql-jdbc:+ (n) 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] mainSourceElements - List of source directories contained in the Main SourceSet. (n) 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.461-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] runtimeClasspath - Runtime classpath of source set 'main'. 2024-06-10T09:22:00.461-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver] Resolving configuration ':runtimeClasspath' 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'MavenRepo' [a8be1fe3b3911d3d3425fe720cf42835]. 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Visiting configuration :gradle-versions-sample-groovy:unspecified(runtimeClasspath). 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for com.microsoft.sqlserver:mssql-jdbc:+ using repositories [MavenRepo] 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'com.microsoft.sqlserver:mssql-jdbc:12.7.0' in resolver cache 'MavenRepo' 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder] Flushing resolved configuration data in Binary store in /Users/ben/.gradle/.tmp/gradle4946463772548317961.bin. Wrote root 2. 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve dependencies of :runtimeClasspath' completed 2024-06-10T09:22:00.462-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.0 secs) from Binary store in /Users/ben/.gradle/.tmp/gradle2833393030218076700.bin offset 504 exists? true 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] \--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] runtimeElements - Elements of runtime for main. (n) 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] runtimeOnly - Runtime only dependencies for source set 'main'. (n) 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] testAnnotationProcessor - Annotation processors and their dependencies for source set 'test'. 2024-06-10T09:22:00.463-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve dependencies of :testAnnotationProcessor' completed 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.463-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] testCompileClasspath - Compile classpath for source set 'test'. 2024-06-10T09:22:00.463-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver] Resolving configuration ':testCompileClasspath' 2024-06-10T09:22:00.463-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'MavenRepo' [a8be1fe3b3911d3d3425fe720cf42835]. 2024-06-10T09:22:00.463-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Visiting configuration :gradle-versions-sample-groovy:unspecified(testCompileClasspath). 2024-06-10T09:22:00.463-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for com.microsoft.sqlserver:mssql-jdbc:+ using repositories [MavenRepo] 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'com.microsoft.sqlserver:mssql-jdbc:12.7.0' in resolver cache 'MavenRepo' 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder] Flushing resolved configuration data in Binary store in /Users/ben/.gradle/.tmp/gradle4946463772548317961.bin. Wrote root 2. 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve dependencies of :testCompileClasspath' completed 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.0 secs) from Binary store in /Users/ben/.gradle/.tmp/gradle2833393030218076700.bin offset 1008 exists? true 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] \--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] testCompileOnly - Compile only dependencies for source set 'test'. (n) 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] testImplementation - Implementation only dependencies for source set 'test'. (n) 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] testResultsElementsForTest - Directory containing binary results of running tests for the test Test Suite's test target. (n) 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] No dependencies 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] 2024-06-10T09:22:00.464-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] testRuntimeClasspath - Runtime classpath of source set 'test'. 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.DefaultArtifactDependencyResolver] Resolving configuration ':testRuntimeClasspath' 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.modulecache.ResolvedArtifactCaches] Reusing in-memory cache for repo 'MavenRepo' [a8be1fe3b3911d3d3425fe720cf42835]. 2024-06-10T09:22:00.464-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.graph.builder.DependencyGraphBuilder] Visiting configuration :gradle-versions-sample-groovy:unspecified(testRuntimeClasspath). 2024-06-10T09:22:00.465-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.DynamicVersionResolver] Attempting to resolve version for com.microsoft.sqlserver:mssql-jdbc:+ using repositories [MavenRepo] 2024-06-10T09:22:00.465-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.ivyresolve.CachingModuleComponentRepository] Detected non-existence of module 'com.microsoft.sqlserver:mssql-jdbc:12.7.0' in resolver cache 'MavenRepo' 2024-06-10T09:22:00.465-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.oldresult.TransientConfigurationResultsBuilder] Flushing resolved configuration data in Binary store in /Users/ben/.gradle/.tmp/gradle4946463772548317961.bin. Wrote root 2. 2024-06-10T09:22:00.465-0700 [DEBUG] [org.gradle.internal.operations.DefaultBuildOperationRunner] Build operation 'Resolve dependencies of :testRuntimeClasspath' completed 2024-06-10T09:22:00.465-0700 [DEBUG] [org.gradle.api.internal.artifacts.ivyservice.resolveengine.result.StreamingResolutionResultBuilder$RootFactory] Loaded resolution results (0.0 secs) from Binary store in /Users/ben/.gradle/.tmp/gradle2833393030218076700.bin offset 1516 exists? true 2024-06-10T09:22:00.465-0700 [QUIET] [org.gradle.api.tasks.diagnostics.internal.ReportGenerator] \--- com.microsoft.sqlserver:mssql-jdbc:+ FAILED ```

A Maven project did not have this problem, so it does not appear to be malformed metadata.

Maven POM ```xml 4.0.0 com.example my-maven-project 1.0-SNAPSHOT com.microsoft.sqlserver mssql-jdbc + org.codehaus.mojo versions-maven-plugin 2.8.1 display-dependency-updates ```
Maven's output ```console [INFO] Scanning for projects... [INFO] [INFO] --------------------< com.example:my-maven-project >-------------------- [INFO] Building my-maven-project 1.0-SNAPSHOT [INFO] from pom.xml [INFO] --------------------------------[ jar ]--------------------------------- [INFO] [INFO] --- versions:2.8.1:display-dependency-updates (default-cli) @ my-maven-project --- [INFO] The following dependencies in Dependencies have newer versions: [INFO] com.microsoft.sqlserver:mssql-jdbc ......... + -> 12.7.0.jre11-preview [INFO] [INFO] ------------------------------------------------------------------------ [INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 0.315 s [INFO] Finished at: 2024-06-10T09:32:44-07:00 [INFO] ------------------------------------------------------------------------ ```
ben-manes commented 5 months ago

It looks like it failed on

2024-06-10T09:22:00.460-0700 [INFO] [org.gradle.internal.resource.transport.http.HttpClientHelper] Resource missing. [HTTP GET: https://repo.maven.apache.org/maven2/com/microsoft/sqlserver/mssql-jdbc/12.7.0/mssql-jdbc-12.7.0.pom]

The results do show that the files under that directory are misnamed (mssql-jdbc-12.7.0.jre11-preview.*) which belong in their own version directories. I guess there is a bad release and it halts evaluation early when the repository does not contain the contents according to the maven-metadata.xml versions file. It might be something to take to the mssql-jdbc team for why their release is not conforming to the Maven repository standards.

ben-manes commented 5 months ago

and if I use 12.6.+ then it resolves perfectly!

compileClasspath - Compile classpath for source set 'main'.
\--- com.microsoft.sqlserver:mssql-jdbc:12.6.+ -> 12.6.2.jre11

So there we go. Please open an issue with mssql-jdbc to fix their release process.

ben-manes commented 5 months ago

Looks like when they did their release they forgot to update to the correct naming

<!-- Use -preview for preview release, leave empty for official release. -->
<releaseExt>-preview</releaseExt>

They probably should have this as an env flag instead of a manual change. Their official release has preview in the file names. I'm not sure why Maven itself figures this out, but probably other build tools don't handle it very well and would be surprised in their artifact resolutions. I'd tell them about this since that dependency version is not usable in Gradle.

ben-manes commented 5 months ago

cc @barryw-mssql @tkyc @Jeffery-Wasty

Jeffery-Wasty commented 5 months ago

I think the issue might be that we mistakenly released a 12.7.0 version with incorrect naming, and this is being recognized as the latest version. This is a mistake on our part, and unfortunately, we don't have any way of removing this release. We have a stable release (12.8) planned for July 31st, and plan on releasing a preview (12.7.1) sometime before that, but it looks like the above issue won't be resolved until these versions are released.

EDIT: Actually, now I'm not certain this would resolve things as the issue would continue to exist each time a pre-12.7 release is used. @rob-elsevier please create an issue on our repo so we can track this and work towards a solution (https://github.com/microsoft/mssql-jdbc)

rob-elsevier commented 5 months ago

Thank you @ben-manes and @Jeffery-Wasty really appreciate you digging into this. As requested I have raised the following ticket (pretty much just pointing to this ticket as you have already done a load of research here!!)

https://github.com/microsoft/mssql-jdbc/issues/2445