plugins { id 'io.spring.dependency-management' version '1.0.10.RELEASE' //此处必须是java-library,如果是java则api方法不可用,api可以理解为就是compile,支持传递依赖 id 'java-library' //发布插件 id 'maven-publish' //签名插件 id 'signing' //自动发布到maven中央仓库插件 //https://github.com/Codearte/gradle-nexus-staging-plugin id 'io.codearte.nexus-staging' version '0.22.0' }
group = 'com.hanqunfeng' //SNAPSHOT版本是不支持发布到Maven中央仓库 version = '1.0.3' sourceCompatibility = '1.8'
//如果不希望传递依赖,则使用implementation,传递依赖则使用compile或者api,gradle7后将不再支持compile //注解相关 api 'org.springframework.boot:spring-boot-autoconfigure' api 'org.springframework.boot:spring-boot-configuration-processor'
//json-jackson api 'com.fasterxml.jackson.core:jackson-databind' api 'com.fasterxml.jackson.datatype:jackson-datatype-jdk8' api 'com.fasterxml.jackson.datatype:jackson-datatype-jsr310'
//@Aspect api 'org.aspectj:aspectjweaver'
//Mono Flux api 'io.projectreactor:reactor-core'
//redis-template api 'org.springframework.data:spring-data-redis'
//自动发布到maven中央仓库插件的配置信息 //参考:https://github.com/Codearte/gradle-nexus-staging-plugin nexusStaging { //oss-sonatype的登录用户名和密码 username nexusUser password nexusPassword //重试次数,默认是60次 numberOfRetries 10 //每次重试的间隔时间,单位毫秒,默认2000,按照官网的说明,执行发布时有延迟,需要等待响应,所以建议调整间隔时间,可以减少重试次数,我这里间隔20秒,大约重试1~2次即可完成 delayBetweenRetriesInMillis 20000 // packageGroup = "com.hanqunfeng" //optional if packageGroup == project.getGroup() // stagingProfileId = "yourStagingProfileId" //when not defined will be got from server using "packageGroup" }