mirror of
https://github.com/Melledy/Grasscutter.git
synced 2024-11-22 07:37:43 +00:00
Publish to Maven central
This commit is contained in:
parent
e27bdd9bb6
commit
c9299d8444
76
build.gradle
76
build.gradle
@ -12,11 +12,22 @@ plugins {
|
|||||||
|
|
||||||
// Apply the application plugin to add support for building a CLI application
|
// Apply the application plugin to add support for building a CLI application
|
||||||
id 'application'
|
id 'application'
|
||||||
|
|
||||||
|
id 'maven-publish'
|
||||||
|
id 'signing'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
group = 'tech.xigam'
|
||||||
|
version = '1.0.0-dev'
|
||||||
|
|
||||||
sourceCompatibility = 17
|
sourceCompatibility = 17
|
||||||
targetCompatibility = 17
|
targetCompatibility = 17
|
||||||
|
|
||||||
|
java {
|
||||||
|
withJavadocJar()
|
||||||
|
withSourcesJar()
|
||||||
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
@ -64,3 +75,68 @@ jar {
|
|||||||
destinationDir = file(".")
|
destinationDir = file(".")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
publishing {
|
||||||
|
publications {
|
||||||
|
mavenJava(MavenPublication) {
|
||||||
|
artifactId = 'grasscutter'
|
||||||
|
from components.java
|
||||||
|
versionMapping {
|
||||||
|
usage('java-api') {
|
||||||
|
fromResolutionOf('runtimeClasspath')
|
||||||
|
}
|
||||||
|
usage('java-runtime') {
|
||||||
|
fromResolutionResult()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pom {
|
||||||
|
name = 'Grasscutter'
|
||||||
|
description = 'A server software reimplementation for an anime game.'
|
||||||
|
url = 'https://github.com/Grasscutters/Grasscutter'
|
||||||
|
licenses {
|
||||||
|
license {
|
||||||
|
name = 'The Apache License, Version 2.0'
|
||||||
|
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
developers {
|
||||||
|
developer {
|
||||||
|
id = 'melledy'
|
||||||
|
name = 'Melledy'
|
||||||
|
email = 'melledy@xigam.tech' // not a real email kek
|
||||||
|
}
|
||||||
|
developer {
|
||||||
|
id = 'magix'
|
||||||
|
name = 'Magix'
|
||||||
|
email = 'magix@xigam.tech'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
scm {
|
||||||
|
connection = 'scm:git:git@github.com:Grasscutters/Grasscutter.git'
|
||||||
|
developerConnection = 'scm:git:ssh://github.com:Grasscutters/Grasscutter.git'
|
||||||
|
url = 'https://github.com/Grasscutters/Grasscutter'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
maven {
|
||||||
|
// change URLs to point to your repos, e.g. http://my.org/repo
|
||||||
|
def releasesRepoUrl = 'https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/'
|
||||||
|
def snapshotsRepoUrl = 'https://s01.oss.sonatype.org/content/repositories/snapshots/'
|
||||||
|
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
|
||||||
|
|
||||||
|
name = 'sonatype'
|
||||||
|
credentials(PasswordCredentials)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
signing {
|
||||||
|
sign publishing.publications.mavenJava
|
||||||
|
}
|
||||||
|
|
||||||
|
javadoc {
|
||||||
|
if(JavaVersion.current().isJava9Compatible()) {
|
||||||
|
options.addBooleanOption('html5', true)
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user