How to create Java Gradle project from command line?
It should create standard maven folder layout like on the picture below.
UPDATE:
.1. From http://www.gradle.org/docs/current/userguide/tutorial_java_projects.html I need to create file build.gradle
with 2 lines
apply plugin: 'java' apply plugin: 'eclipse'
.2. Add to build.gradle
task below, than execute gradle create-dirs
task "create-dirs" << { sourceSets*.java.srcDirs*.each { it.mkdirs() } sourceSets*.resources.srcDirs*.each { it.mkdirs() } }
.3. Then run gradle eclipse
(or corresponding string to other IDE plugin configured)
So is there way to do it in one command?
June 2020) Gradle is a build automation tool for multi-language software development. It controls the development process in the tasks of compilation and packaging to testing, deployment, and publishing. Supported languages include Java (as well as Kotlin, Groovy, Scala), C/C++, and JavaScript.
To create a Java project: create a new project directory, jump into it and execute
gradle init --type java-library
Source folders and a Gradle build file (including a wrapper) will be build.
The gradle guys are doing their best to solve all (y)our problems ;-). They recently (since 1.9) added a new feature (incubating): the "build init" plugin.
See: build init plugin documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With