Skip to content

Git template for gradle/java projects with IntelliJ

Notifications You must be signed in to change notification settings

martinswanson/gradle-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template for Java projects built with Gradle

This project simplifies the set up of Java projects built with Gradle in IntelliJ IDEA.

Usage

Clone the project

Rename the local project directory

Change the rootProject.name property in settings.gradle to match the new directory naming

Managing dependencies behind a firewall

For users that only have access to a local repository i.e. no external internet connection:

Create file ~/.gradle/init.gradle:

    def initGradlePath = buildscript.sourceFile.getParent() allprojects {
        apply from: "${initGradlePath}/repos.gradle", to: buildscript
        apply from: "${initGradlePath}/repos.gradle"
    }

Create file ~/.gradle/repos.gradle:

    repositories {
        mavenLocal()
        mavenCentral()
        // other repositories e.g. internal company repos 
    }

Comment out the following in the build.gradle file

    repositories {
        mavenCentral()
    }

This allows you to seperate what the project dependencies are from where the dependencies are found.

.gitignore

Filters out the files / directories contained in the local project that should not be stored in GitHub.

gradlew

Gradle executable allowing users to build the project without a local installation of Gradle. Uses the settings.gradle file for configuration parameters.

To execute:

    ./gradlew <command>

gradlew.bat

Same as gradlew for Windows users.

gradle/libraries.gradle

Sets global properties for dependencies in the root build.gradle file and any sub-module build.gradle files.

Avoids having to edit dependencies and versions in multiple files.

About

Git template for gradle/java projects with IntelliJ

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published