Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Execution failed for task ':createScmAdapter'. #173

Open
tdelphi opened this issue Jun 1, 2016 · 4 comments
Open

Execution failed for task ':createScmAdapter'. #173

tdelphi opened this issue Jun 1, 2016 · 4 comments

Comments

@tdelphi
Copy link

tdelphi commented Jun 1, 2016

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"

}

`
4. Add "plugins" section
5. run gradlew release
6. 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.

  • What went wrong:
    Execution failed for task ':initScmAdapter'.

    Cannot invoke method trim() on null object

  • 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.741 secs`
9. run "git add build.gradle"
10. 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
Copy link
Contributor

danez commented Jun 1, 2016

Thanks for the detailed description. I will check this soon

@vbauer
Copy link

vbauer commented Jul 31, 2016

Any news about this issue?

@Hillkorn
Copy link
Collaborator

Hillkorn commented Aug 1, 2016

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
Copy link

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.

matanki-saito added a commit to matanki-saito/pdx-txt-java that referenced this issue Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants