Gradle不允许语义版本控制

Gradle不允许语义版本控制,gradle,versioning,Gradle,Versioning,我正在尝试创建一个版本为0.1.1的项目,但gradle构建失败 它总是强迫我使用两位数的版本,比如0.1或0.2 如何摆脱这个 失败:生成失败,出现异常 其中: 生成文件“/xypath/Build.gradle”行:14 出了什么问题: 无法编译生成文件“/xypath/build.gradle” 启动失败: 生成文件“/xypath/build.gradle”:14:意外标记:2@第14行,第15列。 版本=0.1.2 ^ 1错误 我的身材,格雷德尔看起来像这样 // Apply th

我正在尝试创建一个版本为0.1.1的项目,但gradle构建失败

它总是强迫我使用两位数的版本,比如0.1或0.2

如何摆脱这个

失败:生成失败,出现异常

  • 其中: 生成文件“/xypath/Build.gradle”行:14

  • 出了什么问题: 无法编译生成文件“/xypath/build.gradle”

    启动失败: 生成文件“/xypath/build.gradle”:14:意外标记:2@第14行,第15列。 版本=0.1.2 ^

    1错误

我的身材,格雷德尔看起来像这样

// Apply the java plugin to add support for Java
apply plugin: 'java'

version = 0.1.2

// In this section you declare where to find the dependencies of your project
repositories {
    mavenLocal()
    mavenCentral()    
}

// In this section you declare the dependencies for your production and test code
dependencies {

    compile 'com.google.apis:google-api-services-drive:v2-rev157-1.19.1'
    compile "org.apache.tika:tika-parsers:1.7"
    compile 'org.springframework.amqp:spring-rabbit:1.4.3.RELEASE'
    compile 'com.force.api:force-wsc:28.0.0'
    compile 'org.apache.commons:commons-lang3:3.0'
    compile 'org.json:json:20131018'
    compile 'net.oauth.core:oauth:20090617'
    compile 'net.oauth.core:oauth-httpclient4:20090617'
    compile 'net.oauth.core:oauth-consumer:20090617'

}

在检查了gradle上的可用版本后,我可以看到最早的构建版本是0.7,也许你的意思是1.2而不是0.1.2?

gradle只是Groovy<代码>0.1.2在Groovy中是无效的。请尝试使用
“0.1.2”

只是一个简短的解释。0.1在groovy中被解释为一个数字,正如Oliver指出的那样,您需要将0.1.2放在引号中,以便在groovy中将其解释为一个字符串