When creating spring-boot projects by using start.spring.io, some maven wrapper files get included:
Should these files be ignored when committing to a git repo?
mvnw: it's an executable Unix shell script used in place of a fully installed Maven. mvnw. cmd: it's the Batch version of the above script. mvn: the hidden folder that holds the Maven Wrapper Java library and its properties file.
You can safely remove it if (you can reasonably expect that) everyone you work with has it installed.
The . mvn directory is a directory where you can put some Maven configuration files. One of these Maven configuration files is the jvm. config file which can be used to configure the Java VM that is used by Maven to build your project.
A mvnw
Maven wrapper script allows you to run a Maven command without having Maven installed and present on your PATH. It does by looking for Maven on your PATH and, if not found, it downloads and installs Maven in a default location (your user home directory, IIRC).
They are a convenience but they are not necessarily part of your project, not in the same way as your project code and configuration is. In other words:
mnvw
file could be used for multiple, unrelated projectsmnvw
file will almost certainly not be different from one version of your project to anotherOn this basis you could make a case for not committing mvnw
to your code repository.
However, including a mvnw
script in your repo does have these benefits:
On this basis you could make a case for committing mvnw
to your code repository.
So, there are pros and cons on both sides. Just choose the side which best fits the needs of those who will use your repo. Either:
... or:
mvnw
script.It depends, if you want to use the Maven wrapper or not. If not, then you can delete those files. If you want to use it, then you have to commit the files in the repository, otherwise it doesn't make sense to use it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With