1

I've had some issues trying to add MANIFEST.MF to my .gitignore. Whenever I run a maven->Update Project in eclipse, the file shows back up in my git status as untracked.

I have tried adding the following lines to my git ignore

*.MF
MANIFEST
/MANIFEST.MF
**/MANIFEST.MF
**/MANIFEST.*
and a few other combinations with the wild card. 

Each time I would remove the Manifest.mf, update the .gitignore, and run the maven update(or mvn clean install from terminal), and the file shows up again as untracked. I have also made sure there isn't another .gitignore that is overriding this one.

I have also noticed the same problem occurring with .properties files and some temp_persist_config_###.xml files. But these occur during only the maven clean install from terminal. Would love any help on how to add these darn things to my .gitignore.

Contents of my MANIFEST.MF

Manifest-Version: 1.0
Build-Jdk: 1.7.0_79
Built-By: lencalot
Created-By: Apache Maven
X-Resource-Search-Path: /Users/Lencalot/myProject/myCoreAggregator/myExecutor/myService/src/main/webapp,/Users/Lencalot/myProject/myCoreAggregator/myExecutor/myService/src/main/resources,/Users/Lencalot/myProject/myCoreAggregator/myExecutor/myService

what it was:

Manifest-Version: 1.0
Build-Jdk: 1.7.0_79
Built-By: TeamMate1
Created-By: Apache Maven 3.1.1
X-Resource-Search-Path: E:\myProject\myCoreAggregator\myExecutor\myService\src\main/webapp,ETC...ETC..
Anshul Goyal
  • 73,278
  • 37
  • 149
  • 186
Lencalot
  • 385
  • 2
  • 19
  • Well, where is the file located? Should be under `src/main/resources/META-INF/MANIFEST.MF`. If so, why do you want to ignore it? – Tunaki Mar 09 '16 at 20:37
  • The file is located in `myCoreAggregator/myExecutor/myService/src/main/webapp/META-INF/MANIFEST.MF` I want to ignore it because I don't need it added to my commits every time I make changes and run a maven install. Every time someone on my team makes a commit the manifest.mf is updated with their personal Paths. We don't need to see this in all of our pull requests. – Lencalot Mar 09 '16 at 20:45
  • 2
    WHAT? No no, the MANIFEST should NOT contain an absolute path. Something is very wrong here. What you want to do is not to ignore that file, it is to fix why there is an absolute path in there. – Tunaki Mar 09 '16 at 20:47
  • @Tunaki edited my question to show you what is in the manifest.mf file. It changes per build on our local machine and we have had no problems with it the way it is. – Lencalot Mar 09 '16 at 20:57
  • 2
    If you didn't, you **will**. Never should you have absolute path like that. What will happen when you deploy your app? You'll have a WAR that points to `E:\myProject`, directory that may or may not exist on the server machine (imagine it is a Linux!). So you will have a problem at the worst time, i.e. deployment, when all the devs are home and the testing team says "It doesn't work!". I don't know how your file is getting generated but **something is very wrong**. You should post your POM. – Tunaki Mar 09 '16 at 21:00
  • Make sure `.gitignore` is saved in UTF-8 encoding. If that doesn't help, show us the actual contents of `.gitignore`. – Roman Mar 12 '16 at 00:57
  • 1
    I think you can find you answer here: [http://stackoverflow.com/questions/9750606/git-still-shows-files-as-modified-after-adding-to-gitignore](http://stackoverflow.com/questions/9750606/git-still-shows-files-as-modified-after-adding-to-gitignore) – KSev May 31 '16 at 20:05

1 Answers1

0

This problem was solved for me when I turned auto build off. Here is what I did step by step:

  1. Uncheck Build Automatically. Eclipse menu, Project -> Build Automatically.
  2. If it's needed fetch latest code.
  3. Rebase.
  4. Maven -> Update project
  5. Activate again Build Automatically.
burak
  • 3,839
  • 1
  • 15
  • 20