{"id":74275,"date":"2018-03-02T10:10:04","date_gmt":"2018-03-02T08:10:04","guid":{"rendered":"https:\/\/www.javacodegeeks.com\/?p=74275"},"modified":"2018-03-02T10:19:21","modified_gmt":"2018-03-02T08:19:21","slug":"gradle-dependencies-java-use-compile-implementation","status":"publish","type":"post","link":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html","title":{"rendered":"Gradle Dependencies for Java, use compile or implementation?"},"content":{"rendered":"<p>While I was explaining to a colleague about using <a href=\"https:\/\/gradle.org\/\" target=\"_blank\" rel=\"noopener\">Gradle<\/a> for <a href=\"https:\/\/java.com\/en\/download\/\" target=\"_blank\" rel=\"noopener\">Java<\/a> projects (he was moving away from <a href=\"https:\/\/maven.apache.org\/\" target=\"_blank\" rel=\"noopener\">Maven<\/a>), we came across various code samples. Some of the examples were using the <em>compile<\/em> configuration for dependencies, while others were using <em>implements<\/em> and <em>api<\/em>.<\/p>\n<pre class=\"brush:java\">dependencies {\r\ncompile 'commons-httpclient:commons-httpclient:3.1'\r\ncompile 'org.apache.commons:commons-lang3:3.5'\r\n}<\/pre>\n<pre class=\"brush:java\">dependencies {\r\napi 'commons-httpclient:commons-httpclient:3.1'\r\nimplementation 'org.apache.commons:commons-lang3:3.5'\r\n}<\/pre>\n<p>This post was a summary based on the documentation and <a href=\"https:\/\/stackoverflow.com\/questions\/46617018\/gradle-java-library-plugin-compared-to-java-plugin\" target=\"_blank\" rel=\"noopener\">StackOverflow questions<\/a> to explain to him which configurations to use.<\/p>\n<h3>New Dependency Configurations<\/h3>\n<p><a href=\"https:\/\/docs.gradle.org\/3.4\/release-notes.html\" target=\"_blank\" rel=\"noopener\">Gradle 3.4<\/a> introduced the <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/java_library_plugin.html\" target=\"_blank\" rel=\"noopener\">Java-library plugin<\/a>, which included the then new configurations <em>implementation<\/em> and <em>api<\/em> (amongst others).\u00a0These were meant to replace the <em>compile<\/em> configuration which was deprecated for this plugin. The idea was that the new configurations would help to prevent leaking of transitive dependencies for multi-module projects.<\/p>\n<p>Please note that in this post I am just using the <em>compile<\/em> vs <em>implementation<\/em>\/<em>api<\/em> configurations as an example. Other new replacement configurations were introduced as well, please read the <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/java_library_plugin.html\" target=\"_blank\" rel=\"noopener\">documentation<\/a> for further information.<div style=\"display:inline-block; margin: 15px 0;\"> <div id=\"adngin-JavaCodeGeeks_incontent_video-0\" style=\"display:inline-block;\"><\/div> <\/div><\/p>\n<h3>Java<\/h3>\n<p>For a Java project using Gradle 3.4+, then it depends on whether you are build an application or a library.<\/p>\n<p>For a library project or a library module in a multiple module project, it is recommended to use the Java-library plugin, so in build.gradle use this<\/p>\n<pre class=\"brush:java\">apply plugin: 'java-library'<\/pre>\n<p>instead of<\/p>\n<pre class=\"brush:java\">apply plugin: 'java'<\/pre>\n<p>Then you would use either <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/java_library_plugin.html#sec:java_library_recognizing_dependencies\" target=\"_blank\" rel=\"noopener\">implementation or api<\/a>, depending on whether you want to expose the dependency to consumers of the library.<\/p>\n<p>For a plain application project, you can stick with the java plugin and continue to use the <em>compile<\/em> configuration. Having said that, I have tried using the Java-library plugin for an app project and it seems to work fine.<\/p>\n<h3>Android<\/h3>\n<p>For an <a href=\"https:\/\/developer.android.com\/index.html\" target=\"_blank\" rel=\"noopener\">Android<\/a> project, the new configurations came with the <a href=\"https:\/\/developer.android.com\/studio\/build\/gradle-plugin-3-0-0-migration.html#new_configurations\" target=\"_blank\" rel=\"noopener\">Android Gradle Plugin 3.0<\/a>. So unless you are still using the 2.x version of <a href=\"https:\/\/developer.android.com\/studio\/index.html\" target=\"_blank\" rel=\"noopener\">Android Studio<\/a> \/ Android Gradle plugin, the use of <em>compile<\/em> is deprecated.\u00a0So you should use <em>implementation<\/em>, even for an app.<\/p>\n<p>In fact, when I recently upgraded my Android Studio, it came up with the message:<\/p>\n<blockquote>\n<p>\nConfiguration \u2018compile\u2019 is obsolete and has been replaced with \u2018implementation\u2019.<br \/>\nIt will be removed at the end of 2018<\/p>\n<\/blockquote>\n<p>I think this also applies if you use <a href=\"https:\/\/kotlinlang.org\/\" target=\"_blank\" rel=\"noopener\">Kotlin<\/a> instead of Java.<\/p>\n<h3>Groovy<\/h3>\n<p>How about a project with <a href=\"http:\/\/groovy-lang.org\/\" target=\"_blank\" rel=\"noopener\">Groovy<\/a> as well as Java? This can be for a mixed Groovy \/ Java project, or for a Java project which needs Groovy for some support tools (such as <a href=\"http:\/\/spockframework.org\/\" target=\"_blank\" rel=\"noopener\">Spock<\/a> or <a href=\"https:\/\/logback.qos.ch\/manual\/groovy.html\" target=\"_blank\" rel=\"noopener\">Logback configuration<\/a>).<\/p>\n<p>In the past I have used the <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/groovy_plugin.html\" target=\"_blank\" rel=\"noopener\">Groovy plugin<\/a> instead of the <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/java_plugin.html\" target=\"_blank\" rel=\"noopener\">Java plugin<\/a> for mixed projects. The Groovy plugin extends the Java plugin and will handle the compilation for Java sources as well as Groovy sources.<\/p>\n<pre class=\"brush:java\">apply plugin: 'groovy'<\/pre>\n<p>You can continue to do this for Java application modules, but the documentation states that the Groovy plugin has compatibility issues with the Java-library plugin so will need a <a href=\"https:\/\/docs.gradle.org\/current\/userguide\/java_library_plugin.html#sec:java_library_known_issues_compat\" target=\"_blank\" rel=\"noopener\">work around<\/a> for library modules.<\/p>\n<p>Of course this short post is for newbies, and has only scratched the surface in terms of learning about all the new dependency configurations.<\/p>\n<div class=\"attribution\">\n<table>\n<tbody>\n<tr>\n<td>Published on Java Code Geeks with permission by David Wong, partner at our <a href=\"\/\/www.javacodegeeks.com\/join-us\/jcg\/\" target=\"_blank\" rel=\"noopener\">JCG program<\/a>. See the original article here: <a href=\"http:\/\/www.davidwong.com.au\/blog\/2018\/03\/gradle-dependencies-for-java-use-compile-or-implementation\/\" target=\"_blank\" rel=\"noopener\">Gradle Dependencies for Java, use compile or implementation?<\/a><\/p>\n<p>Opinions expressed by Java Code Geeks contributors are their own.<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of the examples were using the compile configuration for dependencies, while others were using implements and api. dependencies { compile &#8216;commons-httpclient:commons-httpclient:3.1&#8217; compile &#8216;org.apache.commons:commons-lang3:3.5&#8217; } dependencies { api &#8216;commons-httpclient:commons-httpclient:3.1&#8217; implementation &hellip;<\/p>\n","protected":false},"author":8033,"featured_media":129,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8],"tags":[1692,484,1205],"class_list":["post-74275","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-enterprise-java","tag-android","tag-gradle","tag-groovy"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Gradle Dependencies for Java, use compile or implementation? - Java Code Geeks<\/title>\n<meta name=\"description\" content=\"While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Gradle Dependencies for Java, use compile or implementation? - Java Code Geeks\" \/>\n<meta property=\"og:description\" content=\"While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html\" \/>\n<meta property=\"og:site_name\" content=\"Java Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/javacodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-02T08:10:04+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2018-03-02T08:19:21+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/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=\"David Wong\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@javacodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Wong\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html\"},\"author\":{\"name\":\"David Wong\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/dccdcc3ab0eed2313690cec223f689a9\"},\"headline\":\"Gradle Dependencies for Java, use compile or implementation?\",\"datePublished\":\"2018-03-02T08:10:04+00:00\",\"dateModified\":\"2018-03-02T08:19:21+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html\"},\"wordCount\":526,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/gradle-logo.jpg\",\"keywords\":[\"Android\",\"Gradle\",\"Groovy\"],\"articleSection\":[\"Enterprise Java\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html\",\"name\":\"Gradle Dependencies for Java, use compile or implementation? - Java Code Geeks\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/gradle-logo.jpg\",\"datePublished\":\"2018-03-02T08:10:04+00:00\",\"dateModified\":\"2018-03-02T08:19:21+00:00\",\"description\":\"While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#primaryimage\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/gradle-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2012\\\/10\\\/gradle-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/2018\\\/03\\\/gradle-dependencies-java-use-compile-implementation.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Enterprise Java\",\"item\":\"https:\\\/\\\/www.javacodegeeks.com\\\/category\\\/java\\\/enterprise-java\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Gradle Dependencies for Java, use compile or implementation?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#website\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"name\":\"Java Code Geeks\",\"description\":\"Java Developers Resource Center\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\"},\"alternateName\":\"JCG\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.javacodegeeks.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.javacodegeeks.com\\\/wp-content\\\/uploads\\\/2022\\\/06\\\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/javacodegeeks\",\"https:\\\/\\\/x.com\\\/javacodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.javacodegeeks.com\\\/#\\\/schema\\\/person\\\/dccdcc3ab0eed2313690cec223f689a9\",\"name\":\"David Wong\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b20fc07543a146a035b22b126fc111cc85cc39e7c3608f1d2186bc8d6319b728?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b20fc07543a146a035b22b126fc111cc85cc39e7c3608f1d2186bc8d6319b728?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/b20fc07543a146a035b22b126fc111cc85cc39e7c3608f1d2186bc8d6319b728?s=96&d=mm&r=g\",\"caption\":\"David Wong\"},\"description\":\"David is a software developer who has worked in the UK, Japan and Australia. He likes building apps in Java, web and Android technologies.\",\"sameAs\":[\"http:\\\/\\\/www.davidwong.com.au\\\/blog\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/davidwong37\\\/\"],\"url\":\"https:\\\/\\\/www.javacodegeeks.com\\\/author\\\/david-wong\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Gradle Dependencies for Java, use compile or implementation? - Java Code Geeks","description":"While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of","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:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html","og_locale":"en_US","og_type":"article","og_title":"Gradle Dependencies for Java, use compile or implementation? - Java Code Geeks","og_description":"While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of","og_url":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html","og_site_name":"Java Code Geeks","article_publisher":"https:\/\/www.facebook.com\/javacodegeeks","article_published_time":"2018-03-02T08:10:04+00:00","article_modified_time":"2018-03-02T08:19:21+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/gradle-logo.jpg","type":"image\/jpeg"}],"author":"David Wong","twitter_card":"summary_large_image","twitter_creator":"@javacodegeeks","twitter_site":"@javacodegeeks","twitter_misc":{"Written by":"David Wong","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#article","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html"},"author":{"name":"David Wong","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/dccdcc3ab0eed2313690cec223f689a9"},"headline":"Gradle Dependencies for Java, use compile or implementation?","datePublished":"2018-03-02T08:10:04+00:00","dateModified":"2018-03-02T08:19:21+00:00","mainEntityOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html"},"wordCount":526,"commentCount":0,"publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/gradle-logo.jpg","keywords":["Android","Gradle","Groovy"],"articleSection":["Enterprise Java"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html","url":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html","name":"Gradle Dependencies for Java, use compile or implementation? - Java Code Geeks","isPartOf":{"@id":"https:\/\/www.javacodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#primaryimage"},"image":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#primaryimage"},"thumbnailUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/gradle-logo.jpg","datePublished":"2018-03-02T08:10:04+00:00","dateModified":"2018-03-02T08:19:21+00:00","description":"While I was explaining to a colleague about using Gradle for Java projects (he was moving away from Maven), we came across various code samples. Some of","breadcrumb":{"@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#primaryimage","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/gradle-logo.jpg","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2012\/10\/gradle-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.javacodegeeks.com\/2018\/03\/gradle-dependencies-java-use-compile-implementation.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.javacodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Java","item":"https:\/\/www.javacodegeeks.com\/category\/java"},{"@type":"ListItem","position":3,"name":"Enterprise Java","item":"https:\/\/www.javacodegeeks.com\/category\/java\/enterprise-java"},{"@type":"ListItem","position":4,"name":"Gradle Dependencies for Java, use compile or implementation?"}]},{"@type":"WebSite","@id":"https:\/\/www.javacodegeeks.com\/#website","url":"https:\/\/www.javacodegeeks.com\/","name":"Java Code Geeks","description":"Java Developers Resource Center","publisher":{"@id":"https:\/\/www.javacodegeeks.com\/#organization"},"alternateName":"JCG","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.javacodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.javacodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.javacodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.javacodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/javacodegeeks","https:\/\/x.com\/javacodegeeks"]},{"@type":"Person","@id":"https:\/\/www.javacodegeeks.com\/#\/schema\/person\/dccdcc3ab0eed2313690cec223f689a9","name":"David Wong","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/b20fc07543a146a035b22b126fc111cc85cc39e7c3608f1d2186bc8d6319b728?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/b20fc07543a146a035b22b126fc111cc85cc39e7c3608f1d2186bc8d6319b728?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b20fc07543a146a035b22b126fc111cc85cc39e7c3608f1d2186bc8d6319b728?s=96&d=mm&r=g","caption":"David Wong"},"description":"David is a software developer who has worked in the UK, Japan and Australia. He likes building apps in Java, web and Android technologies.","sameAs":["http:\/\/www.davidwong.com.au\/blog\/","https:\/\/www.linkedin.com\/in\/davidwong37\/"],"url":"https:\/\/www.javacodegeeks.com\/author\/david-wong"}]}},"_links":{"self":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/74275","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/users\/8033"}],"replies":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/comments?post=74275"}],"version-history":[{"count":0,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/posts\/74275\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media\/129"}],"wp:attachment":[{"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/media?parent=74275"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/categories?post=74275"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.javacodegeeks.com\/wp-json\/wp\/v2\/tags?post=74275"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}