From f23745c3ac455dab3c2e43632192d3598b8721f5 Mon Sep 17 00:00:00 2001 From: krrishg Date: Fri, 1 Dec 2023 11:53:05 +0545 Subject: [PATCH] publish to central --- .gitignore | 4 ++- build.gradle | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 75 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index b63da45..78df66b 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,6 @@ bin/ .vscode/ ### Mac OS ### -.DS_Store \ No newline at end of file +.DS_Store +/.idea/ +/gradle.properties diff --git a/build.gradle b/build.gradle index decdc86..0f08bc5 100644 --- a/build.gradle +++ b/build.gradle @@ -1,14 +1,85 @@ plugins { id("java") + id("maven-publish") + id("signing") } group = "com.krrishg" -version = "1.0-SNAPSHOT" +version = "1.0.0" +archivesBaseName = "kimage" + repositories { mavenCentral() + maven { url "https://oss.sonatype.org/content/repositories/snapshots/" } } dependencies { implementation 'commons-io:commons-io:2.8.0' } + +java { + withJavadocJar() + withSourcesJar() +} + +publishing { + publications { + + mavenJava(MavenPublication) { + + groupId = 'com.krrishg' + artifactId = 'kimage' + version = '1.0.0' + from components.java + + pom { + name = 'kimage' + description = 'Image processing tools in java' + url = 'http://gitlab.com/krrishg/kimage' + inceptionYear = '2023' + + licenses { + license { + name = 'The GNU General Public License, Version 3.0' + url = 'https://www.gnu.org/licenses/gpl-3.0.en.html' + } + } + developers { + developer { + id = 'krrishg' + name = 'Krrish Ghimire' + email = 'krrishg@protonmail.com' + } + } + scm { + connection = 'scm:git:git:gitlab.com/krrishg/kimage.git' + developerConnection = 'scm:git:ssh://gitlab.com/krrishg/kimage.git' + url = 'https://gitlab.com/krrishg/kimage' + } + } + } + } + repositories { + maven { + name = "OSSRH" + url = "https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/" + credentials { + username = project.properties["username"] + password = project.properties["password"] + } + } + } +} + + +signing { + sign publishing.publications.mavenJava +} + + +javadoc { + if (JavaVersion.current().isJava9Compatible()) { + options.addBooleanOption('html5', true) + } +}