Skip to content

Instantly share code, notes, and snippets.

@Avinashachu007
Created November 27, 2018 07:47
Show Gist options
  • Save Avinashachu007/58450a38a3a77d7c9923a55023f470f4 to your computer and use it in GitHub Desktop.
Save Avinashachu007/58450a38a3a77d7c9923a55023f470f4 to your computer and use it in GitHub Desktop.
Gitignore for Java,maven,Eclipse,Spring
/target/
!.mvn/wrapper/maven-wrapper.jar
### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
# Created by https://www.gitignore.io/api/git,java,maven,eclipse,windows
### Eclipse ###
.metadata
bin/
tmp/
*.tmp
*.bak
*.swp
*~.nib
local.properties
.settings/
.loadpath
.recommenders
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# PyDev specific (Python IDE for Eclipse)
*.pydevproject
# CDT-specific (C/C++ Development Tooling)
.cproject
# CDT- autotools
.autotools
# Java annotation processor (APT)
.factorypath
# PDT-specific (PHP Development Tools)
.buildpath
# sbteclipse plugin
.target
# Tern plugin
.tern-project
# TeXlipse plugin
.texlipse
# STS (Spring Tool Suite)
.springBeans
# Code Recommenders
.recommenders/
# Annotation Processing
.apt_generated/
# Scala IDE specific (Scala & Java development for Eclipse)
.cache-main
.scala_dependencies
.worksheet
### Eclipse Patch ###
# Eclipse Core
.project
# JDT-specific (Eclipse Java Development Tools)
.classpath
# Annotation Processing
.apt_generated
.sts4-cache/
### Git ###
# Created by git for backups. To disable backups in Git:
# $ git config --global mergetool.keepBackup false
*.orig
# Created by git when using merge tools for conflicts
*.BACKUP.*
*.BASE.*
*.LOCAL.*
*.REMOTE.*
*_BACKUP_*.txt
*_BASE_*.txt
*_LOCAL_*.txt
*_REMOTE_*.txt
### Java ###
# Compiled class file
*.class
# Log file
*.log
# BlueJ files
*.ctxt
# Mobile Tools for Java (J2ME)
.mtj.tmp/
# Package Files #
*.jar
*.war
*.nar
*.ear
*.zip
*.tar.gz
*.rar
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
hs_err_pid*
### Maven ###
target/
pom.xml.tag
pom.xml.releaseBackup
pom.xml.versionsBackup
pom.xml.next
release.properties
dependency-reduced-pom.xml
buildNumber.properties
.mvn/timing.properties
.mvn/wrapper/maven-wrapper.jar
### Windows ###
# Windows thumbnail cache files
Thumbs.db
ehthumbs.db
ehthumbs_vista.db
# Dump file
*.stackdump
# Folder config file
[Dd]esktop.ini
# Recycle Bin used on file shares
$RECYCLE.BIN/
# Windows Installer files
*.cab
*.msi
*.msix
*.msm
*.msp
# Windows shortcuts
*.lnk
# End of https://www.gitignore.io/api/git,java,maven,eclipse,windows
@ivanrododendro
Copy link

great

@DooWonJang
Copy link

Thanks.
That's what I am searching for.

@dandsm
Copy link

dandsm commented Jul 26, 2020

Awesome!

@sameesh-s
Copy link

.mvn/wrapper/MavenWrapperDownloader.java do this file is needed in the version control? can we ignore the whole .mvn directory?

@Avinashachu007
Copy link
Author

.mvn/wrapper/MavenWrapperDownloader.java do this file is needed in the version control? can we ignore the whole .mvn directory?

Yes you can ignore entire .mvn directory

@Jarvis-24
Copy link

what about application.prpoerties

@Avinashachu007
Copy link
Author

what about application.prpoerties

Since most of the spring boot project will not run without application.properties, We cannot .gitignore the properties files.

@bogere
Copy link

bogere commented Oct 27, 2020

what about application.prpoerties

Since most of the spring boot project will not run without application.properties, We cannot .gitignore the properties files.

Application secrets cannot be pushed to the git repository... it is better to use a template instead

@artefactor
Copy link

what about intllJ Idea files?

.idea/
*.iml

@bksun
Copy link

bksun commented Oct 22, 2021

what about intllJ Idea files?

.idea/ *.iml

We should keep intellij related files in .gitignore

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment