Gradle不允许进行语义版本控制



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

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

如何摆脱这种情况?

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

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

  • 哪里出了问题:无法编译生成文件"/xypath/build.gradle"。

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

    1个错误

我的build.gradle看起来像这个

// 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只是Groovy;0.1.2在Groovy中不是一个有效的东西。请改用"0.1.2"

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

最新更新