{"id":19769,"date":"2015-02-26T13:00:05","date_gmt":"2015-02-26T11:00:05","guid":{"rendered":"http:\/\/examples.javacodegeeks.com\/?p=19769"},"modified":"2019-04-03T14:03:41","modified_gmt":"2019-04-03T11:03:41","slug":"gradle-hello-world-tutorial","status":"publish","type":"post","link":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/","title":{"rendered":"Gradle &#8220;Hello World&#8221; Tutorial"},"content":{"rendered":"<p>In this post we&#8217;ll look at Gradle, its installation and configuration, and how to automate stages of development and release of software through its base concept, the Gradle tasks.<\/p>\n<h2>1. What is Gradle ?<\/h2>\n<p>Gradle is a build and automation tool, that can automate our building, testing, deploying tasks and many more. Gradle is the next generation build system for Java technologies that includes some advantages from older tools like ant or maven. Let&#8217;s have a look:<\/p>\n<ul>\n<li>Allows declarative and expressive domain-specific-language (DSL). This is a powerful concept because it allows us to write a custom language that is more friendly than Java.<\/li>\n<li>Is Groovy-based. This means that your configuration is made in Groovy statements instead of xml blocks, making it very easy to define the tasks to be performed.<\/li>\n<li>Supports legacy scripts in Ant or Maven, and has full support to Ivy repository infrastructure.<\/li>\n<li>It&#8217;s designed to take advantage of convention over configuration.<\/li>\n<li>Works on non-java projects too.<\/li>\n<li>Easily customizable and&nbsp;scalable.<\/li>\n<\/ul>\n<h2>2. Why Gradle ? I really need a build tool?<\/h2>\n<p>Today, we work on large projects that need&nbsp;automated release process to mitigate risks and failures; a building system as Gradle, permits you to structure a process from the compilation to the deployment in your application server. This approach has several advantages, like spending time on more important tasks for our project (like modeling and coding features) and delegating repetitive tasks to Gradle, or also the use of Groovy dynamic language scripts (DSL) instead of too long xml files.<\/p>\n<p>If you want to do&nbsp;continuous delivery and make your release process automatic, Gradle is a nice tool to carry out&nbsp;these goals.<\/p>\n<h2>3. Downloading&nbsp;Gradle<\/h2>\n<ol>\n<li>At time of this tutorial, Gradle is in your 2.3 version. You can download from <a title=\"Gradle 2.3 Full\" href=\"https:\/\/services.gradle.org\/distributions\/gradle-2.3-all.zip\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/li>\n<li>We need a JDK 1.6 before installing Gradle, if you don&#8217;t have, you can download from <a title=\"JDK 1.6_45 64 Bits\" href=\"http:\/\/download.oracle.com\/otn\/java\/jdk\/6u45-b06\/jdk-6u45-windows-x64.exe\" target=\"_blank\" rel=\"noopener noreferrer\">here<\/a>.<\/li>\n<li>So, unzip the file in any directory that you choose, in this example we set Gradle in C:\/Desarrollo\/Lib\/gradle-2.3.<\/li>\n<\/ol>\n<p><figure id=\"attachment_20223\" aria-describedby=\"caption-attachment-20223\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img decoding=\"async\" class=\"wp-image-20223 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-directory-e1424672735884.jpg\" alt=\"gradle-directory\" width=\"600\" height=\"317\"><figcaption id=\"caption-attachment-20223\" class=\"wp-caption-text\">Gradle Directory Installation<\/figcaption><\/figure><\/p>\n<p>&nbsp;<\/p>\n<h2>4.&nbsp;Setting environment variables<\/h2>\n<p>Then, we have to set enviroment variables to get a full access to Gradle, so create the GRADLE_HOME variable that point to the earlier directory that you set.<\/p>\n<p><strong>Note:<\/strong>&nbsp;The screenshots shown here are taken from Windows 8. Your version of Windows may vary.<\/p>\n<p><figure id=\"attachment_20225\" aria-describedby=\"caption-attachment-20225\" style=\"width: 780px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/environment-variable.jpg\"><img decoding=\"async\" class=\"wp-image-20225 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/environment-variable-e1424672702570.jpg\" alt=\"Environment Variable\" width=\"780\" height=\"420\"><\/a><figcaption id=\"caption-attachment-20225\" class=\"wp-caption-text\">Environment Variable Configuration Step By Step<\/figcaption><\/figure><\/p>\n<p>Next, in the PATH variable add the bin directory of the Gradle installation with <code>%GRADLE_HOME%\\bin<\/code>, with this we can run Gradle from any directory.<\/p>\n<p><figure id=\"attachment_20236\" aria-describedby=\"caption-attachment-20236\" style=\"width: 300px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/path_variable1.jpg\"><img decoding=\"async\" class=\"wp-image-20236 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/path_variable1.jpg\" alt=\"Path Variable Configuration\" width=\"300\" height=\"350\" srcset=\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/path_variable1.jpg 300w, https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/path_variable1-257x300.jpg 257w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><figcaption id=\"caption-attachment-20236\" class=\"wp-caption-text\">Path Variable Configuration<\/figcaption><\/figure><div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<p>To verify that Gradle was successfully installed, go to the console (cmd shell) and run this command: <code>gradle -v<\/code><\/p>\n<pre class=\"brush:bash\">C:\\Users\\Andres&gt;gradle -v\n\n------------------------------------------------------------\nGradle 2.3\n------------------------------------------------------------\n\nBuild time:   2015-02-16 05:09:33 UTC\nBuild number: none\nRevision:     586be72bf6e3df1ee7676d1f2a3afd9157341274\n\nGroovy:       2.3.9\nAnt:          Apache Ant(TM) version 1.9.3 compiled on December 23 2013\nJVM:          1.7.0_67 (Oracle Corporation 24.65-b04)\nOS:           Windows 8.1 6.3 amd64\n<\/pre>\n<h2>5. Hello World! Gradle<\/h2>\n<p>The Gradle&#8217;s starting point is the <code>build.gradle<\/code> file. Any task or project starts with this script. With the default naming convention, this file is called, but we can define any name to our build gradle scripts.<\/p>\n<p>In the example, the first task of gradle is called helloWorld, with using Groovy language we call the Java&#8217;s method <code>System.out.println<\/code> with the Groovy&#8217;s shorter equivalent <code>println<\/code> to print a short message in console.<\/p>\n<p><span style=\"text-decoration: underline\"><em>build.gradle<\/em><\/span><\/p>\n<pre class=\"brush:java\">task helloWorld &lt;&lt; {\n   println 'Welcome to JCG Gradle Tutorial'\n}\n<\/pre>\n<p>To execute the build script, go to the directory where you saved the file and execute the task, running this command:<br \/>\n<code>gradle helloWorld<\/code>, this will be the output.<\/p>\n<pre class=\"brush:java\">E:\\JavaCodeGeeks JCG\\Gradle Tutorial&gt;gradle helloWorld\n:helloWorld\nWelcome to JCG Gradle Tutorial\nBUILD SUCCESSFUL\nTotal time: 1.838 secs\n<\/pre>\n<h2>6. Gradle JVM Options<\/h2>\n<p>As any Java based tool, Gradle can set JVM Options to manage the memory space and another stuff. We can use the environment variables <code>GRADLE_OPTS<\/code> or <code>JAVA_OPTS<\/code>, this configuration prevents an <code>OutOfMemoryError<\/code> setting stable values. For example, we can set the maximum memory allocation pool adding the value <code>-Xmx512m<\/code> in the <code>GRADLE_OPTS<\/code> variable.<\/p>\n<h2>7. Gradle Basic Concepts<\/h2>\n<p>In Gradle we have 2 top concepts, that are Projects and Tasks. Any Gradle script is made up of one or more projects, and every project is made up of one or more tasks.<\/p>\n<ul>\n<li>A Gradle project is any goal what we want to do with Gradle, assemble a JAR, compile a Java project, run Unit tests, deploy an application.<\/li>\n<li>A Gradle task is the minimum unit of work, represents an atomic piece of work. The main goal is define some tasks to accomplish a Project.<\/li>\n<\/ul>\n<p>In&nbsp;our first basic task&nbsp;<code>helloWorld<\/code> we can see what happens:<\/p>\n<ul>\n<li>When you execute the Gradle helloWorld, Gradle will lookup a task with that name in the default build script build.gradle. If Gradle finds the task, it executes the code with the Groovy engine .<\/li>\n<li>Every line of code (LOC) between the braces composes the task<\/li>\n<li>The double &lt;&lt; , is the shorthand to define a Gradle task, the longhand is thus:<\/li>\n<\/ul>\n<pre class=\"brush:java\">task helloWorld {\n\tdoLast {\n\t\tprintln 'Welcome to JCG Gradle Tutorial'\n\t}\n}\n<\/pre>\n<p>Yes, the double &lt;&lt; is the short form to define the doLast task&#8217;s block. We suggest you to use the shorthand way.<\/p>\n<p>Gradle has basic commands that help us to write a more readable and clean code or scripts. Every command have to the shorthand and longhand way to run them.<\/p>\n<ul>\n<li>&#8211;help or -h : Prints out the helper messages.<\/li>\n<li>&#8211;info or -i : Set the logger level to INFO, this level prints a high level of information.<\/li>\n<li>&#8211;debug or -d : Set the Gradle logger level to DEBUG, this is useful for troubleshooting build problems.<\/li>\n<li>&#8211;quiet or -q : Only shows the error messages.<\/li>\n<li>tasks : Show all availables tasks in the current build script, also displayed the tasks defined by the plugin.<\/li>\n<li>&#8211;gui : Launches the Gradle GUI.<\/li>\n<\/ul>\n<p><figure id=\"attachment_20302\" aria-describedby=\"caption-attachment-20302\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-gui-e1424753913544.jpg\"><img decoding=\"async\" class=\"wp-image-20302 size-full\" src=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-gui-e1424753913544.jpg\" alt=\"Gradle GUI\" width=\"600\" height=\"603\"><\/a><figcaption id=\"caption-attachment-20302\" class=\"wp-caption-text\">Gradle GUI<\/figcaption><\/figure>[ulp id=&#8217;1om4ygalA6VlPl7R&#8217;]<\/p>\n<h2>8. Working with Gradle Tasks<\/h2>\n<p>In this post we have only worked with the most basic concept tasks, but can we do more than just print some text on the screen?<\/p>\n<p>If we execute the command Gradle tasks, we get the following output:<\/p>\n<pre class=\"brush:bash\">E:\\JavaCodeGeeks JCG\\Gradle Tutorial&gt;gradle tasks -q\n\n------------------------------------------------------------\nAll tasks runnable from root project\n------------------------------------------------------------\n\nBuild Setup tasks\n-----------------\ninit - Initializes a new Gradle build. [incubating]\nwrapper - Generates Gradle wrapper files. [incubating]\n\nHelp tasks\n----------\ncomponents - Displays the components produced by root project 'Gradle Tutorial'. [incubating]\ndependencies - Displays all dependencies declared in root project 'Gradle Tutorial'.\ndependencyInsight - Displays the insight into a specific dependency in root project 'Gradle Tutorial'.\nhelp - Displays a help message.\nprojects - Displays the sub-projects of root project 'Gradle Tutorial'.\nproperties - Displays the properties of root project 'Gradle Tutorial'.\ntasks - Displays the tasks runnable from root project 'Gradle Tutorial'.\n\nOther tasks\n-----------\nhelloWorld\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>Displays the list of tasks that we do, including default tasks and in other tasks that we define. So, Gradle is like an agent that perform tasks to carry out&nbsp;the projects that we model.<\/p>\n<h3>Default Tasks<\/h3>\n<p>Another important concept is the Default Tasks, which are the tasks that run if no task name indicated. Modify the build.gradle script like this:<\/p>\n<pre class=\"brush:java\">defaultTasks 'beforHelloWorld'\n\ntask helloWorld &lt;&lt; {\n\tprintln 'Welcome to JCG Gradle Tutorial'\n}\n\ntask beforHelloWorld &lt;&lt; {\n\tprintln 'Setting the previous configuration...'\n}\n<\/pre>\n<p>If we run <code><strong>gradle<\/strong><\/code> in the console, it will execute the <code>beforHelloWorld<\/code> task.<\/p>\n<pre class=\"brush:bash\">E:\\JavaCodeGeeks JCG\\Gradle Tutorial&gt;gradle\n:beforHelloWorld\nSetting the previous configuration...\n\nBUILD SUCCESSFUL\n\nTotal time: 2.685 secs\n<\/pre>\n<h3>Task Dependency<\/h3>\n<p>The biggest basic concept that we cover in this tutorial is task dependency. What does that mean? Gradle adds prevalence on execution of dependency-on task instead of the task that depends on it. Modify the build.gradle file as follows:<\/p>\n<pre class=\"brush:java\">defaultTasks 'beforHelloWorld'\n\ntask helloWorld &lt;&lt; {\n\tprintln 'Welcome to JCG Gradle Tutorial'\n}\n\ntask beforHelloWorld (dependsOn:helloWorld) &lt;&lt; {\n\tprintln 'Setting the previous configuration...'\n}\n<\/pre>\n<p>If we run <code><strong>gradle -q<\/strong><\/code> The output will be:<\/p>\n<pre class=\"brush:bash\">E:\\JavaCodeGeeks JCG\\Gradle Tutorial&gt;gradle -q\nWelcome to JCG Gradle Tutorial\nSetting the previous configuration...\n<\/pre>\n<h3>Abbreviated Task Execution<\/h3>\n<p>The last basic and useful tip about Gradle tasks, is the abbreviated calling.<\/p>\n<p>In Gradle, if our task&#8217;s name is so long, we don&#8217;t need to write the complete name to execute them, only specifying the initials in a camelCase format can execute the tasks.<\/p>\n<p>If we run <code><strong>gradle -q hW<\/strong><\/code> The output will be:<\/p>\n<pre class=\"brush:bash\">E:\\JavaCodeGeeks JCG\\Gradle Tutorial&gt;gradle -q hW\nWelcome to JCG Gradle Tutorial\n<\/pre>\n<p>Gradle using regular expressions matches the name of task (helloWorld) and execute it.<\/p>\n<h2>9. Conclusions<\/h2>\n<ul>\n<li>Gradle combining the capabilities of earlier&nbsp;build tools such as Ant and Maven allows you to create flexible and maintainable scripts that are interoperable with Java-based technologies.<\/li>\n<li>The most important concept are the tasks, they are the unit of work in Gradle.<\/li>\n<li>With predefined tasks we don&#8217;t need to make everything by hand.<\/li>\n<li>Gradle is a user-friendly framework, which can be adopted very quickly compared to its predecessors.<\/li>\n<\/ul>\n<h2>10. Download the Gradle Scripts<\/h2>\n<div class=\"download\"><strong>Download<\/strong><br \/>\nYou can download the full source code of this example here: <a href=\"http:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/GradleHelloWorldTutorial.zip\"><strong>GradleHelloWorldTutorial<\/strong><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this post we&#8217;ll look at Gradle, its installation and configuration, and how to automate stages of development and release of software through its base concept, the Gradle tasks. 1. What is Gradle ? Gradle is a build and automation tool, that can automate our building, testing, deploying tasks and many more. Gradle is the &hellip;<\/p>\n","protected":false},"author":37,"featured_media":20342,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[908],"tags":[],"class_list":["post-19769","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-gradle"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Gradle &quot;Hello World&quot; Tutorial - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"In this post we&#039;ll look at Gradle installation and configuration, and how to automate stages of development and release of software through the Gradle tasks\" \/>\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\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gradle &quot;Hello World&quot; Tutorial - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"In this post we&#039;ll look at Gradle installation and configuration, and how to automate stages of development and release of software through the Gradle tasks\" \/>\n<meta property=\"og:url\" content=\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-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:published_time\" content=\"2015-02-26T11:00:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2019-04-03T11:03:41+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=\"Andres Cespedes\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@acespedes12\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Andres Cespedes\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"8 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/\"},\"author\":{\"name\":\"Andres Cespedes\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/a32ee4d7e34cb21bfd2a5a68cf174f8a\"},\"headline\":\"Gradle &#8220;Hello World&#8221; Tutorial\",\"datePublished\":\"2015-02-26T11:00:05+00:00\",\"dateModified\":\"2019-04-03T11:03:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/\"},\"wordCount\":1238,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\",\"articleSection\":[\"Gradle\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/\",\"name\":\"Gradle \\\"Hello World\\\" Tutorial - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg\",\"datePublished\":\"2015-02-26T11:00:05+00:00\",\"dateModified\":\"2019-04-03T11:03:41+00:00\",\"description\":\"In this post we'll look at Gradle installation and configuration, and how to automate stages of development and release of software through the Gradle tasks\",\"breadcrumb\":{\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-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\/java-development\/core-java\/gradle\/gradle-hello-world-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 &#8220;Hello World&#8221; 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\/a32ee4d7e34cb21bfd2a5a68cf174f8a\",\"name\":\"Andres Cespedes\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/12\/Andres-Cespedes_avatar_1418741113-96x96.jpg\",\"contentUrl\":\"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/12\/Andres-Cespedes_avatar_1418741113-96x96.jpg\",\"caption\":\"Andres Cespedes\"},\"description\":\"Andres is a Java Software Craftsman from Medellin Colombia, who strongly develops on DevOps practices, RESTful Web Services, Continuous integration and delivery. Andres is working to improve software process and modernizing software culture on Colombia.\",\"sameAs\":[\"http:\/\/www.javacodegeeks.com\/\",\"http:\/\/co.linkedin.com\/in\/andrespedes12\",\"https:\/\/x.com\/acespedes12\"],\"url\":\"https:\/\/examples.javacodegeeks.com\/author\/andres-cespedes\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gradle \"Hello World\" Tutorial - Java Code Geeks","description":"In this post we'll look at Gradle installation and configuration, and how to automate stages of development and release of software through the Gradle tasks","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\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/","og_locale":"en_US","og_type":"article","og_title":"Gradle \"Hello World\" Tutorial - Java Code Geeks","og_description":"In this post we'll look at Gradle installation and configuration, and how to automate stages of development and release of software through the Gradle tasks","og_url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/","og_site_name":"Examples Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2015-02-26T11:00:05+00:00","article_modified_time":"2019-04-03T11:03:41+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":"Andres Cespedes","twitter_card":"summary_large_image","twitter_creator":"@acespedes12","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"Andres Cespedes","Est. reading time":"8 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#article","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/"},"author":{"name":"Andres Cespedes","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/a32ee4d7e34cb21bfd2a5a68cf174f8a"},"headline":"Gradle &#8220;Hello World&#8221; Tutorial","datePublished":"2015-02-26T11:00:05+00:00","dateModified":"2019-04-03T11:03:41+00:00","mainEntityOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/"},"wordCount":1238,"commentCount":0,"publisher":{"@id":"https:\/\/examples.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","articleSection":["Gradle"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/","url":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/","name":"Gradle \"Hello World\" Tutorial - Java Code Geeks","isPartOf":{"@id":"https:\/\/examples.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#primaryimage"},"image":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#primaryimage"},"thumbnailUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2015\/02\/gradle-logo.jpg","datePublished":"2015-02-26T11:00:05+00:00","dateModified":"2019-04-03T11:03:41+00:00","description":"In this post we'll look at Gradle installation and configuration, and how to automate stages of development and release of software through the Gradle tasks","breadcrumb":{"@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-tutorial\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/java-development\/core-java\/gradle\/gradle-hello-world-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\/java-development\/core-java\/gradle\/gradle-hello-world-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 &#8220;Hello World&#8221; 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\/a32ee4d7e34cb21bfd2a5a68cf174f8a","name":"Andres Cespedes","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/examples.javacodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/12\/Andres-Cespedes_avatar_1418741113-96x96.jpg","contentUrl":"https:\/\/examples.javacodegeeks.com\/wp-content\/uploads\/2014\/12\/Andres-Cespedes_avatar_1418741113-96x96.jpg","caption":"Andres Cespedes"},"description":"Andres is a Java Software Craftsman from Medellin Colombia, who strongly develops on DevOps practices, RESTful Web Services, Continuous integration and delivery. Andres is working to improve software process and modernizing software culture on Colombia.","sameAs":["http:\/\/www.javacodegeeks.com\/","http:\/\/co.linkedin.com\/in\/andrespedes12","https:\/\/x.com\/acespedes12"],"url":"https:\/\/examples.javacodegeeks.com\/author\/andres-cespedes\/"}]}},"_links":{"self":[{"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/19769","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\/37"}],"replies":[{"embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=19769"}],"version-history":[{"count":0,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/19769\/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=19769"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=19769"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/examples.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=19769"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}