Could not find metadata maven-metadata.xml in remote

Hi,

My "gradle publish" plugin fails to deploy the artifacts to remote.

The gradle file looks like following -->

repositories {
    maven {
        url "${artifactory_url}/libs-snapshot"
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }
    maven {
        url "${artifactory_url}/libs-release"
        credentials {
            username = "${artifactory_user}"
            password = "${artifactory_password}"
        }
    }
}
publishing {
    repositories {
        maven {
            url "${artifactory_url}/libs-${project.version.endsWith('-SNAPSHOT') ? 'snapshot' : 'release' }"
            credentials {
                username = "${artifactory_user}"
                password = "${artifactory_password}"
            }
        }
    }
}
publishing {
    publications {
        mavenJava(MavenPublication) {
            from components.java
        }
    }
}

And when i do “gradle publish”

I get the following error -->

11:33:16.897 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Sending request: GET http://artifactory101:8081/artifactory/libs-snapshot/com/test/1.0.1-SNAPSHOT/maven-metadata.xml HTTP/1
.1                                                            
11:33:16.959 [DEBUG] [org.apache.http.impl.conn.DefaultClientConnection] Receiving response: HTTP/1.1 404 Not Found
11:33:16.975 [DEBUG] [org.apache.http.impl.client.SystemDefaultHttpClient] Connection can be kept alive indefinitely
11:33:16.991 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection [id: 0][route: {}->http://proxyServer:80->http://artifactory101:8081] can be kept alive indefinitely
11:33:17.006 [DEBUG] [org.apache.http.impl.conn.PoolingClientConnectionManager] Connection released: [id: 0][route: {}->http://proxyServer:80->http://artifactory101:8081][total kept alive: 1; route allocated: 1 of 5; to
tal allocated: 1 of 10]                                       
11:33:17.006 [INFO] [org.gradle.internal.resource.transport.http.HttpClientHelper] Resource missing. [HTTP GET: http://artifactory101:8081/artifactory/libs-snapshot/com/test/1.0.1-SNAPSHOT/maven-m
etadata.xml] 

The version 1.0.0-SNAPSHOT was built using artifactory plugin, and for some reasons we removed it and switched to “gradle publish”. The earlier plugin was executed using “gradle artifactoryPublish”

And this error is stating that it is looking for 1.0.1-SNAPSHOT meta-data.xml file but its not even created in repository

I am quite new to gradle, and there might be something significantly wrong with the way i am perceiving the process, but a few pointers would be appreciated

System information

------------------------------------------------------------
Gradle 2.6
------------------------------------------------------------

Build time:   2015-08-10 13:15:06 UTC
Build number: none
Revision:     233bbf8e47c82f72cb898b3e0a96b85d0aad166e

Groovy:       2.3.10
Ant:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM:          1.8.0_60 (Oracle Corporation 25.60-b23)
OS:           Windows 7 6.1 amd64
1 Like

This isn’t an error. It is just indicating that the maven-metadata.xml doesn’t exist, which will be the case when you are publishing a SNAPSHOT version for the very first time. Subsequent uploads should not display this message since the first publish should create the file.

3 Likes

Can you please explain how to solve this issue? Every time I try to publish I get this error. It will not successfully publish my first attempt or create the metadata, therefore there are no subsequent publishings

Solution: credentials were not properly set

1 Like

How can one gets “subsequent uploads” if the first upload can’t succeed?