Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse or Maven add /target to gitignore

I'm using Maven and Git with a Java EE project (EAR, EJB and WEB), in Eclipse the workspace is rebuilding in loop beacause something adds "/target" to my .gitignore.

This is my gitignore :

     *.class
    *.settings
    *.project
    *.classpath
    target
    # Package Files #
    *.jar
    *.war
    *.ear
    /target
    /target
    /target
    /target
    /target
    /target
... (more and more /target)

Any idea what can add these lines?

like image 269
adenaud Avatar asked Nov 06 '13 16:11

adenaud


2 Answers

This may help you.
Team -> Git -> Projects, disable "Automaticaly ignore derived resouces by adding them to .gitignore".

like image 70
h-iwata Avatar answered Oct 01 '22 21:10

h-iwata


You can see when the file was modified and by who with the following command:

$ stat -x .gitignore 
  File: ".gitignore"
  Size: 210          FileType: Regular File
  Mode: (0644/-rw-r--r--)         Uid: (  501/jsmith)  Gid: (   20/   staff)
Device: 14,2   Inode: 15157009    Links: 1
Access: Wed Nov  6 13:11:04 2013
Modify: Sat Oct 26 12:53:41 2013
Change: Sat Oct 26 12:53:41 2013

Update to the last version of Eclipse and Maven. Then you can do some troubleshooting by creating other projects and monitor .gitignore.

Hope it helps :)

like image 38
Agustin Treceno Avatar answered Oct 01 '22 21:10

Agustin Treceno