researchgate / gradle-release

gradle-release is a plugin for providing a Maven-like release process for projects using Gradle
MIT License
867 stars 220 forks source link

Execution failed for task ':createScmAdapter'. #173

Open tdelphi opened 8 years ago

tdelphi commented 8 years ago

I was trying to see how gradle-release plugin works, but got bored after 4 errors..

How to reproduce:

  1. create empty directory and cd to it
  2. run gradle init
  3. uncomment all content to make build.gradle look like that: `/*
    • This build file was auto generated by running the Gradle 'init' task
    • by 'tdelphi' at '6/1/16 11:47 PM' with Gradle 2.2.1
    • This generated file contains a commented-out sample Java project to get you started.
    • For more details take a look at the Java Quickstart chapter in the Gradle
    • user guide available at http://gradle.org/docs/2.2.1/userguide/tutorial_java_projects.html */

plugins { id 'net.researchgate.release' version '2.4.0' }

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

task wrapper(type: Wrapper) { gradleVersion = '2.13' }

// In this section you declare where to find the dependencies of your project repositories { // Use 'jcenter' for resolving your dependencies. // You can declare any Maven/Ivy/file repository here. jcenter() }

// In this section you declare the dependencies for your production and test code dependencies { // The production code uses the SLF4J logging API at compile time compile 'org.slf4j:slf4j-api:1.7.7'

// Declare the dependency for your favourite test framework you want to use in your tests.
// TestNG is also supported by the Gradle Test task. Just change the
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
// 'test.useTestNG()' to your build script.
testCompile "junit:junit:4.11"

}

`

  1. Add "plugins" section
  2. run gradlew release
  3. see error:
gradlew release
:release
:gradle-release:createScmAdapter FAILED
:release FAILED
Release process failed, please remember to revert any uncommitted changes made by the Release Plugin.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':createScmAdapter'.
> No supported Adapter could be found. Are [F:\Work\Java\gradle-release] or its parents are valid scm directories?

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 5.482 secs
  1. run "git init" in that directory
  2. see error: `gradlew release :release :gradle-release:createScmAdapter :gradle-release:initScmAdapter FAILED :release FAILED Release process failed, please remember to revert any uncommitted changes made by the Release Plugin.

FAILURE: Build failed with an exception.

BUILD FAILED

Total time: 5.741 secs`

  1. run "git add build.gradle"
  2. git commit -m"aaa"
[master (root-commit) d9b987a] aaa
 1 file changed, 42 insertions(+)
 create mode 100644 build.gradle

f:\Work\Java\gradle-release (master)
λ gradlew release
:release
:gradle-release:createScmAdapter
:gradle-release:initScmAdapter
:gradle-release:checkCommitNeeded FAILED
:release FAILED
Release process failed, please remember to revert any uncommitted changes made by the Release Plugin.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':checkCommitNeeded'.
> You have unversioned files:

?? .gradle/ ?? build/ ?? gradle/ ?? gradlew ?? gradlew.bat ?? settings.gradle


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 6.109 secs
danez commented 8 years ago

Thanks for the detailed description. I will check this soon

vbauer commented 8 years ago

Any news about this issue?

Hillkorn commented 8 years ago

Hi, like the output is telling you

You have unversioned files:

You have to commit and push all your stuff in order to create a release. If you want to create one with unversioned files, tell it to the plugin by configuration.

Look at the following example where i reproduced your setup. https://github.com/Hillkorn/release-bug

haribachala commented 4 years ago

I also faced same issue, followed below workaround answered on StackOverflow.

git update-index --chmod=+x gradlew git commit

execute above commends in your application.