Skip if empty in Kotlin Maven plug-in
<p>We have enabled the Kotlin Maven plug-in in our top-most project POM, like this:</p>

<pre><code>&lt;plugin&gt;
    &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
    &lt;artifactId&gt;kotlin-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;${kotlin.version}&lt;/version&gt;

    &lt;executions&gt;
        &lt;execution&gt;
            &lt;id&gt;compile&lt;/id&gt;
            &lt;phase&gt;process-sources&lt;/phase&gt;
            &lt;goals&gt;
                &lt;goal&gt;compile&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;

        &lt;execution&gt;
            &lt;id&gt;test-compile&lt;/id&gt;
            &lt;phase&gt;process-test-sources&lt;/phase&gt;
            &lt;goals&gt;
                &lt;goal&gt;test-compile&lt;/goal&gt;
            &lt;/goals&gt;
        &lt;/execution&gt;
    &lt;/executions&gt;
&lt;/plugin&gt;
</code></pre>

<p>ATM, only a handful of the modules in this project have Kotlin source code. (The project is around 50 modules.) The idea is that most will eventually have Kotlin code, and we don't want to have to wire things up on a per project basis. We want to configure it once, and forget about it.</p>

<p>This works except that we get this warning in the build for most modules:</p>

<pre><code>[INFO] Kotlin Compiler version 1.0.2
[WARNING] No sources found skipping Kotlin compile
</code></pre>

<p>We had this problem with the JAR plug-in as well. That plug-in has a configuration option that allows us to do like this:</p>

<pre><code>&lt;configuration&gt;
    &lt;skipIfEmpty&gt;true&lt;/skipIfEmpty&gt;
&lt;/configuration&gt;
</code></pre>

<p>This shutup that plug-in's similar warnings. The Kotlin compiler plug-in doesn't seem to have any such config option though.</p>

<p>So, my questions are:</p>

<ol>
<li>Is there such a configuration option that we're overlooking?</li>
<li>Should we configure the Kotlin compiler plug-in differently to avoid this warning?</li>
</ol>

<p>TIA!</p>