I'm creating a new Spring Boot app. I'm more than moderately familiar with .gitignore
patterns, but I see something deliberately templated that has the smell of "intent" on it. The below is produced by the Spring Initializr in many IDEs.
target/
!.mvn/wrapper/maven-wrapper.jar
!**/src/main/**/target/
!**/src/test/**/target/
...
...
build/
!**/src/main/**/build/
!**/src/test/**/build/
I believe this has something to do with maven's multi-module project feature, but Initializr apps are not multi-module (at start). That aside, what I'm reading here? If I took a stab at what I think is being stated it is something I do not want to do (as a general practice).
"Ignore
target/
folders wherever encountered, buttarget
folders below the top-level insome/path
/src/main/
deeper/still
/target/
include those."Oh, do the same for NetBeans
build/
directories!"
This doesn't quite make sense. Why would I ever commit target content generated by the build? Thus I'm trying to deduce the intent of the Spring engineers.
Update
In fact, that's exactly what this does, includes target
or build
directories deeper in the root. To what end?
mkdir -p some/path/src/main/deeper/still/target/
touch !$/test.txt
This new target
directory is included for staging and commits. Remove this and it's ignored.