RuoYi-Cloud/build-config/build-publish.gradle

33 lines
881 B
Groovy
Raw Normal View History

2020-12-15 20:21:23 +08:00
apply plugin: "maven-publish"
group = "com.ruoyi"
archivesBaseName = "${project.name}"
2020-12-15 20:21:23 +08:00
task sourcesJar(type: Jar) {
from sourceSets.main.allJava
archiveClassifier = "sources"
}
2020-12-18 13:28:13 +08:00
publishing.publications {
mavenJava(MavenPublication) {
artifactId "${archivesBaseName}"
version project.version
//如果是war包填写components.web如果是jar包填写components.java
from components.java
artifact sourcesJar
2020-12-15 20:21:23 +08:00
}
2020-12-18 13:28:13 +08:00
}
2020-12-15 20:21:23 +08:00
2020-12-18 13:28:13 +08:00
publishing.repositories {
maven {
2020-12-23 14:15:26 +08:00
def releasesRepoUrl = "${repoUrl}/releases"
def snapshotsRepoUrl = "${repoUrl}/snapshots/"
2020-12-18 13:28:13 +08:00
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
println "${group} ${archivesBaseName} publishing version is ${version}"
credentials {
username "developer"
password "dev123"
2020-12-15 20:21:23 +08:00
}
}
}