gradle-release-plugin icon indicating copy to clipboard operation
gradle-release-plugin copied to clipboard

unable to release because of local modifications

Open Jorik1977 opened this issue 10 years ago • 7 comments

When I try to release under Windows 7x64 with following configuration:

release { failOnSnapshotDependencies = true allowLocalModifications = false releaseDryRun = false scm = 'git' username = gitUser password = gitPassword }

I receive allways:

"Uncommited changes found in the source tree"

Of course, there are no changes :)

Is the logic hier:

def boolean hasLocalModifications() {
    gitExec(['status', '--porcelain']) != ""
}

correct?

Jorik1977 avatar Mar 31 '14 11:03 Jorik1977

gitExec(['status', '--porcelain']) != null

is probably correct... I think the behaviour changed at some point. I should probably move to jgit when I have a chance...

ari avatar Mar 31 '14 11:03 ari

ok. thanks for response

Jorik1977 avatar Mar 31 '14 11:03 Jorik1977

I also get "Uncommited changes found in the source tree" when building in bash with "gradle release" even though there are no uncommitted changes.

I don't understand your response @ari can you elaborate how to get round this?

@Jorik1977 - did you resolve this?

lewisevans avatar Mar 31 '14 11:03 lewisevans

I use

allowLocalModifications = true

and check git modifications manually :)

Jorik1977 avatar Mar 31 '14 12:03 Jorik1977

Worked a treat, thanks!!

lewisevans avatar Mar 31 '14 12:03 lewisevans

Same problem here Ari.

You are using org.gradle.api.Project.exec which apparently is executing git from the OS. However running git status --porcelain gives me no result which means no uncommitted changes. Not sure if this is something related to how you set the ExecSpec closure?

leoluz avatar Jun 10 '14 15:06 leoluz

I'm having this same issue. I have a brand new repo with 2 files: build.gradle & .gitignore I have master checked out & the version of my master == version of remote master However, when I attempt to run a release, it complains of gradle release -PreleaseVersion=1.0.1 :release FAILED

FAILURE: Build failed with an exception.

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

    Uncommited changes found in the source tree

  • 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: 2.032 secs

greenscar avatar Nov 10 '15 16:11 greenscar