danielflower / multi-module-maven-release-plugin

A maven release plugin that is fast, does not add extra commits, and works well with single or multiple modules
http://danielflower.github.io/multi-module-maven-release-plugin/index.html
MIT License
125 stars 64 forks source link

jgit complains on fantom dirty changes, how to configure jgit through releaser plugin? #6

Closed bignewdev closed 9 years ago

bignewdev commented 9 years ago

I am running releaser:release and have an error: [INFO] ------------------------------------------------------------------------ [INFO] [INFO] --- multi-module-maven-release-plugin:1.2.0:release (default-cli) @ ... [ERROR] [ERROR] [ERROR] [ERROR] **** [ERROR] Could not execute the release plugin [ERROR] **** [ERROR] [ERROR] [ERROR] Cannot release with uncommitted changes. Please check the following files: [ERROR] * .gitignore [ERROR] * pom.xml [ERROR] Please commit or revert these changes before releasing. [ERROR] git status shows all clean. Some maven plugins allow to pass parameters to jgit like:

pom.xml warning how to do similar (or somehow configure jgit) with releaser plugin?
danielflower commented 9 years ago

Hi there - that's very weird. I've not managed to reproduce that - any idea on what causes those to be marked as having changes?

stromnet commented 9 years ago

I got a similar problem, where the plugin asks me to check two files which are symlinks to real files in the same directory.

Removing the symlinks will yield the same error (which is now correct, since they have been deleted but not commited).

Commiting the removed symlinks resolve the error and I can continue with the release.

danielflower commented 9 years ago

I'm not sure what the behaviour with symlinks is supposed to be. For this kind of thing, the plugin just relies on jgit - do you think this is a bug in jgit? In fact, do you consider this to be a bug?

stromnet commented 9 years ago

The symlinks where committed to git, so they where not unstaged changes at least. So yes, I'd consider it a bug. But yeah, probably in jgit; LocalGitRepo just calls isClean it seems? The symlinks are listed from the getUncommitedChanges() list.

stromnet commented 9 years ago

Actually, with jgit 4.0.1.201506240215-r it seems to be fixed! 3.7.1.201504261725-r still has the issue though.

Not sure if there are any incompabilities with 4.0, but it seems to work. All test cases succeeded!

danielflower commented 9 years ago

That's excellent. I won't be able to release it until tomorrow unfortunately.

Thanks a lot for tracking down the problem.

stromnet commented 9 years ago

Note that this may or may not fix the original poster's issues, I only had the symlink related issue.

danielflower commented 9 years ago

Released version 1.2.2 to hopefully fix this. Can you let me know if it works now?

Thanks again.

stromnet commented 9 years ago

Symlinks seems to work fine in 1.2.2, thanks!

danielflower commented 9 years ago

Just realised that this change broke compatibility with Java 6. Unfortunately Java 6 is still important in some places.

I might roll back to the previous version of jgit. So the work around for the issue here is using version 3.2.2 until Java 6 support is dropped.

stromnet commented 9 years ago

FYI: This can be overriden in the project using the plugin:

            <plugin>
                <groupId>com.github.danielflower.mavenplugins</groupId>
                <artifactId>multi-module-maven-release-plugin</artifactId>
..
                <dependencies>
                    <dependency>
                        <groupId>org.eclipse.jgit</groupId>
                        <artifactId>org.eclipse.jgit</artifactId>
                        <version>4.0.1.201506240215-r</version>
                    </dependency>
                </dependencies>
            </plugin>
danielflower commented 9 years ago

Maybe I should do it the other way around - just tell Java 6 users to use version 1.2.0 of this plugin and bump the major version and switch to Java 7.