我使用Gradle作爲我的構建配置工具。我正在Windows桌面上進行開發,但實際的分發將在Linux上運行。Gradle distZip任務在Windows上執行,但在Linux上運行
當我運行'distZip'任務時,它會生成一個zip文件,其中包含一個.bat文件,該文件在Windows上運行良好,但在Linux上運行不正常。
有沒有辦法配置Gradle,以便它會創建一個Linux兼容的腳本?
這裏是我的build.gradle文件:
buildscript {
repositories {
maven { url "http://repo.spring.io/libs-snapshot" }
mavenLocal()
}
dependencies {
classpath("org.springframework.boot:spring-boot-gradle-plugin:1.0.0.RC3")
}
}
apply plugin: 'java'
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'spring-boot'
jar {
baseName = 'gs-rest-service'
version = '0.1.0'
}
repositories {
mavenCentral()
maven { url "http://repo.spring.io/libs-snapshot" }
}
mainClassName="com.RestfulServer.Application"
dependencies {
compile("org.springframework.boot:spring-boot-starter-web")
compile("com.fasterxml.jackson.core:jackson-databind")
compile 'org.slf4j:slf4j-api:1.7.6'
compile 'ch.qos.logback:logback-classic:1.1.1'
compile 'ch.qos.logback:logback-core:1.1.1'
// Local file dependencies
compile files('libraries/AWS/aws-java-sdk-1.7.2.jar',
'libraries/AWS/third-party/joda-time-2.2/joda-time-2.2.jar',
'libraries/AWS/third-party/httpcomponents-client-4.2.3/httpclient-4.2.3.jar',
'libraries/AWS/third-party/httpcomponents-client-4.2.3/httpcore-4.2.jar')
testCompile("junit:junit")
}
task wrapper(type: Wrapper) {
gradleVersion = '1.11'
}
顯示你的build.gradle文件... – fge