<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Gradle on Jean-Christophe Gay</title><link>https://jeanchristophegay.com/en/tags/gradle/</link><description>Recent content in Gradle on Jean-Christophe Gay</description><generator>Hugo -- gohugo.io</generator><language>en-US</language><copyright>© 2026 Jean-Christophe Gay</copyright><lastBuildDate>Tue, 18 Aug 2026 23:08:47 +0200</lastBuildDate><atom:link href="https://jeanchristophegay.com/en/tags/gradle/index.xml" rel="self" type="application/rss+xml"/><item><title>Desktop notifications for Gradle</title><link>https://jeanchristophegay.com/en/posts/gradle-desktop-notification/</link><pubDate>Wed, 13 May 2015 17:35:00 +0200</pubDate><guid>https://jeanchristophegay.com/en/posts/gradle-desktop-notification/</guid><description>&lt;p&gt;When building projects, time can pass slowly&amp;hellip; Most of the time they run as background tasks and I like to have a notification when they have finished.&lt;br&gt;
There is a built-in plugin for Gradle to send notifications but we&amp;rsquo;ll see how to get more possible notifiers !&lt;/p&gt;

&lt;h1 class="relative group"&gt;Gradle Build Announcements
 &lt;div id="gradle-build-announcements" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#gradle-build-announcements" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;This is the built-in &lt;a href="https://gradle.org/docs/current/userguide/build_announcements_plugin.html" target="_blank" rel="noreferrer"&gt;plugin&lt;/a&gt; distributed with Gradle. It relies on &lt;a href="https://gradle.org/docs/current/userguide/announce_plugin.html" target="_blank" rel="noreferrer"&gt;Announce&lt;/a&gt; plugin, which allow sending custom notifications during a build.&lt;br&gt;
It comes with four possible implementations:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;twitter&lt;/li&gt;
&lt;li&gt;notify-send&lt;/li&gt;
&lt;li&gt;Snarl&lt;/li&gt;
&lt;li&gt;Growl&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="growl.success"
 src="https://jeanchristophegay.com/images/gradle.announce.growl.success.thumbnail.png"
 width="298"
 height="60"&gt;&lt;/figure&gt;

&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="growl.failure"
 src="https://jeanchristophegay.com/images/gradle.announce.growl.failure.png"
 width="298"
 height="59"&gt;&lt;/figure&gt;
