加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
publish.gradle 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
azheng 提交于 2019-10-14 12:26 . 0.0.5
apply plugin: 'maven-publish'
apply plugin: 'signing'
javadoc {
options.addStringOption("charset", "UTF-8")
}
tasks.withType(JavaCompile) {
options.encoding = "UTF-8"
}
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = 'sources'
}
task javadocJar(type: Jar) {
from javadoc
archiveClassifier = 'javadoc'
}
publishing {
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
// 构件名称
// 区别于artifactId,可以理解为artifactName
name = 'zuji-jpa'
// 构件描述
description = 'To solve complex dynamic SQL'
// 构件主页
url = 'https://zuji-jpa.spring-data-jpa.top'
// 许可证名称和地址
licenses {
license {
name = 'The Apache License, Version 2.0'
url = 'http://www.apache.org/licenses/LICENSE-2.0.txt'
}
}
// 开发者信息
developers {
developer {
name = 'azheng'
email = '18055661285@163.com'
}
}
// 版本控制仓库地址
scm {
url = 'https://github.com/azhengZJ/zuji-jpa'
connection = 'scm:git:git://github.com/azhengZJ/zuji-jpa.git'
developerConnection = 'scm:git:ssh://git@github.com:azhengZJ/zuji-jpa.git'
}
}
}
}
// 定义发布到哪里
repositories {
maven {
def releasesRepoUrl = "https://oss.sonatype.org/service/local/staging/deploy/maven2"
def snapshotsRepoUrl = "https://oss.sonatype.org/content/repositories/snapshots"
url = version.endsWith('SNAPSHOT') ? snapshotsRepoUrl : releasesRepoUrl
credentials {
username sonatypeUsername
password sonatypePassword
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化