Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Artifactory publishing logic from gradle build #3256

Merged
merged 2 commits into from
Mar 19, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ plugins {
alias(libs.plugins.versions)
alias(libs.plugins.spotbugs)
alias(libs.plugins.nexus)
alias(libs.plugins.artifactory)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be removed from libs.versions.toml now?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh whoops. Definitely meant to remove it the first time. Yeah, it's unreferenced now. Removed

alias(libs.plugins.download)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,6 @@ publishing {
}

}
artifactoryPublish {
publications (publishing.publications.shadow)
}
}

if (Boolean.parseBoolean(centralPublish)) {
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ test-compileOnly = [ "autoService", "jsr305" ]

[plugins]

artifactory = { id = "com.jfrog.artifactory", version = "4.29.2" }
download = { id = "de.undercouch.download", version = "5.6.0" }
gitversion = { id = "com.palantir.git-version", version = "3.1.0" }
jmh = { id = "me.champeau.jmh", version = "0.7.2" }
Expand Down
34 changes: 0 additions & 34 deletions gradle/publishing.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
* limitations under the License.
*/

apply plugin: 'com.jfrog.artifactory'
apply plugin: 'signing'

// Add various details to the pom file to allow for publishing
Expand Down Expand Up @@ -74,17 +73,6 @@ if (ext.publishLibrary) {
}
}
}
artifactoryPublish {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This does mean that build.py will break, but we're not using that anywhere, and plan to remove it very shortly, so that seems fine.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. I've filed #3257 to do just that. Given that build.py is also unused by our build process, I think it's okay if it's broken. Or we remove it first.

// As a safeguard, only actually publish to artifactory if -PpublishBuild=true is passed to gradle
// Note: skip is documented, but onlyIf seems to also be required to make this work for some reason
// See: https://gist.github.com/DALDEI/40925568cef57e16e8a7
def publishBuild = Boolean.parseBoolean(publishBuild)
skip = !publishBuild
onlyIf {
publishBuild
}
publications(publishing.publications.library)
}
createDistribution.configure {
afterEvaluate {
dependsOn generatePomFileForLibraryPublication
Expand Down Expand Up @@ -128,25 +116,3 @@ publishing {
}
}
}

if (System.getenv('ARTIFACTORY_USER') != null && System.getenv('ARTIFACTORY_KEY') != null) {
artifactory {
clientConfig.setIncludeEnvVars(true)
publish {
def artifactoryUrl = System.getenv('ARTIFACTORY_URL') ?: 'https://ossartifacts.jfrog.io/artifactory/'
contextUrl = artifactoryUrl
repository {
repoKey = System.getenv('ARTIFACTORY_REPO') ?: 'fdb-record-layer'
username = System.getenv('ARTIFACTORY_USER')
password = System.getenv('ARTIFACTORY_KEY')
}
defaults {
publications('mavenJava')
publishPom = publishBuild
publishArtifacts = publishBuild
publishBuildInfo = publishBuild
publishIvy = false
}
}
}
}