Add sources and javadocs jars to published artifacts

JCenter requires these
This commit is contained in:
Theo Kanning 2020-10-06 18:14:35 -05:00
parent a893f80b75
commit fe48e8cfc3
3 changed files with 24 additions and 1 deletions

View File

@ -14,10 +14,22 @@ ext {
version = libraryVersion
group = 'com.theokanning.openai-gpt3-java'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
ApiPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId 'api'
version libraryVersion

View File

@ -7,7 +7,6 @@ buildscript {
}
}
allprojects {
repositories {
jcenter()

View File

@ -16,10 +16,22 @@ ext {
version = libraryVersion
group = 'com.theokanning.openai-gpt3-java'
task sourcesJar(type: Jar, dependsOn: classes) {
classifier = 'sources'
from sourceSets.main.allSource
}
task javadocJar(type: Jar, dependsOn: javadoc) {
classifier = 'javadoc'
from javadoc.destinationDir
}
publishing {
publications {
ClientPublication(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
groupId project.group
artifactId 'client'
version libraryVersion