gradle empty project initialization on git

  1. Create an empty project on git
  2. clone the project to local
git clone projecturl
  1. Set the git username and email address on the command line
git config  user.name "yourusername"
git config  user.email "youremail"
  1. Initialize the gradle project
gradle init
  1. Create a Java folder
    a. Add the following configuration in build.gradle
apply plugin: 'java'
apply plugin: 'eclipse'
task initFolder << {
sourceSets*.java.srcDirs*.each { it.mkdirs() }
sourceSets*.resources.srcDirs*.each { it.mkdirs()}
} 

b. Then execute the gradle task

gradle initFolder
  1. Convert to eclipse project with gradle task
gradle eclipse
  1. set gitignore
/bin/
/build/
/.*
!.gitignore
  1. Set as gradle project in eclipse

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324939760&siteId=291194637