7

i'm looking to release a stand-alone patch without committing it. when i prepare a release for a version i get the following error:[ERROR] fatal: Not a git repository (or any of the parent directories): .git

can i release without committing?

for now, what i'm doing is generate a jar locally and upload it manually as an artifact.

1
  • By the way, I had this very same error when trying to commit (in contrary to your intentions, I did want to commit and push to the remote git). In my case, the error was caused due to a bug in the plugin (at least, org.apache.maven.plugins:maven-release-plugin:2.0.0), where it tried to cd into a directory out of the local git repo. I have fixed the problem setting plugin version explicitly to a version 2.5.1. Commented Feb 5, 2015 at 10:32

2 Answers 2

21

I had the same issue with mercurial. You need to use the -DpushChanges=false argument.

See my anwser to a similar question: link

Sign up to request clarification or add additional context in comments.

2 Comments

This still makes the commits without pushing, so you have to reset your local branch to the pre-prepared state. Any way to get around that?
if you're doing a batch job with git, you could add these commands: git reset HEAD~2 --hard && git clean
9

If you don't want to commit anything to the SCM, I think you should try do to a dry run :

Since the Release Plugin performs a number of operations that change the project, it may be wise to do a dry run before a big release or on a new project. To do this, commit all of your files as if you were about to run a full release and run:
mvn release:prepare -DdryRun=true

This is a parameter of the release:prepare Mojo : dryRun.

5 Comments

thanks, that's not exactly what i thought i'd find but it's sure as hell close enough :)
Can you do a release:perform after this to publish without committing any changes?
The doc (maven.apache.org/maven-release/maven-release-plugin/…) says : Dry run: don't checkout anything from the scm repository, or modify the checkout. The goals (by default at least deploy) will not be executed.
And the goals make reference to maven.apache.org/maven-release/maven-release-plugin/…. So I guess there will be nothing deployed (distributed) on a repository.
This doesn't work if your requirement is that it also pushes to the artifact repository.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.