Skip to content

Instantly share code, notes, and snippets.

@mricciuti
Created October 9, 2023 15:48
Show Gist options
  • Save mricciuti/6d7f3c15383ba07747fca6cb661f7f55 to your computer and use it in GitHub Desktop.
Save mricciuti/6d7f3c15383ba07747fca6cb661f7f55 to your computer and use it in GitHub Desktop.
gradle build config to reproduce artifactory publish error
plugins {
id("com.jfrog.artifactory") version "5.1.10"
java
`ivy-publish`
}
group = "org.example.gradle.publishing"
version = "1.0"
repositories {
mavenCentral()
}
afterEvaluate {
publishing {
publications {
create<IvyPublication>("ivy") {
organisation = "dummy"
artifact(tasks.jar.get().outputs.files.singleFile)
}
}
}
artifactory {
publish {
contextUrl = "https://mycompany.artifactory.com"
repository {
setRepoKey("target_repo")
setUsername("*****") // The publisher user name
setPassword("*****") // The publisher password
this.ivy.artifactLayout = "test-publish/${tasks.jar.get().outputs.files.singleFile.name}"
}
defaults {
publications("ivy")
setPublishArtifacts(true)
setPublishPom(false)
setPublishIvy(false)
}
}
}
tasks.named("artifactoryPublish").configure {
this.dependsOn(this.project.tasks.getByName("jar"))
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment