Skip to content

Instantly share code, notes, and snippets.

@nowshad-hasan
Created October 6, 2022 02:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nowshad-hasan/af0293e58cd89f159f603058af4686cb to your computer and use it in GitHub Desktop.
Save nowshad-hasan/af0293e58cd89f159f603058af4686cb to your computer and use it in GitHub Desktop.
plugins {
id 'java'
id 'maven-publish'
id 'signing'
}
sourceSets {
main {
java {
srcDirs = ['src']
}
}
}
group 'io.github.nowshad-hasan' // your group id
version '1.0.1'
repositories {
mavenCentral()
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
java {
withJavadocJar()
withSourcesJar()
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId = 'io.github.nowshad-hasan'
artifactId = 'solid-potato'
version = '1.0.1'
from components.java
pom {
name = 'Solid Potato'
description = 'Solid Potato is a fun project which is created to make the tutorial - ' +
'How to Create A Java Library and Publish It To Maven With Gradle-7'
url = 'https://github.com/nowshad-hasan/solid-potato'
inceptionYear = '2022'
licenses {
license {
name = 'MIT License'
url = 'https://opensource.org/licenses/MIT'
}
}
developers {
developer {
id = 'nowshad-hasan'
name = 'Nowshad Hasan'
email = 'nowshadapu@gmail.com'
}
}
scm {
connection = 'scm:git:git:github.com/nowshad-hasan/solid-potato.git'
developerConnection = 'scm:git:ssh://github.com/nowshad-hasan/solid-potato.git'
url = 'https://github.com/nowshad-hasan/solid-potato'
}
}
}
}
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)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment