如果没有什么错误(我是遇到问题了,一会再说)就可以显示执行结果,过程需要输入This release version: 和 Enter the next version ,这个根据实现情况输入就可以了。如果是使用IntelliJ Idea 这种集成工具执行,需要在gradle.properties 文件中加入 version=1.3-SNAPSHOT 执行结果如下:
Microsoft Windows [版本 6.3.9600] (c) 2013 Microsoft Corporation。保留所有权利。
D:\git\gradle-test>gradle release profile:"dev" :release profile:"dev" :gradle-test:createScmAdapter :gradle-test:initScmAdapter :gradle-test:checkCommitNeeded !!WARNING!! You have unversioned files: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ?? .gradle/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ !!WARNING!! You have uncommitted files: ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ M build.gradle M libraries.gradle D src/main/java/cn/myplus/config/MyPlusConfigureDevImpl.java M src/main/java/cn/myplus/config/MyPlusConfigureImpl.java D src/main/java/cn/myplus/config/MyPlusConfigureProductionImpl.java D src/main/java/cn/myplus/config/MyPlusConfigureTestImpl.java A src/main/resources/dev/myplus.properties A src/main/resources/pro/myplus.properties A src/main/resources/test/myplus.properties ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ :gradle-test:checkUpdateNeeded :gradle-test:unSnapshotVersion > Building 0% > :release > :gradle-test:confirmReleaseVersion ??> This release version: [1.1] 1.2 :gradle-test:confirmReleaseVersion :gradle-test:checkSnapshotDependencies :gradle-test:runBuildTasks profile:"dev" :gradle-test:beforeReleaseBuild UP-TO-DATE :gradle-test:compileJava :gradle-test:processResources :gradle-test:classes :gradle-test:jar :gradle-test:assemble :gradle-test:compileTestJava :gradle-test:processTestResources UP-TO-DATE :gradle-test:testClasses :gradle-test:test :gradle-test:check :gradle-test:build :gradle-test:afterReleaseBuild UP-TO-DATE :gradle-test:preTagCommit Running [git, commit, -a, -m, [Gradle Release Plugin] - pre tag commit: '1.2'.] produced an error: [warning: LF will be replaced by CRLF in build.gradle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in libraries.gradle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in build.gradle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in libraries.gradle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in libraries.gradle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in build.gradle. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in libraries.gradle. The file will have its original line endings in your working directory.] :gradle-test:createReleaseTag > Building 0% > :release > :gradle-test:updateVersion ??> Enter the next version (current one released as [1.2]): [1.3-SNAPSHOT] :gradle-test:updateVersion :gradle-test:commitNewVersion
Running [git, remote, update] produced an error: [bash: /dev/tty: No such device or address error: failed to execute prompt script (exit code 1) fatal: could not read Username for 'https://git.oschina.net': Invalid argument error: Could not fetch origin]