CINXE.COM
Gradle | Gradle Build Tool Features
<!DOCTYPE html> <html lang="en-US" class="site-layout" itemscope itemtype="https://schema.org/WebPage"> <head prefix="og: http://ogp.me/ns# website: http://ogp.me/ns/website# "> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>Gradle | Gradle Build Tool Features</title> <link crossorigin href="//assets.gradle.com" rel="preconnect"> <style type="text/css">/*! normalize.css v8.0.0 | MIT License | github.com/necolas/normalize.css */ html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}h1{font-size:2em;margin:.67em 0}hr{box-sizing:content-box;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:transparent}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:baseline}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}template{display:none}[hidden]{display:none}</style> <link rel="stylesheet" href="https://gradle.org/styles.css"> <link rel="apple-touch-icon" sizes="180x180" href="https://gradle.org/icon/apple-touch-icon.png"> <link rel="icon" type="image/png" href="https://gradle.org/icon/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="https://gradle.org/icon/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="https://gradle.org/icon/manifest.json"> <link rel="mask-icon" href="https://gradle.org/icon/safari-pinned-tab.svg" color="#5bbad5"> <link rel="shortcut icon" href="https://gradle.org/icon/favicon.ico"> <meta name="description" content="A categorized list of Gradle Build Tool features that will help you understand some capabilities of Gradle Build Tool for your use cases"> <meta name="apple-mobile-web-app-title" content="Gradle Build Tool"> <meta name="application-name" content="Gradle Build Tool"> <meta name="msapplication-config" content="https://gradle.org/con/browserconfig.xml"> <meta name="theme-color" content="#ffffff"> <meta name="google" content="nositelinkssearchbox"> <meta name="twitter:card" content="summary"> <meta name="twitter:site" content="@gradle"> <meta name="twitter:creator" content="@gradle"> <meta name="twitter:title" content="Gradle | Gradle Build Tool Features"> <meta name="twitter:url" content="https://gradle.org/features/"> <meta name="twitter:description" content="A categorized list of Gradle Build Tool features that will help you understand some capabilities of Gradle Build Tool for your use cases"> <meta name="twitter:image" content="https://gradle.org/images/gradle-400x400.png "> <meta property="og:description" content="A categorized list of Gradle Build Tool features that will help you understand some capabilities of Gradle Build Tool for your use cases"> <meta property="og:image" content="https://gradle.org/images/gradle-400x400.png"> <meta property="og:image:secure_url" content="https://gradle.org/images/gradle-400x400.png"> <meta property="og:image:type" content="image/png"> <meta property="og:site_name" content="Gradle"> <meta property="fb:app_id" content="1986896958304057"> <meta property="og:title" content="Gradle | Gradle Build Tool Features"> <meta property="og:type" content="website"> <meta property="og:url" content="https://gradle.org/features/"> <!-- Events popup --> <script src="https://gradle.org/js/events.js" defer></script> <!-- Google Tag Manager - NEW MODE --> <link rel="stylesheet" href="https://gradle.org/lib/cookie-consent-banner.css"> <script id="bt-google-tag-manager-injector" src="https://gradle.org/js/google-tag-analytics.js" promo_location="dotorg-site"></script> </head> <body class="site-layout__layout"> <!-- Google Tag Manager (noscript) --> <noscript> <iframe src="https://www.googletagmanager.com/ns.html?id=GTM-WRTQKGT" height="0" width="0" style="display:none;visibility:hidden"></iframe> </noscript> <!-- End Google Tag Manager (noscript) --> <!-- CSS is in _notification.scss, JavaScript is in events.js --> <div class="notification" id="close-notification"> <span class="notification__text"><a promo_location="News Banner" href="https://dpeuniversity.gradle.com/app" target="_blank">DPE University is live</a>! Learn more about Gradle Build Tool, Gradle Build Scan, Develocity and the ecosystem </span> <a id="notification-close" class="notification__close" href="#close-notification"><svg width="13" height="13" viewBox="0 0 13 13" xmlns="http://www.w3.org/2000/svg"><title>close</title><path d="M12.082.94L.918 12.06M12.06 12.082L.94.918" stroke="#FFF" fill="none" stroke-linecap="round" stroke-linejoin="round"/></svg></a> </div> <header class="site-layout__header site-header" itemscope itemtype="https://schema.org/WPHeader"> <nav class="site-header__navigation" itemscope itemtype="https://schema.org/SiteNavigationElement"> <div class="site-header__navigation-header"> <a class="logo" href="https://gradle.org/" title="Gradle Logo"><svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="243" height="43" viewBox="0 0 484 102"><defs><style>.cls-1{fill:#02303a;}</style></defs><title>gradle-build-tool-dark-green-primary</title><path class="cls-1" d="M147.17,56.39V70.28a18.16,18.16,0,0,1-5.57,2.81,21.62,21.62,0,0,1-6.33.89,21.08,21.08,0,0,1-7.6-1.3,17,17,0,0,1-5.82-3.63,15.9,15.9,0,0,1-3.72-5.56,18.62,18.62,0,0,1-1.3-7.05,19.36,19.36,0,0,1,1.26-7.1,16.05,16.05,0,0,1,3.57-5.56,15.83,15.83,0,0,1,5.61-3.6,20.21,20.21,0,0,1,7.41-1.29,21.89,21.89,0,0,1,3.91.34,19.51,19.51,0,0,1,3.37.91,15.34,15.34,0,0,1,2.84,1.41,18.65,18.65,0,0,1,2.35,1.83l-1.83,2.9a1.75,1.75,0,0,1-1.12.84,2,2,0,0,1-1.49-.34l-1.57-.91a10,10,0,0,0-1.75-.78,15.42,15.42,0,0,0-2.16-.55,16.15,16.15,0,0,0-2.76-.21,11.86,11.86,0,0,0-4.6.86,9.83,9.83,0,0,0-3.5,2.44,11.13,11.13,0,0,0-2.23,3.82,15.06,15.06,0,0,0-.78,5,15.4,15.4,0,0,0,.84,5.26,11.1,11.1,0,0,0,2.37,3.92,10.21,10.21,0,0,0,3.7,2.44,13.18,13.18,0,0,0,4.82.84,13,13,0,0,0,3.39-.4,16.6,16.6,0,0,0,2.92-1.09V61.19h-4.32a1.3,1.3,0,0,1-1-.35,1.15,1.15,0,0,1-.35-.84V56.39Zm10.42-2.92A10.63,10.63,0,0,1,160.3,50,5.76,5.76,0,0,1,164,48.8a4.53,4.53,0,0,1,2.71.73l-.38,4.39a1.14,1.14,0,0,1-.34.61,1,1,0,0,1-.61.18,6.89,6.89,0,0,1-1.06-.12,8,8,0,0,0-1.36-.12,4.87,4.87,0,0,0-1.73.28,4.42,4.42,0,0,0-1.37.82,5.76,5.76,0,0,0-1.07,1.3,11.15,11.15,0,0,0-.86,1.73v15h-5.87V49.25h3.44a1.42,1.42,0,0,1,1.74,1.47Zm11.3-.83A14.5,14.5,0,0,1,179,48.8a10,10,0,0,1,3.82.69,8.22,8.22,0,0,1,2.85,1.95,8.55,8.55,0,0,1,1.77,3,11.56,11.56,0,0,1,.6,3.8V73.61H185.4a2.78,2.78,0,0,1-1.29-.25,1.79,1.79,0,0,1-.71-1l-.52-1.76a21.88,21.88,0,0,1-1.81,1.46,10.78,10.78,0,0,1-1.82,1.06,10.24,10.24,0,0,1-2,.65,11.78,11.78,0,0,1-2.39.22,9.26,9.26,0,0,1-2.85-.41,6.18,6.18,0,0,1-2.25-1.25,5.53,5.53,0,0,1-1.48-2.06,7.31,7.31,0,0,1-.52-2.87,5.66,5.66,0,0,1,.31-1.85,5.26,5.26,0,0,1,1-1.74,8.38,8.38,0,0,1,1.81-1.57A12.16,12.16,0,0,1,173.61,61a24,24,0,0,1,3.78-.89,36.6,36.6,0,0,1,4.94-.41V58.22a5.36,5.36,0,0,0-1-3.62,3.84,3.84,0,0,0-3-1.18,7.19,7.19,0,0,0-2.36.34,9.81,9.81,0,0,0-1.65.74l-1.29.75a2.59,2.59,0,0,1-1.3.33,1.63,1.63,0,0,1-1-.32,2.54,2.54,0,0,1-.69-.74Zm13.44,10.57a31.33,31.33,0,0,0-4.27.44,11.38,11.38,0,0,0-2.78.81,3.7,3.7,0,0,0-1.49,1.17,2.45,2.45,0,0,0-.46,1.45,2.54,2.54,0,0,0,.92,2.2,3.9,3.9,0,0,0,2.38.67,7,7,0,0,0,3.13-.65,9.45,9.45,0,0,0,2.57-2Zm32.39-24.89V73.61h-3.59a1.38,1.38,0,0,1-1.47-1.07l-.5-2.35a12.46,12.46,0,0,1-3.38,2.73,9.23,9.23,0,0,1-4.45,1,7.93,7.93,0,0,1-6.52-3.24,11.4,11.4,0,0,1-1.85-3.9,19.61,19.61,0,0,1-.66-5.32,16.64,16.64,0,0,1,.74-5,12.18,12.18,0,0,1,2.11-4,9.88,9.88,0,0,1,3.3-2.67,9.53,9.53,0,0,1,4.32-1,8.53,8.53,0,0,1,3.49.64,8.71,8.71,0,0,1,2.59,1.73V38.32Zm-5.87,17.15a5.71,5.71,0,0,0-2.17-1.71,6.28,6.28,0,0,0-2.53-.5,5.48,5.48,0,0,0-2.4.5,4.76,4.76,0,0,0-1.82,1.5,7.27,7.27,0,0,0-1.17,2.57,14.71,14.71,0,0,0-.4,3.67,16.31,16.31,0,0,0,.34,3.62,7.11,7.11,0,0,0,1,2.42,3.72,3.72,0,0,0,1.56,1.35,5,5,0,0,0,2.07.42,6,6,0,0,0,3.11-.76,9.44,9.44,0,0,0,2.42-2.16Zm17.59-17.15V73.61h-5.86V38.32Zm10.38,23.84a11.66,11.66,0,0,0,.66,3.24,6.74,6.74,0,0,0,1.38,2.26,5.56,5.56,0,0,0,2,1.33,7.43,7.43,0,0,0,2.6.44,7.82,7.82,0,0,0,2.46-.34,11,11,0,0,0,1.8-.73c.52-.27,1-.52,1.36-.74a2.25,2.25,0,0,1,1.12-.33,1.22,1.22,0,0,1,1.1.55L253,70a9.81,9.81,0,0,1-2.18,1.91,12.1,12.1,0,0,1-2.53,1.24,14,14,0,0,1-2.68.65A18.78,18.78,0,0,1,243,74a13.07,13.07,0,0,1-4.73-.84,10.64,10.64,0,0,1-3.8-2.49,11.88,11.88,0,0,1-2.54-4.09A16,16,0,0,1,231,60.9a13.48,13.48,0,0,1,.81-4.69,11.3,11.3,0,0,1,2.31-3.82,10.93,10.93,0,0,1,3.68-2.57,12.94,12.94,0,0,1,9.15-.22,9.24,9.24,0,0,1,3.35,2.15,10,10,0,0,1,2.2,3.47,12.92,12.92,0,0,1,.79,4.69A3.83,3.83,0,0,1,253,61.7a1.18,1.18,0,0,1-1.09.46ZM248,58.62a7.21,7.21,0,0,0-.32-2.15,4.93,4.93,0,0,0-1-1.76,4.41,4.41,0,0,0-1.63-1.2,6.22,6.22,0,0,0-6.29,1,7.1,7.1,0,0,0-1.86,4.1ZM280.93,40a19.3,19.3,0,0,1,5,.57,9.53,9.53,0,0,1,3.49,1.67,6.83,6.83,0,0,1,2,2.7,9.33,9.33,0,0,1,.66,3.61,7.2,7.2,0,0,1-.46,2.56,8,8,0,0,1-1.33,2.28,8.61,8.61,0,0,1-2.13,1.82,10.55,10.55,0,0,1-2.91,1.17A10.73,10.73,0,0,1,291.37,59a7.19,7.19,0,0,1,2.12,5.4,9.3,9.3,0,0,1-.76,3.84,7.77,7.77,0,0,1-2.21,2.9A10.06,10.06,0,0,1,287,73a16.79,16.79,0,0,1-4.79.63h-10.9V40Zm-7.22,1.92v13.8H281a11.7,11.7,0,0,0,4-.6,7.68,7.68,0,0,0,2.7-1.56,6,6,0,0,0,1.56-2.21,6.76,6.76,0,0,0,.5-2.54,6.24,6.24,0,0,0-2.15-5.14q-2.16-1.76-6.64-1.75Zm8.43,29.73c2.95,0,5.17-.64,6.69-1.91a7.39,7.39,0,0,0,1.66-8.24,6,6,0,0,0-1.75-2.16,8.05,8.05,0,0,0-2.8-1.37,14,14,0,0,0-3.77-.47h-8.46V71.66ZM318,50V73.61h-1.26A.64.64,0,0,1,316,73l-.21-3.52A13.23,13.23,0,0,1,312,72.75,9.43,9.43,0,0,1,307.24,74a8.93,8.93,0,0,1-3.45-.61,6.36,6.36,0,0,1-2.44-1.78,7.87,7.87,0,0,1-1.47-2.8,12.52,12.52,0,0,1-.5-3.71V50h2.28v15.1a8,8,0,0,0,1.52,5.21,5.57,5.57,0,0,0,4.63,1.89A8.43,8.43,0,0,0,312.12,71a12.35,12.35,0,0,0,3.57-3.27V50Zm11.25-8.14a1.76,1.76,0,0,1-.18.79,2.18,2.18,0,0,1-.46.66,2.15,2.15,0,0,1-.66.45,2.13,2.13,0,0,1-1.62,0,2.15,2.15,0,0,1-1.11-1.11,1.9,1.9,0,0,1-.17-.79,2.08,2.08,0,0,1,.17-.82,2.12,2.12,0,0,1,.45-.68,2.15,2.15,0,0,1,.66-.45,2.13,2.13,0,0,1,1.62,0A2.16,2.16,0,0,1,329,41,1.92,1.92,0,0,1,329.22,41.84Zm-1,8.14V73.61H326V50Zm10.54-10.92V73.61h-2.28V39.06Zm26.38,0V73.61h-1.24a.65.65,0,0,1-.71-.62L363,69.26a12.63,12.63,0,0,1-3.65,3.4,9,9,0,0,1-4.7,1.25,8.2,8.2,0,0,1-6.79-3q-2.43-3-2.43-9.05a16.73,16.73,0,0,1,.68-4.83,11.62,11.62,0,0,1,2-3.89,9.37,9.37,0,0,1,3.22-2.6,9.66,9.66,0,0,1,4.4-1,9.15,9.15,0,0,1,4.16.88,8.59,8.59,0,0,1,3.06,2.61v-14Zm-2.26,16a8,8,0,0,0-3-2.87,8.33,8.33,0,0,0-3.77-.83,8.21,8.21,0,0,0-3.65.76,7.12,7.12,0,0,0-2.63,2.15,9.76,9.76,0,0,0-1.59,3.32,16.24,16.24,0,0,0-.53,4.26c0,3.52.64,6.1,1.94,7.75a6.65,6.65,0,0,0,5.59,2.49,7.82,7.82,0,0,0,4.25-1.22,11.4,11.4,0,0,0,3.39-3.39Zm44.42-13h-11.8V73.61h-2.44V42.08H381.22V40h26.11Zm8,7.52a11.28,11.28,0,0,1,4.54.87,9.33,9.33,0,0,1,3.39,2.46,10.91,10.91,0,0,1,2.1,3.83,17.83,17.83,0,0,1,0,10,11,11,0,0,1-2.1,3.82,9.19,9.19,0,0,1-3.39,2.45,12.58,12.58,0,0,1-9.09,0,9.19,9.19,0,0,1-3.39-2.45,10.67,10.67,0,0,1-2.12-3.82,17.83,17.83,0,0,1,0-10,10.63,10.63,0,0,1,2.12-3.83,9.33,9.33,0,0,1,3.39-2.46A11.33,11.33,0,0,1,415.36,49.6Zm0,22.53a8.8,8.8,0,0,0,3.69-.72,7,7,0,0,0,2.63-2.08,8.93,8.93,0,0,0,1.58-3.26,17.55,17.55,0,0,0,0-8.56,9.07,9.07,0,0,0-1.58-3.29,7,7,0,0,0-2.63-2.1,9.57,9.57,0,0,0-7.38,0,7,7,0,0,0-2.64,2.1,9.6,9.6,0,0,0-1.59,3.29,17.55,17.55,0,0,0,0,8.56A9.45,9.45,0,0,0,409,69.33a6.92,6.92,0,0,0,2.64,2.08A8.8,8.8,0,0,0,415.36,72.13ZM441.85,49.6a11.33,11.33,0,0,1,4.55.87,9.29,9.29,0,0,1,3.38,2.46,10.75,10.75,0,0,1,2.1,3.83,17.59,17.59,0,0,1,0,10,10.79,10.79,0,0,1-2.1,3.82,9.15,9.15,0,0,1-3.38,2.45,12.58,12.58,0,0,1-9.09,0,9.31,9.31,0,0,1-3.4-2.45,10.81,10.81,0,0,1-2.11-3.82,17.59,17.59,0,0,1,0-10,10.77,10.77,0,0,1,2.11-3.83,9.45,9.45,0,0,1,3.4-2.46A11.28,11.28,0,0,1,441.85,49.6Zm0,22.53a8.88,8.88,0,0,0,3.7-.72,7,7,0,0,0,2.63-2.08,9.26,9.26,0,0,0,1.58-3.26,17.87,17.87,0,0,0,0-8.56,9.41,9.41,0,0,0-1.58-3.29,7,7,0,0,0-2.63-2.1,9.6,9.6,0,0,0-7.39,0,7,7,0,0,0-2.63,2.1,9.25,9.25,0,0,0-1.59,3.29,17.23,17.23,0,0,0,0,8.56,9.11,9.11,0,0,0,1.59,3.26,7,7,0,0,0,2.63,2.08A8.8,8.8,0,0,0,441.85,72.13Zm19.64-33.07V73.61h-2.28V39.06ZM104.4,14a13.73,13.73,0,0,0-19.08-.33,1.34,1.34,0,0,0-.42.94,1.37,1.37,0,0,0,.39.95L87,17.33a1.31,1.31,0,0,0,1.71.12,7.78,7.78,0,0,1,4.71-1.57A7.86,7.86,0,0,1,99,29.31C88.1,40.21,73.55,9.67,40.53,25.38a4.49,4.49,0,0,0-2,6.29l5.66,9.79a4.49,4.49,0,0,0,6.07,1.67l.14-.08-.11.08,2.51-1.41a57.53,57.53,0,0,0,7.9-5.9,1.39,1.39,0,0,1,1.81,0h0a1.28,1.28,0,0,1,.49,1,1.32,1.32,0,0,1-.43,1A59.24,59.24,0,0,1,54.24,44l-.08,0-2.51,1.4a7,7,0,0,1-3.48.91,7.22,7.22,0,0,1-6.23-3.57l-5.35-9.25c-10.28,7.26-16.52,21.25-13.17,39a1.32,1.32,0,0,0,1.28,1.06h6.1a1.3,1.3,0,0,0,1.29-1.14,8.93,8.93,0,0,1,17.72,0,1.31,1.31,0,0,0,1.3,1.14h5.94a1.3,1.3,0,0,0,1.29-1.14,8.94,8.94,0,0,1,17.73,0,1.3,1.3,0,0,0,1.29,1.14h5.87a1.3,1.3,0,0,0,1.3-1.28C84.67,64,86.9,54.5,93.26,49.74,115.29,33.26,109.5,19.13,104.4,14ZM81.93,38.93l-4.2-2.11h0a2.64,2.64,0,1,1,4.2,2.12Z"/></svg></a> <button type="button" class="site-header__navigation-button hamburger"> <span class="hamburger__bar"></span> <span class="hamburger__bar"></span> <span class="hamburger__bar"></span> </button> </div> <div class="site-header__navigation-collapsible site-header__navigation-collapsible--collapse"> <ul class="site-header__navigation-items"> <li class="site-header__navigation-item site-header__navigation-submenu-section" tabindex="0"> <span class="site-header__navigation-link active"> About <img class="site-header__down-arrow site-header__icon-light" src="https://gradle.org/images/collapse-light.svg" alt="More on About"> </span> <div class="site-header__navigation-submenu"> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/getting_started_eng.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Getting Started</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/releases" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Releases</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/whats-new/gradle-9" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle 9 (Coming Soon)</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/whats-new/gradle-8" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">What's new in 8.0</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/features" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Features Overview</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/maven-and-gradle" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle & Maven Comparison</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://plugins.gradle.org" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Plugins</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/gradle_ides.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">IDE Integrations</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://declarative.gradle.org/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Declarative Gradle (EAP)</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://scans.gradle.com/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Build Scan</span> </a> </div> </div> </li> <li class="site-header__navigation-item site-header__navigation-submenu-section" tabindex="0"> <span class="site-header__navigation-link "> Docs <img class="site-header__down-arrow site-header__icon-light" src="https://gradle.org/images/collapse-light.svg" alt="More on Docs"> </span> <div class="site-header__navigation-submenu"> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/userguide.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">User Guide</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/gradle_basics.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Basics</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/installation.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Installing Gradle</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/userguide.html#supported_languages_and_frameworks" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Languages and Frameworks</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/building_java_projects.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- Gradle for Java/JVM</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://kotlinlang.org/docs/gradle.html" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- Gradle for Kotlin</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://developer.android.com/build" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- Gradle for Android</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/custom_plugins.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Developing Plugins</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://cookbook.gradle.org/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Cookbook</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://community.gradle.org/contributing/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Contributor Guide</span> </a> </div> </div> </li> <li class="site-header__navigation-item site-header__navigation-submenu-section" tabindex="0"> <span class="site-header__navigation-link "> Learn <img class="site-header__down-arrow site-header__icon-light" src="https://gradle.org/images/collapse-light.svg" alt="More on Learn"> </span> <div class="site-header__navigation-submenu"> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://docs.gradle.org/current/userguide/getting_started_eng.html" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Getting Started</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://dpeuniversity.gradle.com/app/catalog/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Trainings</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://dpeuniversity.gradle.com/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">DPE University</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.com/training/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Events and Webinars</span> </a> </div> </div> </li> <li class="site-header__navigation-item site-header__navigation-submenu-section" tabindex="0"> <span class="site-header__navigation-link "> Get Help <img class="site-header__down-arrow site-header__icon-light" src="https://gradle.org/images/collapse-light.svg" alt="More on Get Help"> </span> <div class="site-header__navigation-submenu"> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/help" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Search for Help</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/slack-invite" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Community Slack</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://discuss.gradle.org/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Community Forums</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://stackoverflow.com/questions/tagged/gradle" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Stack Overflow</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/services" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Commercial Services</span> </a> </div> </div> </li> <li class="site-header__navigation-item site-header__navigation-submenu-section" tabindex="0"> <span class="site-header__navigation-link "> Community <img class="site-header__down-arrow site-header__icon-light" src="https://gradle.org/images/collapse-light.svg" alt="More on Community"> </span> <div class="site-header__navigation-submenu"> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://newsletter.gradle.org" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Newsletter</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://blog.gradle.org" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Blog</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/slack-invite" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Community Slack</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://github.com/gradle/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">GitHub</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/resources" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Channels and Resources</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://discuss.gradle.org/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- Community Forums</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://twitter.com/gradle" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- X/Twitter</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://www.linkedin.com/company/gradle" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- LinkedIn</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://mastodon.social/@Gradle" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- Mastodon</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://www.youtube.com/channel/@GradleInc" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">- YouTube</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.github.io/community/contributing/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Contributor Guide</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.org/fellowship" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Fellowship</span> </a> </div> </div> </li> <li class="site-header__navigation-item site-header__navigation-submenu-section" tabindex="0"> <span class="site-header__navigation-link "> Gradle Inc. <img class="site-header__down-arrow site-header__icon-light" src="https://gradle.org/images/collapse-light.svg" alt="More on Gradle Inc."> </span> <div class="site-header__navigation-submenu"> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.com/develocity" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Develocity</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://scans.gradle.com/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Gradle Build Scan</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://dpe.org/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">DPE.org</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://dpeuniversity.gradle.com/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">DPE University</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.com/training/" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Events</span> </a> </div> <div class="site-header__navigation-submenu-item" itemprop="name"> <a class="site-header__navigation-submenu-item-link" promo_location="Nav Bar Submenu Link" href="https://gradle.com/careers/?_ga=2.256030216.287138346.1663079591-294412720.1663079591" target="_blank" itemprop="url"> <span class="site-header__navigation-submenu-item-link-text">Careers</span> </a> </div> </div> </li> <li class="site-header__navigation-item" itemprop="name"> <a class="site-header__navigation-link site-header__navigation-icon " promo_location="Nav Bar Icon" href="https://github.com/gradle/gradle" target="_blank" itemprop="url"> <img src="https://gradle.org/images/icons/github.svg" alt="GitHub"> </a> </li> <li class="site-header__navigation-item" itemprop="name"> <a class="site-header__navigation-link site-header__navigation-icon " promo_location="Nav Bar Icon" href="https://gradle.org/slack-invite" target="_blank" itemprop="url"> <img src="https://gradle.org/images/icons/slack-black.svg" alt="Community Slack"> </a> </li> </ul> </div> </nav> </header> <div class="site-layout__body"> <div class="layout layout--narrow"> <main class="layout__main"> <h1>Gradle Build Tool Features</h1> <p class="lead">This categorized list of Gradle Build Tool features will help you understand some capabilities of Gradle Build Tool for your use cases. Check out the <a href="https://docs.gradle.org/current/userguide/userguide.html">User Guide</a> for reference and <a href="https://dpeuniversity.gradle.com/app/catalog">Gradle Build Tool Tutorials</a> for getting started.</p> <h2 id="toc">Table of Contents</h2> <ul class="list"> <li> <h4><a href="#running-gradle-builds">Running Gradle Builds</a></h4> <ul> <li><a href="#performance">Performance</a></li> <li><a href="#build-scans">Build Scans</a></li> <li><a href="#execution-options">Execution Options</a></li> </ul> </li> <li> <h4><a href="#authoring-gradle-builds">Authoring Gradle Builds</a></h4> <ul> <li><a href="#build-logic-is-testable-code">Build Logic is Testable Code</a></li> <li><a href="#dependency-management">Dependency Management</a></li> <li><a href="#standardizing-gradle-across-teams">Standardizing Gradle Across Teams</a></li> <li><a href="#software-domain-modeling">Software Domain Modeling</a></li> <li><a href="#gradle-plugin-authoring">Gradle Plugin Authoring</a></li> </ul> </li> <li> <h4><a href="#ecosystem-specific-features">Ecosystem-specific Features</a></h4> <ul> <li><a href="#jvm-applications">JVM Applications</a></li> <li><a href="#android-applications">Android Applications</a></li> <li><a href="#native-applications">Native Applications</a></li> </ul> </li> <li> <h4><a href="#features-for-developer-tool-providers">Features for Developer Tool Providers</a></h4> <ul> <li><a href="#embed-gradle-with-tooling-api">Embed Gradle with Tooling API</a></li> <li><a href="#customizable-logging">Customizable Logging</a></li> </ul> </li> </ul> <section id="running-gradle-builds"> <h2 class="section-header">Running Gradle Builds</h2> <p class="lead">These features affect developers running Gradle builds, and can be taken advantage of by anyone running Gradle.</p> <section id="performance"> <h3 class="subsection-header">Performance</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/incremental_build.html">Incremental Builds</a></h4> <p>Gradle checks between builds whether the input, output, or an implementation of a task has changed since the last build invocation. If not, the task is considered up-to-date and does not need to be executed. Gradle also considers the configuration of the task as part of its input.</p> <h4><a href="https://docs.gradle.org/current/userguide/build_cache.html#sec:task_output_caching">Build Caching</a></h4> <p>If a task has already been executed on another computer, Gradle can skip the execution locally and instead load the task's outputs from the build cache. The typical use case is to let CI builds push to a shared build cache and allow developers to pull from it. A local build cache is also available to reuse task outputs produced earlier on the same machine.</p> <h4><a href="https://docs.gradle.org/current/userguide/custom_tasks.html#incremental_tasks">Incremental Tasks</a></h4> <p>When Gradle discovers that the input or output of a task has changed between build runs, the task is executed again. The task can use the incremental API to learn what files exactly have changed. With this information, the task may not need to rebuild everything.</p> <h4><a href="https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_annotation_processing">Incremental Annotation Processing</a></h4> <p>Incremental annotation processing significantly increases the effectiveness of <a href="#jvm-applications">incremental compilation</a> when supported annotation processors are present.</p> <h4><a href="https://docs.gradle.org/current/userguide/gradle_daemon.html">Compiler Daemon</a></h4> <p>When you need to fork the compilation process, Gradle creates a daemon process that is reused within a multi-project build. This provides a dramatic speed improvement for the compilation process.</p> <h4><a href="https://docs.gradle.org/current/userguide/custom_tasks.html#worker_api">Parallel Execution</a></h4> <p>Gradle allows parallel execution of tasks and intra-task work through a <a href="https://docs.gradle.org/current/userguide/worker_api.html">Worker API</a>. Parallelism is very fine-grained, resulting in faster performance.</p> <h4>Parallel Download of Dependencies</h4> <p>Gradle will download dependency metadata (typically `pom.xml`) and artifacts in parallel. This is done on demand only when the artifacts are required.</p> <h4><a href="https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:task_timeouts">Task Timeouts</a></h4> <p>Every task has a timeout property that can be used to limit its execution time. When a task reaches its timeout, its task execution thread is interrupted, allowing the build to finish.</p> </section> <section id="build-scans"> <h3 class="subsection-header">Build Scans</h3> <p></p> <h4><a href="https://docs.gradle.com/enterprise/get-started/#build_scan_highlights">Web-based Build Visualization</a></h4> <p>Understand what happened in your build via a rich web interface instead of a text console and text files. Build scans provide more information and are more effective.</p> <h4><a href="https://docs.gradle.com/enterprise/get-started/#understand_your_dependencies">Collaborative Debugging</a></h4> <p>Share build scans with colleagues to solve problems efficiently and improve things together. Share entire scans or links focused on a particular build aspect, such as a logging output line.</p> <h4><a href="https://blog.gradle.org/custom-data-in-build-scans">Extend and Customize</a></h4> <p>Add your own data to build scans as tags, values, and links. Integrate build scans into your toolchain.</p> <h4><a href="https://docs.gradle.com/enterprise/get-started/#compare_build_scans_to_find_differences">Fine-grained Build Comparison [Develocity]</a></h4> <p>Build scan comparison quickly highlights differences between builds, such as dependencies and their versions, making root cause analysis much faster.</p> <h4><a href="https://docs.gradle.com/enterprise/admin/current">Track and Export History Across all Builds [Develocity]</a></h4> <p>Track key build metrics for all your builds, including local development builds and not just CI builds. Understand trends and export build scan data to the storage of your choosing.</p> </section> <section id="execution-options"> <h3 class="subsection-header">Execution Options</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/command_line_interface.html#sec:continuous_build">Continuous build</a></h4> <p>When a Gradle task is run in continuous mode, Gradle automatically watches for changes in the input of this task. Whenever the input changes, the task is automatically executed. You can run multiple tasks continuously in a multi-project build.</p> <h4><a href="https://docs.gradle.org/current/userguide/composite_builds.html#defining_composite_builds">Composite builds</a></h4> <p>Composite builds allow you to include other independent projects so that you can, for instance, develop an application and a library that it depends on simultaneously. They build in parallel by default and can be nested.</p> <h4><a href="https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:excluding_tasks_from_the_command_line">Task Exclusion</a></h4> <p>You can exclude any task from being run. When you exclude a task, all tasks this task depends on are also automatically excluded if they have no other dependencies.</p> <h4><a href="https://docs.gradle.org/current/userguide/command_line_interface.html#sec:command_line_execution_options">Dry Run</a></h4> <p>Run a build to see which tasks actually get executed without executing the task actions.</p> <h4><a href="https://docs.gradle.org/current/userguide/tutorial_gradle_command_line.html#sec:continue_build_on_failure">Continue Execution After Failures</a></h4> <p>Builds do not stop when the first failure is encountered. This enables discovering as many failures as possible in a single build execution with a very nice aggregated error report at the end.</p> <h4><a href="https://docs.gradle.org/current/userguide/java_testing.html#sec:test_execution">Fail Fast Test execution</a></h4> <p>Although continuing after a test failure is the default in Gradle, you can set the `--fail-fast` flag or configure `failFast=true` for a Gradle build to fail and finish as soon as one of your tests fails.</p> <h4><a href="https://docs.gradle.org/current/userguide/command_line_interface.html#sec:command_line_execution_options">Sync Dependency Cache with Repository</a></h4> <p>Gradle has a `--refresh-dependencies` option to ignore all cached entries for resolved modules and artifacts. A fresh resolve will be performed against all configured repositories, with dynamic versions recalculated, modules refreshed, and artifacts downloaded. However, Gradle will check if the previously downloaded artifacts are valid before downloading them again. This is done by comparing published SHA1 values in the repository with the SHA1 values for existing downloaded artifacts.</p> </section> <p class="u-text-right"><a href="#toc">↑ Table of Contents</a></p> </section> <section id="authoring-gradle-builds"> <h2 class="section-header">Authoring Gradle Builds</h2> <p class="lead">These features affect build authors and those responsible for developer productivity.</p> <section id="build-logic-is-testable-code"> <h3 class="subsection-header">Build Logic is Testable Code</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/groovy_build_script_primer.html">Groovy DSL</a></h4> <p>Ideally, a Groovy build script looks mostly like configuration, including setting some project properties, configuring dependencies, declaring tasks, etc. That configuration is based on Groovy language constructs.</p> <h4><a href="https://docs.gradle.org/current/userguide/kotlin_dsl.html">Kotlin DSL</a></h4> <p>Gradle鈥檚 Kotlin DSL provides an alternative syntax to the traditional Groovy DSL with an enhanced editing experience in supported IDEs, superior content assistance, refactoring, documentation, and more.</p> <h4><a href="https://docs.gradle.org/current/userguide/build_init_plugin.html">Gradle Init Plugin</a></h4> <p>The Gradle Build Init plugin can create a new Gradle build of various types (Java application, Java library, Groovy library, Kotlin application, etc) or convert existing builds (e.g., An Apache Maven build) into Gradle builds.</p> </section> <section id="dependency-management"> <h3 class="subsection-header">Dependency Management</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/dependency_constraints.html">Transitive Dependencies</a></h4> <p>One of the main benefits of using a dependency management system is managing transitive dependencies. Gradle takes care of downloading and managing transitive dependencies.</p> <h4><a href="https://docs.gradle.org/current/userguide/declaring_dependencies.html#sec:defining-custom-configurations">Custom Dependency Scopes</a></h4> <p>Don't be limited by a predefined set of dependency scopes (compile, runtime, etc). Gradle allows you to define arbitrary dependency scopes. For example, for integration tests that you may model in your build, to provision toolchains you need in your build, etc.</p> <h4><a href="https://docs.gradle.org/current/userguide/declaring_dependencies.html#sub:file_dependencies">File Based Dependencies</a></h4> <p>Not all dependencies are available from external repositories. Declaring dependencies on file system resources can be useful when managed dependencies are impractical or when migrating legacy builds.</p> <h4><a href="https://docs.gradle.org/current/userguide/declaring_repositories.html#sub:defining_custom_pattern_layout_for_an_ivy_repository">Custom Repository Layout</a></h4> <p>Declare repositories with custom layouts. With custom layouts, you can effectively treat nearly any file system directory structure as an artifact repository.</p> <h4><a href="https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:dependency_cache">3rd Party Dependency Cache</a></h4> <p>Dependencies from remote repositories are downloaded and cached locally. Subsequent builds use cached artifacts to avoid unnecessary network traffic.</p> <h4><a href="https://docs.gradle.org/current/userguide/declaring_repositories.html#sec:maven_repo">Maven and Ivy Repository Compatible</a></h4> <p>Gradle is compatible with the POM & IVY Metadata formats and can retrieve dependencies from any Maven or IVY compatible repository. Ivy metadata is exposed to custom resolution rules, allowing you to filter on artifact branch, status, or other custom metadata information.</p> <h4><a href="https://docs.gradle.org/current/userguide/platforms.html#sub:bom_import">Native BOM support</a></h4> <p>Platform definitions, aka Maven BOM dependencies, are supported natively. This enables the import of definitions like the Spring Boot platform without needing an external plugin.</p> <h4><a href="https://docs.gradle.org/current/userguide/dynamic_versions.html#sub:declaring_dependency_with_dynamic_version">Dynamic Dependencies</a></h4> <p>Resolved dependency versions can be dynamic. Gradle supports the Maven snapshot mechanism but is more powerful than that. You can declare a dependency on the latest release, the most current development version, or even the latest 8.X build.</p> <h4><a href="https://docs.gradle.org/current/userguide/dependency_locking.html">Dynamic Dependency Locking</a></h4> <p>Allow builds to remain deterministic and reproducible when using dynamic dependency versions.</p> <h4><a href="https://docs.gradle.org/current/userguide/dynamic_versions.html#sec:component_selection_rules">Dynamic Dependencies Selection Rules</a></h4> <p>Define custom rules to select a specific version when a dynamic dependency is declared. The rules can be based on names and versions and extended metadata like branch or status. The rules can also differ based on the environment in which the build is happening, e.g., local or CI.</p> <h4><a href="https://docs.gradle.org/current/userguide/dependency_version_alignment.html">Dependency Version Alignment</a></h4> <p>Dependency alignment allows different modules in a logical group (Jackson modules, for example) to be aligned to the same version.</p> <h4><a href="https://docs.gradle.org/current/userguide/dependency_resolution.html#sec:version-conflict">Version Conflict Resolution</a></h4> <p>Gradle resolves conflicts to the newest requested version by default. You can customize this behavior.</p> <h4><a href="https://docs.gradle.org/current/userguide/resolution_rules.html#sec:dependency_substitution_rules">Substitution of Compatible Libraries</a></h4> <p>Use dependency substitution rules to specify which dependency to use. For instance, you can instruct Gradle to resolve conflicts by selecting the latest version of log4j or log4j-over-slf4j. This is particularly useful in cases where libraries like spring-all and spring-core are present in the dependency graph. Without proper management, your application's behavior can depend on the fragile classpath order.</p> <h4><a href="https://docs.gradle.org/current/userguide/component_metadata_rules.html">Enhanced Metadata Resolution Support</a></h4> <p>You can adjust dependency metadata after Gradle downloads repository metadata but before it selects the resolved version. This flexibility enables the creation of custom rules for declaring modules as changing (snapshot) versions or using a custom status scheme.</p> <h4><a href="https://docs.gradle.org/current/userguide/resolution_rules.html#sec:dependency_substitution_rules">Replacement of external and project dependencies</a></h4> <p>Dynamically replace external dependencies for project dependencies and vice versa. This is especially helpful when only a subset of your modules are checked out locally.</p> </section> <section id="standardizing-gradle-across-teams"> <h3 class="subsection-header">Standardizing Gradle Across Teams</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/gradle_wrapper.html">Self-Provisioning Build Environment</a></h4> <p>With the Gradle wrapper, the Gradle build environment is auto-provisioned. Furthermore, you can determine which version should be used to build your project.</p> <h4><a href="https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties">Version Controlled Build Environment Configuration</a></h4> <p>Important parameters for configuring the build environment can be stored in version as part of your project. No need for the developers to set them up manually. This includes the Gradle version to be used, the configuration for the JVM running the build, and the JDK for running the build.</p> <h4><a href="https://docs.gradle.org/current/userguide/init_scripts.html">Custom Distributions</a></h4> <p>Every Gradle distribution has an init.d directory in which you can put custom scripts that pre-configure your build environment. You can use this to apply enforced custom rules, provide built-in setup tasks for developers, and more. Together with the Gradle wrapper, you can easily distribute those custom distributions.</p> </section> <section id="software-domain-modeling"> <h3 class="subsection-header">Software Domain Modeling</h3> <p></p> <h4><a href="https://docs.gradle.org/current/javadoc/org/gradle/api/NamedDomainObjectContainer.html">Domain Object Containers</a></h4> <p>Every domain object describing your build, be it repositories, source directories, plugins, or dependencies, is stored in a responsive container that you can register a listener with. You have full control over what particular build scripts add to a build. Augment or modify what has been added, let the build fail, or issue a warning. For example, you can define dependencies that are only added if a build adds a particular plugin.</p> <h4>Publishing Multiple Artifacts</h4> <p>Gradle can publish multiple artifacts per project with different metadata. Be it an API and an implementation jar, a library and a test fixture, or variants for different Java platforms.</p> <h4><a href="https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:ordering_tasks">Advanced Task Ordering</a></h4> <p>Beyond having full control of the dependencies created between tasks, Gradle has powerful language constructs to describe execution order between tasks, even if those tasks do not depend on each other's output. This can be modeled with shouldRunAfter and mustRunAfter relationships.</p> <h4><a href="https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:task_input_output_side_effects">Task Dependency Inference</a></h4> <p>Gradle objects are aware of which tasks produce certain content. For example, the object representing the Java binary directory knows that the compile task produces the binaries. Any task with the Java binary directory as an input will automatically depend on the compile task. It does not need to be declared manually. This makes the build easier to maintain and more robust.</p> <h4><a href="https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:finalizer_tasks">Task Finalizers</a></h4> <p>Tasks can be assigned to finalize other tasks similar to a finalizer clause in Java. These special tasks always run after another task is executed, regardless of whether this task fails or not. This can be very powerful when doing lifecycle management for containers or databases.</p> <h4><a href="https://docs.gradle.org/current/userguide/more_about_tasks.html#sec:task_rules">Dynamic Task Creation</a></h4> <p>Sometimes you want a task whose behavior depends on a large or infinite number value range of parameters. Creating task rules is a very nice and expressive way to provide such tasks.</p> <h4><a href="https://docs.gradle.org/current/userguide/build_lifecycle.html#build_lifecycle_events">Fine-Grained Build Event Listener</a></h4> <p>Gradle allows you to hook into every part of the build configuration and execution lifecycle for injecting custom behavior, extracting information, adding additional logging, and tons of other use cases.</p> <h4><a href="https://docs.gradle.org/current/userguide/init_scripts.html">User-Based Behavior Injection</a></h4> <p>You can put custom listeners into your Gradle user home that hook into every Gradle build executed on your machine. With the lifecycle listeners described above, you can add custom behavior to individualize your build experience. For example, adding and configuring the Gradle announcement plugin that pops up a window when the build finishes or adding a repository you use personally.</p> <h4><a href="https://docs.gradle.org/current/userguide/init_scripts.html">Per Build Behavior Injection</a></h4> <p>Similar to user-based behavior injection, you can specify additional listeners that hook into a build on the command line. For example, this can be very helpful if you want your CI build to have specific behavior (e.g., fail if a non-standard repository is used).</p> </section> <section id="gradle-plugin-authoring"> <h3 class="subsection-header">Gradle Plugin Authoring</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/test_kit.html">TestKit for Functional Testing</a></h4> <p>Programmatic execution of build through API agnostic of test framework. Inspection of build outcome and output. Cross-version compatibility testing. Debugging the build under test from the IDE.</p> <h4><a href="https://docs.gradle.org/current/userguide/custom_tasks.html#sec:declaring_and_using_command_line_options">Custom Command Line Options</a></h4> <p>The task API supports a mechanism for marking a property to automatically generate a corresponding command line parameter with a specific name at runtime.</p> </section> <p class="u-text-right"><a href="#toc">↑ Table of Contents</a></p> </section> <section id="ecosystem-specific-features"> <h2 class="section-header">Ecosystem-specific Features</h2> <p class="lead">Features specific to JVM, Android, C++, Swift, Objective C, and other ecosystems.</p> <section id="jvm-applications"> <h3 class="subsection-header">JVM Applications</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/java_plugin.html#sec:incremental_compile">Incremental Compilation for Java</a></h4> <p>Whether the source code or the classpath changes, Gradle detects all classes affected by the change and will only recompile those.</p> <h4><a href="https://docs.gradle.org/current/userguide/java_plugin.html#sec:java_compile_avoidance">Compile Avoidance for Java</a></h4> <p>If a dependent project has changed in an ABI-compatible way (only its private API has changed), Java compilation tasks will be up-to-date.</p> <h4><a href="https://docs.gradle.org/current/userguide/groovy_plugin.html">Built-in Groovy Support</a></h4> <p>The Groovy plugin extends the Java plugin to add support for Groovy projects. It can deal with Groovy code, mixed Groovy and Java code, and even pure Java code.</p> <h4><a href="https://docs.gradle.org/current/userguide/scala_plugin.html">Built-in Scala Support</a></h4> <p>The Scala plugin extends the Java plugin to add support for Scala projects. It can deal with Scala code, mixed Scala and Java code, and even pure Java code.</p> <h4>Built-in Support for JVM Code Quality Tools</h4> <p>The Gradle distribution includes plugins for <a href="https://docs.gradle.org/current/userguide/checkstyle_plugin.html">Checkstyle</a>, <a href="https://docs.gradle.org/current/userguide/codenarc_plugin.html">CodeNarc</a>, <a href="https://docs.gradle.org/current/userguide/pmd_plugin.html">PMD</a>, <a href="https://docs.gradle.org/current/userguide/jacoco_plugin.html">JaCoCo</a>, and other tools.</p> <h4><a href="https://docs.gradle.org/current/userguide/working_with_files.html#sec:archives">Packaging and Distribution for JARs, WARs, and EARs</a></h4> <p>Gradle comes out-of-the-box with tools to package JVM-based code into common archive files.</p> <h4><a href="https://docs.gradle.org/current/userguide/publishing_maven.html">Publishing to Maven Repositories</a></h4> <p>Publish artifacts to Maven repositories like Bintray or Maven Central.</p> <h4><a href="https://docs.gradle.org/current/userguide/publishing_ivy.html">Publishing to Ivy Repositories</a></h4> <p>Publish artifacts to Ivy repositories with customizable directory layouts.</p> <h4><a href="https://docs.gradle.org/current/userguide/ant.html">Ant Integration</a></h4> <p>You can deeply integrate any default, optional, or custom Ant task. You can also import Ant builds at runtime and even partially replace Ant targets dependent on Gradle tasks.</p> </section> <section id="android-applications"> <h3 class="subsection-header">Android Applications</h3> <p></p> <h4>Official Android Build Tool</h4> <p>The Gradle Android Plugin and Android Studio are official tools provided and maintained by the Android SDK Tools team. To learn more about using Gradle with Android, please reference the <a href="https://developer.android.com/studio/build">Android Developer Documentation for Gradle</a>.</p> </section> <section id="native-applications"> <h3 class="subsection-header">Native Applications</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html">Build C/C++/Obj-C/Obj-C++/Assembler</a></h4> <p>Gradle has built-in support for compiling and linking programs using Assembler, C/C++, and Obj-C/C++. Gradle can build shared and static libraries and executables.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native_binaries:variants">Model variants of a native component</a></h4> <p>Easily model variants of a native component like support for different ABI's, OS, build types, etc.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native-binaries:tool-chain-support">GCC Support</a></h4> <p>Gradle supports building with GCC4 on Linux, Windows (with Cygwin and MingW), and Mac OS X.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native-binaries:tool-chain-support">Clang Support</a></h4> <p>Gradle supports building with Clang on Linux and Mac OS X.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native-binaries:tool-chain-support">MS Visual C++ Support</a></h4> <p>Gradle supports building with Microsoft's Visual C++ compiler on Windows. (VS 2010, VS 2013, and VS 2015 supported)</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native_binaries:windows-resources">Generates Windows Resources</a></h4> <p>Gradle uses Microsoft's resource compiler to build Windows resource script files into your application.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#sec:parallel_compilation">Parallel Compilation</a></h4> <p>When building native code, Gradle divides the compilation step into parallelizable tasks and executes them in a shared resource pool. This speeds up the single project case and ensures that Gradle does not consume too many resources in parallel multi-project builds.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native_binaries:preCompiledHeaders">Precompiled Headers</a></h4> <p>Gradle makes it easy to use precompiled headers when building your software. Precompiled headers can speed up compilation times if your project has many header files included in most of your source code. Precompiled headers are a compiler-specific optimization to cache an already parsed version of your headers.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#sec:configuring_the_compiler_assembler_and_linker">Build mixed language binaries</a></h4> <p>Gradle can build separate languages (e.g., Assembler and C) and link them into a single executable or library.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native_binaries:cunit">CUnit Test Support</a></h4> <p>Gradle supports testing C applications with CUnit.</p> <h4><a href="https://docs.gradle.org/current/userguide/native_software.html#native_binaries:google_test">GoogleTest Support</a></h4> <p>Gradle supports testing C++ applications with GoogleTest.</p> <h4><a href="https://docs.gradle.org/current/userguide/build_cache.html">Cached Compilation</a></h4> <p>When building native code, Gradle uses the build cache to avoid recompiling code that hasn't changed. Compiler arguments, macro definitions, and headers are all considered when reusing cached compilation.</p> </section> <p class="u-text-right"><a href="#toc">↑ Table of Contents</a></p> </section> <section id="features-for-developer-tool-providers"> <h2 class="section-header">Features for Developer Tool Providers</h2> <p class="lead">These features will be most interesting for those working on IDEs and continuous integration systems, but there are many other creative uses.</p> <section id="embed-gradle-with-tooling-api"> <h3 class="subsection-header">Embed Gradle with Tooling API</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/embedding.html">SDK for embedded usage</a></h4> <p>Provided by the Gradle Tooling API</p> <h4><a href="https://docs.gradle.org/current/userguide/embedding.html#sec:embedding_features">Version agnostic</a></h4> <p>The Gradle tooling API is backward and forward-compatible. With a particular version of the Tooling API you can drive build across all Gradle versions since 1.0.</p> <h4>Querying for Project model</h4> <p>You can query Gradle for the details of a build, including the project hierarchy, project dependencies, external dependencies (including source and Javadoc jars), source directories, and tasks in each project.</p> <h4>Query for Build environment information</h4> <p>Gradle provides programmatic access to information about the build environment. This includes information about the Gradle Version, The Gradle User Home directory, and the Java Home directory.</p> <h4>Execute a build</h4> <p>You can execute a build and listen to stdout and stderr logging and progress (e.g., the stuff shown in the 'status bar' when you run on the command line).</p> <h4>Build Operation Cancellation</h4> <p>All operations initiated via the Gradle Tooling API are gracefully cancellable at any time during the build</p> <h4>Support custom JVM settings</h4> <p>JVM args provided via the Gradle Tooling API take precedence over gradle.properties</p> <h4>Provide Eclipse Project Model</h4> <p>The Gradle Tooling API provides a model of how your project is mapped to an Eclipse project.</p> <h4>Provide IDEA Project Model</h4> <p>The Gradle Tooling API provides a model of how your project is mapped to the IDEA model.</p> <h4>Provide support for custom Project Model</h4> <p>You can write a Gradle plugin to add custom metadata for the Gradle Tooling API. You can use this, for example, when you integrate your own product/customizations with Gradle.</p> <h4>Run specific tests</h4> <p>The TestLauncher API allows running specific JUnit or TestNG Tests within one or more Test Tasks</p> <h4>Register for progress events</h4> <p>Register for events of task or test progress to get informed about the process of the build with rich information about the processed task and test</p> <h4>Run Continuous Builds</h4> <p>Gradle Tooling API provides the functionality to run a build programmatically in "continuous build" mode. Changes in build inputs (File changes) continuously trigger specified tasks to run.</p> </section> <section id="customizable-logging"> <h3 class="subsection-header">Customizable Logging</h3> <p></p> <h4><a href="https://docs.gradle.org/current/userguide/logging.html#sec:changing_what_gradle_logs">Custom Logging Schemas</a></h4> <p>You can replace much of Gradle鈥檚 logging UI with your own. You might do this, for example, if you want to customize the UI in some way, e.g., to log more or less information or to change the formatting.</p> <h4><a href="https://docs.gradle.org/current/userguide/logging.html#sec:external_tools">Redirecting Output from Other Tools</a></h4> <p>The build output is very important for the build user experience. Integrating with external tools and libraries might make the console output very verbose. In Gradle System.out, the log output of Java Util Logging, Jakarta Commons Logging, and Log4j is re-routed to the Gradle logging system. You can route and define the log level on a per-tool basis.</p> </section> <p class="u-text-right"><a href="#toc">↑ Table of Contents</a></p> </section> <div class="call-to-action"> <a class="call-to-action__wide-button button button--new-blue" href="https://docs.gradle.org/current/userguide/getting_started_eng.html">Get Started with Gradle</a> <a class="call-to-action__wide-button button button--transparent-new-blue" href="https://gradle.org/maven-and-gradle">Compare Maven and Gradle</a> </div> </main> </div> </div> <footer class="site-layout__footer site-footer" itemscope itemtype="https://schema.org/WPFooter"> <div class="cookie-consent-holder"> </div> <div class="site-footer__contents"> <div class="site-footer__copy">© Gradle Inc. <time datetime="2025-02-20T02:29:11+00:00">2025</time> </div> <div class="site-footer__logo"><a href="https://gradle.org/"><svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 90 66.06"><defs><style>.cls-1{fill:#02303a;}</style></defs><path class="cls-1" d="M85.11,4.18a14.27,14.27,0,0,0-19.83-.34,1.38,1.38,0,0,0,0,2L67,7.6a1.36,1.36,0,0,0,1.78.12A8.18,8.18,0,0,1,79.5,20.06C68.17,31.38,53.05-.36,18.73,16a4.65,4.65,0,0,0-2,6.54l5.89,10.17a4.64,4.64,0,0,0,6.3,1.73l.14-.08-.11.08L31.53,33a60.29,60.29,0,0,0,8.22-6.13,1.44,1.44,0,0,1,1.87-.06h0a1.34,1.34,0,0,1,.06,2A61.61,61.61,0,0,1,33,35.34l-.09,0-2.61,1.46a7.34,7.34,0,0,1-3.61.94,7.45,7.45,0,0,1-6.47-3.71l-5.57-9.61C4,32-2.54,46.56,1,65a1.36,1.36,0,0,0,1.33,1.11H8.61A1.36,1.36,0,0,0,10,64.87a9.29,9.29,0,0,1,18.42,0,1.35,1.35,0,0,0,1.34,1.19H35.9a1.36,1.36,0,0,0,1.34-1.19,9.29,9.29,0,0,1,18.42,0A1.36,1.36,0,0,0,57,66.06H63.1a1.36,1.36,0,0,0,1.36-1.34c.14-8.6,2.46-18.48,9.07-23.43C96.43,24.16,90.41,9.48,85.11,4.18ZM61.76,30.05l-4.37-2.19h0a2.74,2.74,0,1,1,4.37,2.2Z"/></svg></a></div> <div class="site-footer__links"> <a href="https://gradle.com/careers">Careers</a> | <a href="https://gradle.com/legal/privacy/">Privacy</a> | <a href="https://gradle.com/legal/terms-of-service/">Terms of Service</a> | <a href="https://gradle.org/contact">Contact</a> </div> </div> <!-- ZoomInfo Tracking --> <noscript> <img src="https://ws.zoominfo.com/pixel/62b031a4302314008eaace75" width="1" height="1" style="display: none;" alt="websights"/> </noscript> </footer> <script src="https://gradle.org/js/site-header.js"></script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "Organization", "name": "Gradle", "url": "https://gradle.org", "logo": "https://gradle.org/images/gradle-knowledge-graph-logo.png?20170228", "contactPoint": [{ "@type": "ContactPoint", "telephone": "+1-415-446-9553", "contactType": "sales", "areaServed": ["US"] }], "sameAs": [ "https://www.wikidata.org/entity/Q965596", "https://twitter.com/gradle", "https://www.linkedin.com/company/gradle/", "https://www.youtube.com/channel/UCvClhveoEjokKIuBAsSjEwQ" ] } </script> <script type="application/ld+json"> { "@context": "http://schema.org", "@type": "WebSite", "name": "Gradle", "url": "https://gradle.org" } </script> <!-- Pardot Analytics --> <script> piAId = "69052"; piCId = "2332"; (function() { function async_load(){ var s = document.createElement("script"); s.type = "text/javascript"; s.src = ("https:" == document.location.protocol ? "https://pi" : "http://cdn") + ".pardot.com/pd.js"; var c = document.getElementsByTagName("script")[0]; c.parentNode.insertBefore(s, c); } if(window.attachEvent) { window.attachEvent("onload", async_load); } else { window.addEventListener("load", async_load, false); } })(); </script> <!-- Twitter universal website tag code --> <script> !function(e,t,n,s,u,a){e.twq||(s=e.twq=function(){s.exe?s.exe.apply(s,arguments):s.queue.push(arguments); },s.version='1.1',s.queue=[],u=t.createElement(n),u.async=!0,u.src='//static.ads-twitter.com/uwt.js', a=t.getElementsByTagName(n)[0],a.parentNode.insertBefore(u,a))}(window,document,'script'); twq('init','nv83n'); twq('track','PageView'); </script> <!-- End Twitter universal website tag code --> </body> </html>