6

I'm using Maven JGit-Flow Plugin in order to automate some of the release process. Unfortunately I'm hitting this problem when trying to start new release using mvn jgitflow:release-start:

[ERROR] Failed to execute goal external.atlassian.jgitflow:jgitflow-maven-plugin:1.0-m5.1:release-start (default-cli) on project <myProjectName>: Error starting release: Error starting release: Working tree has untracked files 

However I cannot see and untracked files here (nor on master):

git status
On branch develop
Your branch is up-to-date with 'origin/develop'.
nothing to commit, working directory clean

Any idea how does Maven JGit-Flow Plugin find untracked files?

dur
  • 15,689
  • 25
  • 79
  • 125
Anton Belev
  • 11,963
  • 22
  • 70
  • 111

3 Answers3

7

A look into .git/jgitflow.log will show which files are found to be untracked by jgitflow. In my case I found the line:

GitHelper:         _  -- untracked: .DS_Store _

I have a global gitignore file

$ git config --get core.excludesfile
~/.gitignore_global

where .DS_Store is set as an exclusion. Unfortunately jgitflow seems not to be aware of this setting. So I added the exclusion to the project’s .gitignore file with:

 ### Mac OSX
.DS_Store

After that mvn jgitflow:release-start worked as expected.

Pete
  • 787
  • 9
  • 10
  • I found the same logs in jgitflow.log but i already have .DS_Store entry in my .gitignore file and git doesnt seem to complain about it – arunkjn Sep 19 '17 at 08:37
  • 2
    I am not sure what you mean. Why should git complain? My issue was jgitflow complaining about an untacked .DS_Store file, but I could not see anything untracked via `git status`. – Pete Sep 19 '17 at 18:53
  • same here. I resorted to using `true` in my pom – arunkjn Sep 20 '17 at 09:53
4

Fixed it by allowing untracked files:

            <plugin>
                <groupId>external.atlassian.jgitflow</groupId>
                <artifactId>jgitflow-maven-plugin</artifactId>
                <version>1.0-m5.1</version>
                <configuration>
                    <pushReleases>true</pushReleases>
                    <allowUntracked>true</allowUntracked>
                </configuration>
            </plugin>
Anton Belev
  • 11,963
  • 22
  • 70
  • 111
0

Please check for all the maven generated and IDE generated files and folders. Add them to .gitignore.

Following are the files and folders that are ignored for me. I am using maven 3 and IntelliJ. Here is the content of .gitignore:

### IntelliJ Idea Project Files.

# IntelliJ project files
.idea
*.iml
out
gen
target/

### Java Files
*.class

# Package Files #
*.jar
*.war
*.ear
.settings
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*

For most of the people following will fix the issue, if they are not using IntelliJ:

target/