Something is creating MANIFEST.MF
files in the java project, which contain this:
Manifest-Version: 1.0
Class-Path:
Should these be added to git, or ignored?
Something is creating MANIFEST.MF
files in the java project, which contain this:
Manifest-Version: 1.0
Class-Path:
Should these be added to git, or ignored?
Something is creating MANIFEST.MF files
That seems like you don't want the MANIFEST.NF
to be checked in but it is worth looking into.
The file is packaged in a JAR and contains necessary metadata (e.g. the main class).
It can either be manually added or automatically generated (by a build tool) when creating a JAR or when you prepare for creating a JAR.
.gitignore
?If it is automatically generated by your build system, add it to the .gitignore
and don't add it to git.
If the file is created manually, check it in.
If the MANIFEST.MF
is created by another tool, it depends whether you want to run this tool whenever you create (or prepare to create) a JAR. If that is the case, don't check it in.
This pretty much depends on what exactly does your java project do and to be more specific how do you build it and what is the role of the MANIFEST.MF
in the resulting artifact that you build.
Maven can generate MANIFEST.MF for example, and it will put it in the target directory. In this case you don't have to add it to source control (in general there is no value adding target directory to the source control)
On the other hand, if you choose to maintain the manifest file by yourself and put it into src/main/resources/META-INF/MANIFEST.MF
and treat it as a part of your sources - the you should add it to git.
So it depends.