1 Star 0 Fork 6

tukela/doudada-components

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
build.gradle 4.68 KB
一键复制 编辑 原始数据 按行查看 历史
这么难演 提交于 2022-10-14 10:20 . feat: log4j2 compile
// 编译脚本
buildscript {
ext {
depVersion = [
springBoot: "2.6.11",
lombok : "1.18.24",
junit : "5.9.0"
]
}
// 仓库配置
repositories {
mavenCentral()
maven { url 'https://maven.aliyun.com/repository/central' }
maven { url 'https://maven.aliyun.com/repository/spring' }
maven { url 'https://maven.aliyun.com/repository/google' }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:${depVersion.springBoot}")
}
}
allprojects {
group "cool.doudou"
version "1.0.0-SNAPSHOT"
}
// 子模块配置
subprojects {
apply plugin: 'java-library'
apply plugin: 'maven-publish'
apply plugin: 'signing'
apply plugin: 'io.spring.dependency-management'
// 仓库配置
repositories {
mavenLocal()
mavenCentral()
maven { url "https://maven.aliyun.com/repository/central" }
maven { url "https://maven.aliyun.com/repository/spring" }
maven { url "https://maven.aliyun.com/repository/google" }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
}
configurations {
all*.exclude group: "spring-boot-starter-logging"
all*.exclude module: "spring-boot-starter-tomcat"
}
// 依赖管理
dependencyManagement {
imports {
mavenBom "org.springframework.boot:spring-boot-dependencies:${depVersion.springBoot}"
}
}
dependencies {
// log4j2
compileOnly "org.springframework.boot:spring-boot-starter-log4j2"
// lombok
compileOnly "org.projectlombok:lombok:${depVersion.lombok}"
annotationProcessor "org.projectlombok:lombok:${depVersion.lombok}"
// junit
testImplementation "org.junit.jupiter:junit-jupiter:${depVersion.junit}"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
classifier = 'sources'
}
task javadocJar(type: Jar, dependsOn: javadoc) {
from javadoc
classifier = 'javadoc'
}
// 解决javadoc打包乱码
javadoc {
options.encoding = "UTF-8"
options.charSet = "UTF-8"
options.author = true
options.version = true
}
publishing {
publications {
mavenJava(MavenPublication) {
groupId project.group
artifactId project.name
version "${version}"
// components.java jar包 || components.auth war包
from components.java
artifact sourcesJar
artifact javadocJar
// 添加 pom 相关信息
// https://docs.gradle.org/current/dsl/org.gradle.api.publish.maven.MavenPublication.html
pom {
name = "doudada-components"
description = "豆搭搭 组件库"
url = "https://gitee.com/celery-doudou/doudada-components"
licenses {
license {
name = "The Apache License, Version 2.0"
url = "http://www.apache.org/licenses/LICENSE-2.0.txt"
}
}
developers {
developer {
id = "jiangcs"
name = "这么诚实"
email = "jiangchengshi@gmail.com"
}
}
// 版本控制仓库地址
scm {
url = 'https://gitee.com/celery-doudou/doudada-components.git'
// 用于发布的链接
connection = 'scm:git:https://gitee.com/celery-doudou/doudada-components.git'
// 用于指定开发者
developerConnection = 'scm:git:https://gitee.com/celery-doudou/doudada-components.git'
}
}
}
}
repositories {
maven {
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
credentials {
username = sonatypeUsername
password = sonatypePassword
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/tukela/doudada-components.git
git@gitee.com:tukela/doudada-components.git
tukela
doudada-components
doudada-components
dev-1.x

搜索帮助