gitignore file for gradle java and android project


Gradle is a Java project build tool that allows you to compile, build, manage dependencies, and deploy your projects. It also creates jar/war/ear files for various web and Android applications.

The java gradle project includes xml, java, and jsps source code that has been committed to svn and git repositories.

Gitignore is a file that includes a list of files or directories that should be ignored when committing to remote repositories in Java projects.

gitignore file for gradle android project

What files in java gradle projects should be skipped for git commits?

The files generated during the Gradle build process are listed below, and they’ve been added to the .gitignore file.

Gradle compiles java files and generates class files in the target folder, so class files must be ignored.

*.class

The archive files created by the final application are in the jar, ear, and war formats. The following entries must be added to the gitignore file for package-related files.

*.jar
*.war
*.ear

.gitignore file for eclipse gradle projects

when java projects opened in IDE’s like eclipse, intelli and blueJ, It generated IDE specific related temporary as well as environment files

*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath

gitignore file for Intelli IDEA editor for gradle projects

The gradle projects are loaded and configured differently in each IDE. Intelli IDE generates a lot of temporary files, add them to the gitignore file in gradle applications.

Here is the git ignore file example for Intelli IDEA

# generated files
bin/**
gen/**
# project based files
.idea/
*.iml
*.ipr
*.iws
.gradletasknamecache
.gradle/
build/
bin/

gitignore file for netbeans in gradle applications

netbeans output lot for temporary files and folders when you imported gradle projects.

/*/nb-configuration.xml
/nbproject/
/*/nbproject/
/*/target/
/*/build/
/netbeans-gradle-default-models/gradle-api/
.gradle/
/.nb-gradle-properties
.nb-gradle/

gitignore file example for gradle java application

*.class
*.jar
*.war
*.ear
# generated files
bin/**
gen/**
# project based files
.idea/
*.iml
*.ipr
*.iws
.gradletasknamecache
.gradle/
build/
bin/
THE BEST NEWSLETTER ANYWHERE
Join 6,000 subscribers and get a daily digest of full stack tutorials delivered to your inbox directly.No spam ever. Unsubscribe any time.

Similar Posts
Subscribe
You'll get a notification every time a post gets published here.