{"id":93439,"date":"2020-08-24T11:00:00","date_gmt":"2020-08-24T08:00:00","guid":{"rendered":"https:\/\/examples.javacodegeeks.com\/?p=93439"},"modified":"2020-08-21T13:42:25","modified_gmt":"2020-08-21T10:42:25","slug":"gradle-build-system-tutorial","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/","title":{"rendered":"Gradle Build System Tutorial"},"content":{"rendered":"<p> In this tutorial, we will see how to use gradle build in detail with examples.<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"overview\"><\/a>1. Overview<\/h2>\n<p>Gradle&nbsp;is a popular build management system. The Gradle framework has features for the automatic download and configuration of the libraries which are required for the build. The library dependencies can be downloaded from Maven and Ivy repositories.  Gradle can handle multiple projects and multiple artifact-based builds.<\/p>\n<div class=\"toc\">\n<h3>Table Of Contents<\/h3>\n<dl>\n<dt><a href=\"#overview\">1. Overview<\/a><\/dt>\n<dt><a href=\"#tutorial\">2. Gradle Build System Tutorial<\/a><\/dt>\n<dd>\n<dl>\n<dt><a href=\"#prerequisites\">2.1. Prerequisites<\/a><\/dt>\n<dt><a href=\"#software\">2.2. Download<\/a><\/dt>\n<dt><a href=\"#setup\">2.3. Setup<\/a><\/dt>\n<dt><a href=\"#launch\">2.4. Running Gradle<\/a><\/dt>\n<dt><a href=\"#project\">2.5. Gradle Projects<\/a><\/dt>\n<dt><a href=\"#task\">2.6. Gradle Tasks<\/a><\/dt>\n<dt><a href=\"#plugin\">2.7. Gradle Plugins<\/a><\/dt>\n<dt><a href=\"#javaproject\">2.8. Gradle Java Project<\/a><\/dt>\n<dt><a href=\"#wrapper\">2.9. Gradle Wrapper<\/a><\/dt>\n<dt><a href=\"#customtask\">2.10. Gradle Custom Tasks<\/a><\/dt>\n<dt><a href=\"#testing\">2.11. Gradle Testing<\/a><\/dt>\n<dt><a href=\"#deployment\">2.12. Gradle Deployment<\/a><\/dt>\n<dt><a href=\"#customplugin\">2.13. Gradle Custom Plugins<\/a><\/dt>\n<dt><a href=\"#integration\">2.14. Gradle Eclipse Integration<\/a><\/dt>\n<dt><a href=\"#buildscan\">2.15. Gradle build scans<\/a><\/dt>\n<\/dl>\n<\/dd>\n<dt><a href=\"#download\">3. Download the Source Code<\/a><\/dt>\n<\/dl>\n<\/div>\n<p>&nbsp;<\/p>\n<h2 class=\"wp-block-heading\"><a name=\"tutorial\"><\/a>2. Gradle Build System Tutorial<\/h2>\n<h3 class=\"wp-block-heading\"><a name=\"prerequisites\"><\/a>2.1 Prerequisites<\/h3>\n<p>Java 8 is required on the Linux, windows, or Mac operating systems. Gradle 5.4.1 version can be used for building Gradle projects. <\/p>\n<h3 class=\"wp-block-heading\"><a name=\"software\"><\/a>2.2 Download<\/h3>\n<p>You can download Java 8 from the Oracle web&nbsp;<a href=\"https:\/\/www.oracle.com\/technetwork\/java\/javase\/downloads\/jdk8-downloads-2133151.html\">site<\/a>. Likewise, Gradle 5.4.1 can be downloaded from this&nbsp;<a href=\"https:\/\/gradle.org\/next-steps\/?version=5.4.1&amp;format=bin\">website<\/a>. <\/p>\n<h3 class=\"wp-block-heading\"><a name=\"setup\"><\/a>2.3 Setup<\/h3>\n<h4 class=\"wp-block-heading\">2.3.1 Java Setup<\/h4>\n<p>You can set the environment variables for JAVA_HOME and PATH. They can be set as shown below<em>.<\/em><\/p>\n<p><span style=\"text-decoration: underline\"><em>Java Environment Setup<\/em><\/span><\/p>\n<pre class=\"brush:plain\">JAVA_HOME=\"\/desktop\/jdk1.8.0_73\"\nexport JAVA_HOME\nPATH=$JAVA_HOME\/bin:$PATH\nexport PATH\n<\/pre>\n<h4 class=\"wp-block-heading\">2.3.2 Gradle Setup<\/h4>\n<p>The environment variables for Gradle are set as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Gradle Setup<\/em><\/span><\/p>\n<pre class=\"brush:plain\">GRADLE_HOME=\"\/opt\/gradle\/gradle-5.4.1\/bin\"\nexport GRADLE_HOME=$GRADLE_HOME\/bin\/\nexport PATH=$PATH:$GRADLE_HOME\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"launch\"><\/a>2.4 Running Gradle<\/h3>\n<p>You can check the version of the Gradle by using the command Gradle \u2013-version. The command for running Gradle is as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle --version\n<\/pre>\n<p>The output of the executed Gradle command is shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Gradle Version<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:~ bhagvan.kommadi$ gradle --version\n\nWelcome to Gradle 5.5.1!\n\nHere are the highlights of this release:\n - Kickstart Gradle plugin development with gradle init\n - Distribute organization-wide Gradle properties in custom Gradle distributions\n - Transform dependency artifacts on resolution\n\nFor more details see https:\/\/docs.gradle.org\/5.5.1\/release-notes.html\n\n\n------------------------------------------------------------\nGradle 5.5.1\n------------------------------------------------------------\n\nBuild time:   2019-07-10 20:38:12 UTC\nRevision:     3245f748c7061472da4dc184991919810f7935a5\n\nKotlin:       1.3.31\nGroovy:       2.5.4\nAnt:          Apache Ant(TM) version 1.9.14 compiled on March 12 2019\nJVM:          1.8.0_101 (Oracle Corporation 25.101-b13)\nOS:           Mac OS X 10.12.6 x86_64\n<\/pre>\n<h4 class=\"wp-block-heading\">2.4.1  Gradle Hello World<\/h4>\n<p>Let us look at Gradle Hello World.  You can create a task as shown below in <code>build.gradle<\/code>:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Setup<\/em><\/span><\/p>\n<pre class=\"brush:plain\">task helloworld {\n    doLast {\n        println 'Hello World'\n    }\n}\n<\/pre>\n<p>The command to execute above task is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle helloworld\n<\/pre>\n<p>The output of the command executed is as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:gradlesystem bhagvan.kommadi$ gradle helloworld\nStarting a Gradle Daemon (subsequent builds will be faster)\n\n&gt; Task :helloworld\nHello World\n\nBUILD SUCCESSFUL in 8s\n1 actionable task: 1 executed\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"project\"><\/a>2.5  Gradle Projects<\/h3>\n<p>Every Gradle project has tasks. A Gradle task is a unit of work to execute a build. The compilation of source code and generation of Javadoc are examples of Gradle tasks.  The project name is mentioned in <code>settings.gradle<\/code> as shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>settings.gradle<\/em><\/span><\/p>\n<pre class=\"brush:plain\">rootProject.name ='org.javacodegeeks.gradle.saygreetings'\n<\/pre>\n<p><code>build.gradle<\/code>  is written as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build.gradle<\/em><\/span><\/p>\n<pre class=\"brush:plain\">description =\"\"\"\nExample project for a Gradle build\nProject name: ${project.name}\n\nMore detailed information here... \"\"\"\n\ntask saygreetings {\n    doLast {\n        println 'Greetings'\n    }\n}\n<\/pre>\n<p>The command to execute above task is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle saygreetings\n<\/pre>\n<p>The output of the command executed is as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Output<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:project bhagvan.kommadi$ gradle saygreetings\n\n&gt; Task :saygreetings\nGreetings\n\nBUILD SUCCESSFUL in 1s\n1 actionable task: 1 executed\n<\/pre>\n<p>An enterprise application will have multiple projects to be built. The Gradle framework has a root project which can have multiple sub-projects. build. Gradle file has the root project. The file settings.gradle will have the subprojects information.<\/p>\n<p>For example, you can have the project structure as below:<\/p>\n<ul class=\"wp-block-list\">\n<li>base_project\n<ul>\n<li>auth<\/li>\n<li>usermgmt<\/li>\n<li>utils<\/li>\n<\/ul>\n<\/li>\n<li>settings.gradle<\/li>\n<\/ul>\n<p>Based on the project structure, you can have the&nbsp;settings.gradle.<\/p>\n<p><span style=\"text-decoration: underline\"><em>build.gradle<\/em><\/span><\/p>\n<pre class=\"brush:plain\">include 'auth', 'usermgmt', 'utils'\n\n#include 'auth'\n#include 'usermgmt'\n#include 'utils'\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"task\"><\/a>2.6 Gradle Tasks<\/h3>\n<p>The Gradle task is used to create tasks such as jar creation and archive publishing. The Gradle framework is extensible. Tasks are the core part of the framework. A Gradle task can be created for moving data from a directory to the other directory. A task can have a dependency on another task. It can have an input and the output. Gradle has introspection related tasks.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>For example, the tasks command shows the available tasks for a project.  This command shows  the base tasks when you do not have a <code>build.gradle<\/code> file.<\/p>\n<p><span style=\"text-decoration: underline\"><em>Tasks command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle -q tasks\n<\/pre>\n<p>The output of the command executed is as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Tasks command output<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:gradlesystem bhagvan.kommadi$ gradle -q tasks\n\n------------------------------------------------------------\nTasks runnable from root project\n------------------------------------------------------------\n\nBuild Setup tasks\n-----------------\ninit - Initializes a new Gradle build.\nwrapper - Generates Gradle wrapper files.\n\nHelp tasks\n----------\nbuildEnvironment - Displays all buildscript dependencies declared in root project 'gradlesystem'.\ncomponents - Displays the components produced by root project 'gradlesystem'. [incubating]\ndependencies - Displays all dependencies declared in root project 'gradlesystem'.\ndependencyInsight - Displays the insight into a specific dependency in root project 'gradlesystem'.\ndependentComponents - Displays the dependent components of components in root project 'gradlesystem'. [incubating]\nhelp - Displays a help message.\nmodel - Displays the configuration model of root project 'gradlesystem'. [incubating]\nprojects - Displays the sub-projects of root project 'gradlesystem'.\nproperties - Displays the properties of root project 'gradlesystem'.\ntasks - Displays the tasks runnable from root project 'gradlesystem'.\n\nTo see all tasks and more detail, run gradle tasks --all\n\nTo see more detail about a task, run gradle help --task \n<\/pre>\n<p>Gradle has helped the task to give information related to the other tasks such as the init task. The command executed for help task related to init is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Help for Init task<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle -q help --task init\n<\/pre>\n<p>The output of the command executed is as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Help for Init task output<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:gradlesystem bhagvan.kommadi$ gradle -q help --task init\nDetailed task information for init\n\nPath\n     :init\n\nType\n     InitBuild (org.gradle.buildinit.tasks.InitBuild)\n\nOptions\n     --dsl     Set the build script DSL to be used in generated scripts.\n               Available values are:\n                    groovy\n                    kotlin\n\n     --package     Set the package for source files.\n\n     --project-name     Set the project name.\n\n     --test-framework     Set the test framework to be used.\n                          Available values are:\n                               junit\n                               junit-jupiter\n                               kotlintest\n                               scalatest\n                               spock\n                               testng\n\n     --type     Set the type of project to generate.\n                Available values are:\n                     basic\n                     cpp-application\n                     cpp-library\n                     groovy-application\n                     groovy-gradle-plugin\n                     groovy-library\n                     java-application\n                     java-gradle-plugin\n                     java-library\n                     kotlin-application\n                     kotlin-gradle-plugin\n                     kotlin-library\n                     pom\n                     scala-library\n\nDescription\n     Initializes a new Gradle build.\n\nGroup\n     Build Setup\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"plugin\"><\/a>2.7 Gradle Plugins<\/h3>\n<p>Gradle has an extension for a plugin for preconfigured tasks. It has a base set of plugins and developers can add custom plugins. build.gradle file has plugin specified using the statement apply plugin &#8216;plugin-name&#8217;.<\/p>\n<p>You can add the entry  <code>apply plugin: 'com.android.application'<\/code> which sets the Android plug-in available for a Gradle build. Gradle has a registry of plugins which can be accessed at <a href=\"http:\/\/plugins.gradle.org\/\">site<\/a>.<\/p>\n<h3 class=\"wp-block-heading\"><a name=\"javaproject\"><\/a>2.8 Gradle Java Project<\/h3>\n<p>The Gradle framework has features for java projects. You can create a new Gradle based Java project for JUnit Jupiter.<\/p>\n<p><span style=\"text-decoration: underline\"><em>build.gradle<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle init --type java-library --test-framework junit-jupiter\n<\/pre>\n<p>The output of the command executed is as below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build.gradle<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:gradlesystem bhagvan.kommadi$ gradle init --type java-library --test-framework junit-jupiter\n\nSelect build script DSL:\n  1: Groovy\n  2: Kotlin\nEnter selection (default: Groovy) [1..2] 1\n\nProject name (default: gradlesystem): junit\nSource package (default: junit): junit\n\n&gt; Task :init\nGet more help with your project: https:\/\/docs.gradle.org\/5.5.1\/userguide\/java_library_plugin.html\n\nBUILD SUCCESSFUL in 50s\n2 actionable tasks: 2 executed\n<\/pre>\n<p>Java code generated related to the command above is presented below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Library class<\/em><\/span><\/p>\n<pre class=\"brush:java\">\/*\n * This Java source file was generated by the Gradle 'init' task.\n *\/\npackage junit;\n\npublic class Library {\n    public boolean someLibraryMethod() {\n        return true;\n    }\n}\n<\/pre>\n<p>The code generated for Junit Test is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Junit class<\/em><\/span><\/p>\n<pre class=\"brush:java\">\/*\n * This Java source file was generated by the Gradle 'init' task.\n *\/\npackage junit;\n\nimport org.junit.jupiter.api.Test;\nimport static org.junit.jupiter.api.Assertions.*;\n\nclass LibraryTest {\n    @Test void testSomeLibraryMethod() {\n        Library classUnderTest = new Library();\n        assertTrue(classUnderTest.someLibraryMethod(), \"someLibraryMethod should return 'true'\");\n    }\n}\n<\/pre>\n<p>You can execute the build using the command below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle build\n<\/pre>\n<p>The output of the command executed is presented below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build command output<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:junit bhagvan.kommadi$ gradle build\nBUILD SUCCESSFUL in 31s\n4 actionable tasks: 4 up-to-date\n<\/pre>\n<p>The command for executing the junit test is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle test\n<\/pre>\n<p>The output of the command executed is presented below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build command output<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:junit bhagvan.kommadi$ gradle test\nBUILD SUCCESSFUL in 35s\n3 actionable tasks: 3 up-to-date\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"wrapper\"><\/a>2.9 Gradle Wrapper<\/h3>\n<p>The Gradle wrapper is used for executing the build with a predefined Gradle version and settings. Gradle version download happens when the Gradle wrapper is executed.  The Gradle wrapper can be created using command Gradle wrapper<\/p>\n<p><code>gradlew<\/code> is created for mac and Unix systems. gradlew.batis created for window systems.  These files are executed when the Gradle command is executed.  Gradle wrapper version can be specified in a Gradle task. When the task is executed, Gradle wrapper is created and it downloads the Gradle based on the version. Gradle wrapper version can be specified as shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>Gradle wrapper<\/em><\/span><\/p>\n<pre class=\"brush:plain\">wrapper {\n    gradleVersion = '4.9'\n}\n<\/pre>\n<p>Gradle options  can be specified in the <code>gradlew<\/code>&nbsp;or&nbsp;<code>gradlew.bat<\/code>&nbsp;file.<\/p>\n<p><span style=\"text-decoration: underline\"><em>gradle wrapper options<\/em><\/span><\/p>\n<pre class=\"brush:plain\">#!\/usr\/bin\/env bash\nDEFAULT_JVM_OPTS=\"-Xmx1024m\"\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"customtask\"><\/a>2.10 Gradle Custom Tasks<\/h3>\n<p>A gradle custom task can be created and it can be derived from other tasks. For example, CopyTask can be created to copy files.<\/p>\n<p>A copyTask can be created in a <code>build.gradle<\/code>&nbsp;file as shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>custom task<\/em><\/span><\/p>\n<pre class=\"brush:plain\">task copyTask(type: Copy) {\n    from 'src'\n    into 'dest'\n}\n<\/pre>\n<p>You can create an src folder inside this project and add an example.txt text file to this folder. copy task will copy the <code>example.txt<\/code> file to a new dest folder.<\/p>\n<p>The command to execute above task is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>custom task run command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle copyTask\n<\/pre>\n<p>The output of the command executed is presented below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>custom task output<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:customtask bhagvan.kommadi$ gradle copyTask\n\nBUILD SUCCESSFUL in 4s\n1 actionable task: 1 up-to-date\n<\/pre>\n<h3 class=\"wp-block-heading\"><a name=\"testing\"><\/a>2.11 Gradle Testing<\/h3>\n<p>Gradle 6.0 has features for unit testing with Junit 5. you can add dependencies in the <code>build.gradle<\/code> file as shown below.<\/p>\n<p><span style=\"text-decoration: underline\"><em>custom task<\/em><\/span><\/p>\n<pre class=\"brush:plain\">dependencies {\n\n   \n    testImplementation(enforcedPlatform(\"org.junit:junit-bom:5.4.0\")) \n    testImplementation(\"org.junit.jupiter:junit-jupiter\")\n}\n<\/pre>\n<p>Gradle test task helps in finding the compiled classes in the project source folder. <\/p>\n<h3 class=\"wp-block-heading\"><a name=\"deployment\"><\/a>2.12 Gradle Deployment<\/h3>\n<p>Gradle provides support for deploying build artifacts to artifact repositories, such as Artifactory&nbsp;or&nbsp;Sonatype Nexus. You can use a maven-publish plugin for publishing build artifacts.<\/p>\n<h3 class=\"wp-block-heading\"><a name=\"customplugin\"><\/a>2.13 Gradle Custom Plugins<\/h3>\n<p>A gradle custom plugin can be created to have a plugin with custom logic. The build file will have simple and straightforward tasks. The build needs to have declarative logic to have better maintenance.<\/p>\n<h3 class=\"wp-block-heading\"><a name=\"integration\"><\/a>2.14 Gradle &#8211; Eclipse Integration<\/h3>\n<p>You can find the source code for installing Gradle Plugin using the Grails project in this <a href=\"https:\/\/examples.javacodegeeks.com\/jvm-languages\/groovy\/grails\/grails-spring-security-tutorial\/\">javacodegeeks article<\/a>.<\/p>\n<p>You need to also ensure that the Buildship Gradle Integration plugin is installed. The snapshot below shows the installed Gradle version.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"832\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_gradle.jpg\" alt=\"gradle build - Gradle plugin\" class=\"wp-image-73359\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_gradle.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_gradle-296x300.jpg 296w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_gradle-768x779.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_gradle-70x70.jpg 70w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Eclipse \u2013 Gradle plugin<\/figcaption><\/figure>\n<\/div>\n<h4 class=\"wp-block-heading\">2.14.1 Building with Gradle &#8211; Eclipse<\/h4>\n<p>You can import the project HelloWorld which was a Gradle project created. The snapshot below shows the import wizard from the Eclipse menu File-&gt; Import.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"615\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_import_gradle.jpg\" alt=\"gradle build - Import Gradle Project\" class=\"wp-image-73360\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_import_gradle.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_import_gradle-300x225.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/eclipse_import_gradle-768x576.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Eclipse \u2013 Import Gradle Project<\/figcaption><\/figure>\n<\/div>\n<p>After the import, the Gradle Grails project can be viewed in the eclipse. The screen shot below shows the imported project.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"616\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_grails_eclipse.jpg\" alt=\"gradle build - Eclipse Project\" class=\"wp-image-73361\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_grails_eclipse.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_grails_eclipse-300x225.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_grails_eclipse-768x577.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Gradle Grails Eclipse Project<\/figcaption><\/figure>\n<\/div>\n<p>From the Gradle tasks view, You can see all the Gradle tasks. To execute the grails-app, click on bootRun. The screenshot below shows the Gradle tasks view.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"852\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_tasks_view.jpg\" alt=\"\" class=\"wp-image-73362\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_tasks_view.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_tasks_view-289x300.jpg 289w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/gradle_tasks_view-768x798.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Gradle Tasks Eclipse View<\/figcaption><\/figure>\n<\/div>\n<p>The grails app can be accessed at http:\/\/localhost:8080 when the gradle runs the Grails app on eclipse. The snapshot of the Grails app and Gradle task execution is shown below.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"824\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/browser_grails_app_eclipse.jpg\" alt=\"\" class=\"wp-image-73363\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/browser_grails_app_eclipse.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/browser_grails_app_eclipse-150x150.jpg 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/browser_grails_app_eclipse-300x300.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/browser_grails_app_eclipse-768x772.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/browser_grails_app_eclipse-70x70.jpg 70w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Grails App Running \u2013 Eclipse<\/figcaption><\/figure>\n<\/div>\n<p>The <code>HelloController<\/code> can be accessed and the page renders to show the \u201cGreetings\u201d message. The rendered page is shown below:<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"815\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/hello_index_eclipse_grails.jpg\" alt=\"\" class=\"wp-image-73364\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/hello_index_eclipse_grails.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/hello_index_eclipse_grails-150x150.jpg 150w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/hello_index_eclipse_grails-300x298.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/hello_index_eclipse_grails-768x763.jpg 768w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/06\/hello_index_eclipse_grails-70x70.jpg 70w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Hello Controller \u2013 Eclipse<\/figcaption><\/figure>\n<\/div>\n<p>Gradle provides several plugins for analyzing the code base of a Gradle project.<\/p>\n<h3 class=\"wp-block-heading\"><a name=\"buildscan\"><\/a>2.15 Gradle Build Scans<\/h3>\n<p>The Gradle project can have a build scanner.  A build scan has incidents and details of a Gradle build project. The Gradle remote server will have the build scans which are published. Gradle init is used for creating a project. The command is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>gradle project create command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradle init  \n<\/pre>\n<p>You can use build scan option to publish the build scan as shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>build scan<\/em><\/span><\/p>\n<pre class=\"brush:plain\">gradlew build --scan \n<\/pre>\n<p>The output of the above command executed is shown below:<\/p>\n<p><span style=\"text-decoration: underline\"><em>gradle project create command<\/em><\/span><\/p>\n<pre class=\"brush:plain\">apples-MacBook-Air:build_scan bhagvan.kommadi$ .\/gradlew build --scan\n\nBUILD SUCCESSFUL in 40s\n7 actionable tasks: 7 executed\n\nPublishing a build scan to scans.gradle.com requires accepting the Gradle Terms of Service defined at https:\/\/gradle.com\/terms-of-service. Do you accept these terms? [yes, no] yes\n\nGradle Terms of Service accepted.\n\nPublishing build scan...\nhttps:\/\/gradle.com\/s\/n7m73v5szsjxg\n<\/pre>\n<p>The above command publishes the Gradle project. The scan can be accessed by the link provided in the output. The link takes you to the website as shown below.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"719\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/activate_scan.jpg\" alt=\"\" class=\"wp-image-93576\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/activate_scan.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/activate_scan-300x263.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/activate_scan-768x673.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Build Scan activation<\/figcaption><\/figure>\n<\/div>\n<p>You can type your email address and an email will be sent to you as shown in the message below.  <\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"628\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/message_check_inbox.jpg\" alt=\"\" class=\"wp-image-93587\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/message_check_inbox.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/message_check_inbox-300x230.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/message_check_inbox-768x588.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Message for Email check<\/figcaption><\/figure>\n<\/div>\n<p>When you click on the link. The email will be like in the picture below.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"608\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/inbox_email.jpg\" alt=\"\" class=\"wp-image-93578\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/inbox_email.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/inbox_email-300x222.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/inbox_email-768x569.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Inbox email<\/figcaption><\/figure>\n<\/div>\n<p>When you click on the build,  the link takes you to the build scan.<\/p>\n<div class=\"wp-block-image is-style-default\">\n<figure class=\"aligncenter size-full\"><img decoding=\"async\" width=\"820\" height=\"721\" src=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/build_scan-1.jpg\" alt=\"\" class=\"wp-image-93586\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/build_scan-1.jpg 820w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/build_scan-1-300x264.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/build_scan-1-768x675.jpg 768w\" sizes=\"(max-width: 820px) 100vw, 820px\" \/><figcaption>Build Scan<\/figcaption><\/figure>\n<\/div>\n<h2 class=\"wp-block-heading\"><a name=\"download\"><\/a>3.Download the Source Code<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here:<a href=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2020\/08\/gradlesystem.zip\"> <strong>Gradle Build System Tutorial<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle framework has features for the automatic download and configuration of the libraries which are required for the build. The library dependencies can be downloaded from Maven and Ivy repositories. Gradle &hellip;<\/p>\n","protected":false},"author":31,"featured_media":20342,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[908],"tags":[906],"class_list":["post-93439","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gradle","tag-gradle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Gradle Build System Tutorial - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gradle Build System Tutorial - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\" \/>\n<meta property=\"og:site_name\" content=\"Examples Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/bhagvank\" \/>\n<meta property=\"article:published_time\" content=\"2020-08-24T08:00:00+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Bhagvan Kommadi\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@bhaggu\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Bhagvan Kommadi\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\"},\"author\":{\"name\":\"Bhagvan Kommadi\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6\"},\"headline\":\"Gradle Build System Tutorial\",\"datePublished\":\"2020-08-24T08:00:00+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\"},\"wordCount\":1449,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\",\"keywords\":[\"gradle\"],\"articleSection\":[\"Gradle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\",\"name\":\"Gradle Build System Tutorial - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\",\"datePublished\":\"2020-08-24T08:00:00+00:00\",\"description\":\"In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/examples.javacodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java Development\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Core Java\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Gradle\",\"item\":\"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/gradle\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Gradle Build System Tutorial\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Examples and Code Snippets\",\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/examples.javacodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/javacodegeeks\",\"https:\/\/x.com\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6\",\"name\":\"Bhagvan Kommadi\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg\",\"caption\":\"Bhagvan Kommadi\"},\"description\":\"Bhagvan Kommadi is the Founder of Architect Corner &amp; has around 20 years\u2019 experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in \u2018Emerging Companies\u2019 section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript. He has reviewed the Manning book titled : \\\"Machine Learning with TensorFlow\u201d. He is also the author of Packt Publishing book - \\\"Hands-On Data Structures and Algorithms with Go\\\".He is member of IFX forum,Oracle JCP and participant in Java Community Process. He is member of the MIT Technology Review Global Panel.\",\"sameAs\":[\"http:\/\/www.architectcorner.com\",\"https:\/\/www.facebook.com\/bhagvank\",\"https:\/\/in.linkedin.com\/pub\/bhagvan-kommadi\/0\/3a6\/b46\",\"https:\/\/x.com\/bhaggu\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/bhagvan-kommadi\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gradle Build System Tutorial - Java Code Geeks","description":"In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Gradle Build System Tutorial - Java Code Geeks","og_description":"In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle","og_url":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_author":"https:\/\/www.facebook.com\/bhagvank","article_published_time":"2020-08-24T08:00:00+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","type":"image\/jpeg"}],"author":"Bhagvan Kommadi","twitter_card":"summary_large_image","twitter_creator":"@bhaggu","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Bhagvan Kommadi","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/"},"author":{"name":"Bhagvan Kommadi","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6"},"headline":"Gradle Build System Tutorial","datePublished":"2020-08-24T08:00:00+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/"},"wordCount":1449,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","keywords":["gradle"],"articleSection":["Gradle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/","url":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/","name":"Gradle Build System Tutorial - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","datePublished":"2020-08-24T08:00:00+00:00","description":"In this tutorial, we will see how to use gradle build in detail with examples. 1. Overview Gradle&nbsp;is a popular build management system. The Gradle","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#primaryimage","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/examples.javacodegeeks.com\/gradle-build-system-tutorial\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/examples.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java Development","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/"},{"@type":"ListItem","position":3,"name":"Core Java","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/"},{"@type":"ListItem","position":4,"name":"Gradle","item":"https:\/\/examples.javacodegeeks.com\/category\/java-development\/core-java\/gradle\/"},{"@type":"ListItem","position":5,"name":"Gradle Build System Tutorial"}]},{"@type":"WebSite","@id":"https:\/\/examples.javacodegeeks.com\/#website","url":"https:\/\/examples.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Examples and Code Snippets","publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/examples.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/examples.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/examples.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/4575ae335b8ff016be62c3b927d5d5e6","name":"Bhagvan Kommadi","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2019\/02\/bhagvan.-kommadi-96x96.jpg","caption":"Bhagvan Kommadi"},"description":"Bhagvan Kommadi is the Founder of Architect Corner &amp; has around 20 years\u2019 experience in the industry, ranging from large scale enterprise development to helping incubate software product start-ups. He has done Masters in Industrial Systems Engineering at Georgia Institute of Technology (1997) and Bachelors in Aerospace Engineering from Indian Institute of Technology, Madras (1993). He is member of IFX forum,Oracle JCP and participant in Java Community Process. He founded Quantica Computacao, the first quantum computing startup in India. Markets and Markets have positioned Quantica Computacao in \u2018Emerging Companies\u2019 section of Quantum Computing quadrants. Bhagvan has engineered and developed simulators and tools in the area of quantum technology using IBM Q, Microsoft Q# and Google QScript. He has reviewed the Manning book titled : \"Machine Learning with TensorFlow\u201d. He is also the author of Packt Publishing book - \"Hands-On Data Structures and Algorithms with Go\".He is member of IFX forum,Oracle JCP and participant in Java Community Process. He is member of the MIT Technology Review Global Panel.","sameAs":["http:\/\/www.architectcorner.com","https:\/\/www.facebook.com\/bhagvank","https:\/\/in.linkedin.com\/pub\/bhagvan-kommadi\/0\/3a6\/b46","https:\/\/x.com\/bhaggu"],"url":"https:\/\/examples.javacodegeeks.com\/author\/bhagvan-kommadi\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/93439","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=93439"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/93439\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media\/20342"}],"wp:attachment":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=93439"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=93439"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=93439"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}