1 Star 0 Fork 745

donggunche55/mica

forked from 如梦技术/mica 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
publish-jar.gradle 2.87 KB
一键复制 编辑 原始数据 按行查看 历史
如梦技术 提交于 2019-04-14 16:36 +08:00 . :zap:将 mica 版本写入 banner.txt
jar {
afterEvaluate {
manifest {
attributes["Implementation-Title"] = project.name
attributes["Implementation-Version"] = project.version
attributes["Automatic-Module-Name"] = project.name.replace('-', '.') // for Jigsaw
attributes["Created-By"] = "${System.getProperty("java.version")} (${System.getProperty("java.specification.vendor")})"
}
}
}
task sourcesJar(type: Jar) {
archiveClassifier.set('sources')
from sourceSets.main.allSource
}
javadoc {
options {
encoding "UTF-8"
charSet 'UTF-8'
author true
version true
failOnError false
links "http://docs.oracle.com/javase/8/docs/api"
}
}
task javadocJar(type: Jar) {
archiveClassifier.set('javadoc')
from 'build/docs/javadoc'
}
artifacts {
archives sourcesJar
archives javadocJar
}
tasks.whenTaskAdded { task ->
if (task.name.contains('signMavenJavaPublication')) {
task.enabled = new File(project.property('signing.secretKeyRingFile') as String).isFile()
}
}
publishing {
repositories {
maven {
url = version.endsWith('SNAPSHOT') ? REPOSITORY_URL_SNAPSHOT : REPOSITORY_URL_RELEASE
credentials {
username getRepositoryUsername()
password getRepositoryPassword()
}
}
}
publications {
mavenJava(MavenPublication) {
from components.java
artifact sourcesJar
artifact javadocJar
pom {
name = POM_NAME
description = POM_DESCRIPTION
url = GIT_URL
scm {
connection = GIT_SCM_CONNECTION
developerConnection = GIT_SCM_CONNECTION
url = GIT_URL
}
licenses {
license {
name = LICENSE_NAME
url = LICENSE_URL
}
}
developers {
developer {
name = DEVELOPER_NAME
email = DEVELOPER_EMAIL
}
}
withXml {
def root = asNode()
root.dependencies.'*'.findAll {
def d = it
d.scope.text() == 'runtime' && project.configurations
.findByName("implementation").allDependencies.find { dep ->
dep.name == it.artifactId.text()
}.each() {
d.scope*.value = 'compile'
d.appendNode('optional', true)
}
}
}
}
}
}
signing {
sign publishing.publications.mavenJava
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/donggunche55/mica.git
git@gitee.com:donggunche55/mica.git
donggunche55
mica
mica
master

搜索帮助