Quantcast
Channel: Gradle Forums - Latest posts
Viewing all articles
Browse latest Browse all 19859

Gradle 1.12 mentions needed jar but does not download it nor put it onto the CLASSPATH

$
0
0

Hate to post a question for such an ancient version of Gradle, but upgrading is on the pile of tech debt over there ==>

We use a plugin to provide build functionality adapted from our Ant/Ivy builds. Part of what the plugin does is resolve and publish artifacts. We recently migrated from an on-prem version of Artifactory to a SaaS version, which requires credentials. As such, the plugin was modified for the new URL and credentials. The project.repositories block addresses two repos, one for our locally-generated artifacts (ivy), the other for 3rd party jars (maven). It looks like this:

            project.repositories {
                    ivy {
                            name "gid-only"
                            url "${artifactoryURL}/gid-only"
                            layout "pattern", {
                                    ivy "[organization]/[module]/ivy-[revision].xml"
                                    ivy "[organization]/[module]/[revision]/ivy.xml"
                                    artifact "[organisation]/[module]/[revision]/[type]/[artifact]-[revision].[ext]"
                                    artifact "[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"
                                    artifact "[organisation]/[module]/[revision]/[organisation]-[artifact]-[revision].[ext]"
                            }
                            credentials {
                                    username System.getenv("ARTIFACTORY_USERNAME")
                                    password System.getenv("ARTIFACTORY_PASSWORD")
                            }

                    }
                    maven {
                            name "maven-repos"
                            url "${artifactoryURL}/maven-repos"
                            credentials {
                                    username System.getenv("ARTIFACTORY_USERNAME") 
                                    password System.getenv("ARTIFACTORY_PASSWORD") 
                            }
                    }

When I run a build with this configuration, the debug log mentions a a needed jar several times:

12:33:36.842 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] Loading https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar
12:33:36.843 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.HttpResourceAccessor] Constructing external resource metadata: https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar
12:33:36.844 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.HttpClientHelper] Performing HTTP HEAD: https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar
12:33:36.851 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: HEAD /gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar HTTP/1.1
12:33:36.851 [DEBUG] [org.apache.http.headers] >> HEAD /gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar HTTP/1.1
12:33:36.979 [INFO] [org.gradle.api.internal.externalresource.transport.http.HttpClientHelper] Resource missing. [HTTP HEAD: https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar]
12:33:36.979 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] Resource not reachable for com.google.guava:guava:15.0:guava.jar: res=MissingResource: https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/jar/guava-15.0.jar
12:33:36.980 [DEBUG] [org.gradle.api.internal.artifacts.repositories.resolver.ExternalResourceResolver] Loading https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/guava-15.0.jar
12:33:36.981 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.HttpResourceAccessor] Constructing external resource metadata: https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/guava-15.0.jar
12:33:36.981 [DEBUG] [org.gradle.api.internal.externalresource.transport.http.HttpClientHelper] Performing HTTP HEAD: https://gapinc.jfrog.io/gapinc/gid-only/com.google.guava/guava/15.0/guava-15.0.jar
12:33:37.313 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: HEAD /gapinc/gid-only/com.google.guava/guava/15.0/guava-15.0.jar HTTP/1.1
12:33:37.315 [DEBUG] [org.apache.http.headers] >> HEAD /gapinc/gid-only/com.google.guava/guava/15.0/guava-15.0.jar HTTP/1.1
12:33:37.422 [DEBUG] [org.apache.http.headers] << X-Artifactory-Filename: guava-15.0.jar
12:33:37.422 [DEBUG] [org.apache.http.headers] << Content-Disposition: attachment; filename=“guava-15.0.jar”; filename*=UTF-8’'guava-15.0.jar

However, it never downloads the jar and puts it onto the CLASSPATH, resulting in a compilation error.

The dependency declaration looks like this:

[ group: ‘com.google.guava’, name: ‘guava’, version: “15.0”, configuration: ‘compile(*)’],

If I change the “configuration” declaration to ", configuration ‘*’, it does download the jar and adds it to the CLASSPATH. The problem is, this used to work prior to the SaaS migration, and I have literally hundreds of build.gradle files that would need to be modified as such if I take that approach. I would prefer not to do that but, rather, get it working by modifying the plugin as necessary.

Thanks for any advice anyone can render!

Tim


Viewing all articles
Browse latest Browse all 19859

Trending Articles