r/javahelp • u/Cscareermetatime • May 18 '20
What files should be ignored with a Java Spring webservice (aka, what files should be added to .gitignore typically)?
So, I am more familiar with Angular than Java and currently learning Java Spring. I understand with JavaScript Angular, typically .gitignore is set to simply ignore the node_modules folder, as it is large and you don't need it thanks to the package.json file.
However, I am not clear if I need to do something similar for a Java Spring webservice project? I made one via start(dot)spring(dot)io website. Then build stuff up around it. I understand that JARS are installed or imported (again, new to JAVA, so don't know the correct term). I'm guessing those are similar to the node_module files with Javascript?
Either way, is there anything that should be added to a .gitignore file when sending it to github typically? What files or folders are typically ignored in a standard type of Java Spring webservice?
1
3
1
u/guss_bro May 19 '20
Look at this. This is what I use in my projects that have both spring boot and JavaScript stuff.
https://github.com/jhipster/jhipster-sample-app/blob/master/.gitignore
1
u/Dealusall May 19 '20
Google it ?
https://gist.github.com/Avinashachu007/58450a38a3a77d7c9923a55023f470f4
https://github.com/github/gitignore
https://github.com/fatimacasau/spring-boot-example/blob/master/.gitignore
gitignore.io is good start as posted by other one
1
u/BorgerBill May 19 '20
Here's mine from my current project:
tags
*.pdf
*.TTF
target/
.*.swp
.*.un~Those last two are Vim backup and undo files...
1
u/anyusernamesffs May 19 '20
I'm developing with Spring boot and have these in my .gitignore:
bin
build
.classpath
.gradle
.project
.settings
.idea (if you use intellij)And just use .gitignore when you need to - if you see lots of code being pushed that isn't necessary, ignore it.
1
u/nutrecht Lead Software Engineer / EU / 20+ YXP May 19 '20
There's generally nothing Spring (Boot) specific that needs to be ignored. Just use the standards for maven and gradle projects.
9
u/Mungrel000 May 18 '20
gitignore.io