我試圖通過此Gradle插件https://github.com/TheBoegl/gradle-launch4j使用http://launch4j.sourceforge.net/。Gradle任務不執行其依賴項
當我做gradle clean launch4j
我得到以下輸出。
:clean
:compileJava
:processResources UP-TO-DATE
:classes
:jar
:copyL4jLib
:generateXmlConfig
:createExeWithBin SKIPPED
:unzipL4jBin
:copyL4jBinLib
:createExeWithJar FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':createExeWithJar'.
> meta-tagger.exe not created:
launch4j: Icon doesn't exist.
我不明白爲什麼copyResources沒有運行。很明顯:copyL4jLib被執行。 Gradle不應該知道copyResources先於它並且先執行它嗎?
這是我的gradle -version信息。
Gradle 2.10
Build time: 2015-12-21 21:15:04 UTC
Build number: none
Revision: 276bdcded730f53aa8c11b479986aafa58e124a6
Groovy: 2.4.4
Ant: Apache Ant(TM) version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_66 (Oracle Corporation 25.66-b18)
OS: Windows 7 6.1 amd64
這裏是我的構建腳本。
plugins {
id 'edu.sc.seis.launch4j' version '1.6.1'
id 'java'
}
repositories {
mavenLocal()
mavenCentral()
jcenter()
}
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
task copyResources(type: Copy) {
from 'src/main/wrapper-resources/'
into 'build/launch4j'
}
copyL4jLib {
dependsOn copyResources
}
launch4j {
mainClassName = 'com.mpinnegar.Main'
icon = 'favicon.ico'
headerType = 'console'
errTitle = 'Image Tagger'
stayAlive = true
}
tasks.copyL4jLib.dependsOn copyResources