Annotation processing with kotlin-maven-plugin
<p>So i have maven project with 2 modules.</p>

<p>Root pom.xml looks like this:</p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

&lt;groupId&gt;kashier&lt;/groupId&gt;
&lt;artifactId&gt;Kashier&lt;/artifactId&gt;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;pom&lt;/packaging&gt;

&lt;modules&gt;
    &lt;module&gt;AnnotationProcessing&lt;/module&gt;
    &lt;module&gt;TestProject&lt;/module&gt;
&lt;/modules&gt;
</code></pre>

<p></p>

<p>And the pom.xml for AnnotationProcessing module :</p>

<pre><code>&lt;project xmlns="http://maven.apache.org/POM/4.0.0"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"&gt;
&lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;


&lt;parent&gt;
    &lt;groupId&gt;kashier&lt;/groupId&gt;
    &lt;artifactId&gt;Kashier&lt;/artifactId&gt;
    &lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;/parent&gt;

&lt;artifactId&gt;AnnotationProcessing&lt;/artifactId&gt;
&lt;version&gt;1.0-SNAPSHOT&lt;/version&gt;
&lt;packaging&gt;jar&lt;/packaging&gt;

&lt;properties&gt;
    &lt;kotlin.version&gt;1.0.3&lt;/kotlin.version&gt;
&lt;/properties&gt;

&lt;dependencies&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
        &lt;artifactId&gt;kotlin-stdlib&lt;/artifactId&gt;
        &lt;version&gt;${kotlin.version}&lt;/version&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;org.jetbrains.kotlin&lt;/groupId&gt;
        &lt;artifactId&gt;kotlin-test&lt;/artifactId&gt;
        &lt;version&gt;${kotlin.version}&lt;/version&gt;
        &lt;scope&gt;test&lt;/scope&gt;
    &lt;/dependency&gt;
    &lt;dependency&gt;
        &lt;groupId&gt;com.google.auto.service&lt;/groupId&gt;
        &lt;artifactId&gt;auto-service&lt;/artifactId&gt;
        &lt;version&gt;1.0-rc2&lt;/version&gt;
        &lt;optional&gt;true&lt;/optional&gt;
    &lt;/dependency&gt;
&lt;/dependencies&gt;

&lt;build&gt;
    &lt;plugins&gt;
        &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;compile&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;test-compile&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;
    &lt;/plugins&gt;
&lt;/build&gt;
</code></pre>

<p></p>

<p>Now everything works fine only if i manually create javax.annotation.processing.Processor file in resources directory.
That means that auto-service is not working and the question is: how do i make it work?</p>

<p>Also i tried to make the same project with java and it works. So i think that the problem is in kotlin-maven-plugin.</p>

<p>Source code of the project can be found <a href="https://github.com/mitya1337/Kashier" rel="nofollow">here</a></p>