gradle 打包 Spring boot starter項(xiàng)目

打包上傳到j(luò)center,下面是我的一個(gè)項(xiàng)目的完整build,https://github.com/jiangtj-lab/commonmark-spring-starter

plugins {
    id 'org.springframework.boot' version '2.3.1.RELEASE'
    id 'io.spring.dependency-management' version '1.0.9.RELEASE'
    id 'java-library'
    id 'com.jfrog.bintray' version "1.8.5"
    id 'maven-publish'
}

group = 'com.jiangtj.common'
version = '0.0.9'
sourceCompatibility = '8'

configurations {
    compileOnly {
        extendsFrom annotationProcessor
    }
}

repositories {
    mavenCentral()
}

dependencies {
    api 'com.atlassian.commonmark:commonmark:0.15.2'
    implementation 'org.springframework.boot:spring-boot-starter'
    compileOnly 'org.projectlombok:lombok'
    annotationProcessor 'org.springframework.boot:spring-boot-configuration-processor'
    annotationProcessor 'org.projectlombok:lombok'
    testImplementation 'com.atlassian.commonmark:commonmark-ext-task-list-items:0.15.2'
    testImplementation('org.springframework.boot:spring-boot-starter-test') {
        exclude group: 'org.junit.vintage', module: 'junit-vintage-engine'
    }
}

test {
    useJUnitPlatform()
}

java {
    withJavadocJar()
    withSourcesJar()
}

jar {
    enabled = true
}

javadoc {
    if(JavaVersion.current().isJava9Compatible()) {
        options.addBooleanOption('html5', true)
    }
}

// Create the publication with the pom configuration:
publishing {
    publications {
        maven(MavenPublication) {
            artifactId = project.getName()
            from components.java
            //artifact bootJar
            versionMapping {
                usage('java-api') {
                    fromResolutionOf('runtimeClasspath')
                }
                usage('java-runtime') {
                    fromResolutionResult()
                }
            }
            pom {
                name = 'commonmark-spring-starter'
                description = 'A spring starter wapper for commonmark'
                url = 'https://github.com/jiangtj-lab/commonmark-spring-starter'
                licenses {
                    license {
                        name = 'The Apache License, Version 2.0'
                        url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
                    }
                }
                developers {
                    developer {
                        id = 'jiangtj'
                        name = 'Jiang TJ'
                        email = 'i@dnocm.com'
                    }
                }
                scm {
                    connection = 'scm:git:git://github.com/jiangtj-lab/commonmark-spring-starter.git'
                    developerConnection = 'scm:git:ssh://github.com/jiangtj-lab/commonmark-spring-starter.git'
                    url = 'https://github.com/jiangtj-lab/commonmark-spring-starter'
                }
            }
        }
    }
}

bintray {
    user = project.property('bintray.user')
    key = project.property('bintray.key')
    publications = ['maven']
    pkg {
        repo = 'maven'
        name = 'commonmark-spring-starter'
        userOrg = 'jiangtj'
        licenses = ['Apache-2.0']
        vcsUrl = 'https://github.com/jiangtj-lab/commonmark-spring-starter'
    }
}
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

友情鏈接更多精彩內(nèi)容