【发布时间】:2015-04-16 22:47:32
【问题描述】:
我编写了一个 gradle 脚本,在其中创建 zip 和 war 文件,然后我需要将其上传/发布到工件,但问题是我在工件任务中指定了 war 文件,即使之后它正在将所有内容发布到Artifactory zip、tar 和 war 而不仅仅是 war 文件。
apply plugin: 'war'
apply plugin: 'java'
apply plugin: 'distribution'
//-- set the group for publishing
group = 'com.xxx.discovery'
/**
* Initializing GAVC settings
*/
def buildProperties = new Properties()
file("version.properties").withInputStream {
stream -> buildProperties.load(stream)
}
//add the jenkins build version to the version
def env = System.getenv()
if (env["BUILD_NUMBER"]) buildProperties.coveryadBuildVersion += "_${env["BUILD_NUMBER"]}"
version = buildProperties.coveryadBuildVersion
println "${version}"
//name is set in the settings.gradle file
group = "com.aaa.covery"
version = buildProperties.discoveryadBuildVersion
println "Building ${project.group}:${project.name}:${project.version}"
repositories {
maven {
url "http://cxxxxt.tshaaaaa.tho.com:9000/artifactory/libselease"
}
maven {
url "http://cxxxxt.tshaaa.tho.com:9000/artifactory/cache"
}
}
dependencies {
compile ([
"com.uters.omni:HermesSessionAPI:1.2",
"com.uters.proxy:ProxyResources:1.1",
"com.uters.omni:SeshataDirectory:1.0.1" ,
"com.euters.omni:CybeleInfrastructure:1.1.2",
"com.euters:JSONBus:1.4.1",
"javaee:javaee-api:5"
])
}
distributions {
main {
contents {
from {
war.outputs
}
}
}
}
// for publishing to artifactory
artifacts {
archives war
}
【问题讨论】:
-
这是你的完整剧本吗?似乎缺少某些部分(例如,
publishArchives配置、ZIP/TAR 创建等)。 -
是的,这是我的完整脚本,基本上是 distrubiton 插件创建了 zip 和 tar 文件。我正在使用基本上创建 war 文件的 war 文件
标签: gradle build.gradle artifactory gradle-plugin