mirror of
https://gitee.com/y_project/RuoYi-Cloud.git
synced 2026-02-06 08:51:58 +08:00
gradle支持
This commit is contained in:
44
build-config/build-publish.gradle
Normal file
44
build-config/build-publish.gradle
Normal file
@@ -0,0 +1,44 @@
|
||||
apply plugin: "maven-publish"
|
||||
|
||||
task sourcesJar(type: Jar) {
|
||||
from sourceSets.main.allJava
|
||||
archiveClassifier = "sources"
|
||||
}
|
||||
publishing {
|
||||
|
||||
publications {
|
||||
maven(MavenPublication) {
|
||||
artifactId "${archivesBaseName}"
|
||||
version project.version
|
||||
//如果是war包填写components.web,如果是jar包填写components.java
|
||||
from components.java
|
||||
artifact sourcesJar
|
||||
}
|
||||
mavenJava(MavenPublication) {
|
||||
versionMapping {
|
||||
usage("java-api") {
|
||||
fromResolutionOf("runtimeClasspath")
|
||||
}
|
||||
usage("java-runtime") {
|
||||
fromResolutionResult()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
repositories {
|
||||
maven {
|
||||
//指定要上传的maven私服仓库
|
||||
def releasesRepoUrl = "http://192.168.8.200:8081/repository/releases"
|
||||
def snapshotsRepoUrl = "http://192.168.8.200:8081/repository/snapshots/"
|
||||
url = version.endsWith("SNAPSHOT") ? snapshotsRepoUrl : releasesRepoUrl
|
||||
println "${group} ${archivesBaseName} publishing version is ${version}"
|
||||
//认证用户和密码
|
||||
credentials {
|
||||
username "developer"
|
||||
password "dev123"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user