&lt;/p&gt;
&lt;p&gt;It is easy to activate, just add in your &lt;code&gt;build.gradle&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;apply plugin: 'build-announcements'
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;or use it in &lt;code&gt;$HOME/.gradle/init.gradle&lt;/code&gt; to have the plugin running by default for all your Gradle projects:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;rootProject {
 apply plugin: 'build-announcements'
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;It is really nice to have this functionality available without extra installation&amp;hellip; But there is not so much tools available and sent notifications lack of visual distinction (icon is always the same whatever the build result).&lt;/p&gt;

&lt;h1 class="relative group"&gt;Gradle notifier
 &lt;div id="gradle-notifier" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#gradle-notifier" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h1&gt;
&lt;p&gt;As I already have written my own notifications for Maven with &lt;a href="https://github.com/jcgay/maven-notifier" target="_blank" rel="noreferrer"&gt;maven-notifier&lt;/a&gt;, I have just migrated them to run with Gradle in &lt;a href="https://github.com/jcgay/gradle-notifier" target="_blank" rel="noreferrer"&gt;gradle-notifier&lt;/a&gt;!&lt;/p&gt;
&lt;p&gt;It comes with support for:&lt;/p&gt;
&lt;table&gt;
	&lt;thead&gt;
			&lt;tr&gt;
					&lt;th style="text-align: center"&gt;Notifier&lt;/th&gt;
					&lt;th&gt;Screenshot&lt;/th&gt;
			&lt;/tr&gt;
	&lt;/thead&gt;
	&lt;tbody&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;Growl&lt;/strong&gt;, for &lt;a href="http://www.growlforwindows.com/gfw/" target="_blank" rel="noreferrer"&gt;Windows&lt;/a&gt; and &lt;a href="http://growl.info/" target="_blank" rel="noreferrer"&gt;OS X&lt;/a&gt;.&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="Growl"
 src="https://jeanchristophegay.com/images/gradle.notifier.growl.thumbnail.png"
 width="299"
 height="60"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="http://snarl.fullphat.net/" target="_blank" rel="noreferrer"&gt;Snarl&lt;/a&gt;&lt;/strong&gt;, for Windows&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="Snarl"
 src="https://jeanchristophegay.com/images/gradle.notifier.snarl.png"
 width="290"
 height="64"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="https://github.com/alloy/terminal-notifier" target="_blank" rel="noreferrer"&gt;terminal-notifier&lt;/a&gt;&lt;/strong&gt;, OS X&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="terminal-notifier"
 src="https://jeanchristophegay.com/images/gradle.notifier.notificationcenter.thumbnail.png"
 width="323"
 height="62"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;notification center&lt;/strong&gt; OS X (since Mavericks)&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="notification-center"
 src="https://jeanchristophegay.com/images/notifier.simplenc.thumbnail.png"
 width="324"
 height="63"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;notify-send&lt;/strong&gt; for Linux&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="notify-send"
 src="https://jeanchristophegay.com/images/gradle.notifier.notifysend.png"
 width="354"
 height="74"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;SystemTray&lt;/strong&gt; since Java 6&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="System Tray"
 src="https://jeanchristophegay.com/images/notifier.system.tray_.success.png"
 width="287"
 height="178"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="https://www.pushbullet.com/" target="_blank" rel="noreferrer"&gt;Pushbullet&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="pushbullet"
 src="https://jeanchristophegay.com/images/gradle.notifier.pushbullet.thumbnail.png"
 width="360"
 height="119"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;Kdialog&lt;/strong&gt; for KDE&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="Kdialog"
 src="https://jeanchristophegay.com/images/gradle.notifier.kdialog.png"
 width="360"
 height="107"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="http://www.paralint.com/projects/notifu/index.html" target="_blank" rel="noreferrer"&gt;notifu&lt;/a&gt;&lt;/strong&gt; for Windows&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="notifu"
 src="https://jeanchristophegay.com/images/gradle.notifier.notifu.png"
 width="329"
 height="112"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;AnyBar&lt;/strong&gt; for &lt;a href="https://github.com/tonsky/AnyBar" target="_blank" rel="noreferrer"&gt;OS X&lt;/a&gt; and &lt;a href="https://github.com/limpbrains/somebar" target="_blank" rel="noreferrer"&gt;Linux&lt;/a&gt;&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="anybar"
 src="https://jeanchristophegay.com/images/gradle.notifier.anybar.thumbnail.png"
 width="315"
 height="99"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="https://github.com/nels-o/toaster" target="_blank" rel="noreferrer"&gt;Toaster&lt;/a&gt;&lt;/strong&gt; for Windows 8&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="Toaster"
 src="https://jeanchristophegay.com/images/gradle.notifier.toaster.png"
 width="385"
 height="90"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="https://github.com/dorkbox/Notify" target="_blank" rel="noreferrer"&gt;Notify&lt;/a&gt;&lt;/strong&gt; since Java 6&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="Notify"
 src="https://jeanchristophegay.com/images/notifier.notify.png"
 width="250"
 height="72"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="https://github.com/Windos/BurntToast" target="_blank" rel="noreferrer"&gt;BurntToast&lt;/a&gt;&lt;/strong&gt; for Windows 10&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="BurntToast"
 src="https://jeanchristophegay.com/images/notifier.burnttoast.png"
 width="361"
 height="81"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
			&lt;tr&gt;
					&lt;td style="text-align: center"&gt;&lt;strong&gt;&lt;a href="https://slack.com" target="_blank" rel="noreferrer"&gt;Slack&lt;/a&gt;&lt;/strong&gt;&lt;/td&gt;
					&lt;td&gt;&lt;figure&gt;&lt;img
 class="my-0 rounded-md"
 loading="lazy"
 decoding="async"
 fetchpriority="low"
 alt="Slack"
 src="https://jeanchristophegay.com/images/slack-success.png"
 width="424"
 height="187"&gt;&lt;/figure&gt;
&lt;/td&gt;
			&lt;/tr&gt;
	&lt;/tbody&gt;
&lt;/table&gt;

&lt;h2 class="relative group"&gt;Installation
 &lt;div id="installation" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#installation" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h2&gt;
&lt;p&gt;Plugin can be configured in an &lt;a href="http://gradle.org/docs/current/userguide/init_scripts.html" target="_blank" rel="noreferrer"&gt;initialization script&lt;/a&gt; or directly in a &lt;a href="https://gradle.org/docs/current/userguide/plugins.html" target="_blank" rel="noreferrer"&gt;build script&lt;/a&gt;.&lt;/p&gt;

&lt;h3 class="relative group"&gt;Initialization script
 &lt;div id="initialization-script" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#initialization-script" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;Create (or edit) file &lt;code&gt;$HOME/.gradle/init.gradle&lt;/code&gt;:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;initscript {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; repositories {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mavenCentral()
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; dependencies {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; classpath group: &amp;#39;fr.jcgay&amp;#39;, name: &amp;#39;gradle-notifier&amp;#39;, version: &amp;#39;1.1.0&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;rootProject {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; apply plugin: fr.jcgay.gradle.notifier.GradleNotifierPlugin
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;

&lt;h3 class="relative group"&gt;Build script
 &lt;div id="build-script" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#build-script" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;In your &lt;code&gt;build.gradle&lt;/code&gt;, add:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;buildscript {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; repositories {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; mavenCentral()
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; dependencies {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; classpath group: &amp;#39;fr.jcgay&amp;#39;, name: &amp;#39;gradle-notifier&amp;#39;, version: &amp;#39;1.1.0&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;}
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;apply plugin: &amp;#39;fr.jcgay.gradle-notifier&amp;#39;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;or by using the plugin mechanism introduced in Gradle 2.1:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;plugins {
 id &amp;quot;fr.jcgay.gradle-notifier&amp;quot; version &amp;quot;1.1.0&amp;quot;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;h3 class="relative group"&gt;Configuration
 &lt;div id="configuration" class="anchor"&gt;&lt;/div&gt;
 
 &lt;span
 class="absolute top-0 w-6 transition-opacity opacity-0 -start-6 not-prose group-hover:opacity-100 select-none"&gt;
 &lt;a class="text-primary-300 dark:text-neutral-700 !no-underline" href="#configuration" aria-label="Anchor"&gt;#&lt;/a&gt;
 &lt;/span&gt;
 
&lt;/h3&gt;
&lt;p&gt;It relies on &lt;a href="https://github.com/jcgay/send-notification" target="_blank" rel="noreferrer"&gt;send-notification&lt;/a&gt;, notifiers configuration and which notifier to use can be set in &lt;code&gt;$HOME/.send-notification&lt;/code&gt; (See available parameters in current &lt;a href="https://github.com/jcgay/send-notification/wiki" target="_blank" rel="noreferrer"&gt;documentation&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;Or the plugin can be configured using Gradle extension in targeted script:&lt;/p&gt;
&lt;div class="highlight-wrapper"&gt;&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-text" data-lang="text"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;notifier {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; implementation = &amp;#39;notificationcenter&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; threshold {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; time = 10
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; unit = java.util.concurrent.TimeUnit.SECONDS
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; growl {
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; port = 23053
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; host = &amp;#39;localhost&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; password = &amp;#39;azerty123&amp;#39;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;Here it is! No more excuses to forgot your ran a build somewhere!&lt;/p&gt;</description></item></channel></rss>