'JFrog Artifactory returns 404 when trying to PUT a new file with maven 'publishing' plugin
My maven publishing task suddenly started to fail after being successful for more than a year, i am trying to upload an artifact with Gradle's maven 'publish' plugin.
The repository declaration in build.gradle
maven {
name "artifactorySnapshot"
url "https://artifactory.HOSTNAME/artifactory/libs-snapshot-local"
credentials {
username = System.getenv("ARTIFACTORY_USERNAME")
password = System.getenv("ARTIFACTORY_PASSWORD")
}
}
The publication declaration:
publishing {
publications {
publicLib(MavenPublication) {
afterEvaluate {
groupId "groupId"
artifactId archivesBaseName
version = 1.0
artifacts [/path/to/jarfile.jar]
}
}
}
}
Task invokation:
sh "./gradlew :module:submodule:publishPublicLibPublicationToArtifactorySnapshotRepository
I get the following:
Could not PUT 'https://artifactory.HOSTNAME/artifactory/libs-snapshot/path/to/jar.jar'. Received status code 404 from server: Not Found
The frustrating part is that this used to work and just broke all of the sudden.
When i try to upload a testfile manually with curl from the same Jenkins slave node i can do it without problems (i use the same user and pass):
curl -v --user user:pass--data-binary @test.txt -X PUT "https://artifactory.HOSTNAME/artifactory/libs-snapshot-local/path/to/jar.jar"
This returns 200 and i see the test file uploaded.
And the "Hide existence of unauthorized resources" in Artifactory admin is unchecked.
Does anyone have any idea how i could possibly solve this?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
