I am using Maven to build my GWT project. I am using Gin to generate some boilerplate code:
package com.lokur.motd.client.events;
import com.gwtplatform.dispatch.annotation.GenEvent;
@GenEvent
public class EditorChange {
}
But, when I run "mvn clean install" command, Maven is generating Gin related Java source in the target/classes/com/lokur/motd/client/events
directory. Why are there .java
files going into the classes
directory?
I'm using the Maven plug-ins below to generate Java source in the target/generated-sources
folder:
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
<version>2.0.5</version>
<executions>
<execution>
<id>process</id>
<goals>
<goal>process</goal>
</goals>
<phase>generate-sources</phase>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<phase>generate-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>target/generated-sources/apt</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
In this case, two EditorChangeEvent.java
files are getting generated: one in generated-sources
folder; another in target/classes/<..package..>
folder.
Thus, causing below compilation failure:
duplicate class:
com.lokur.motd.client.events.EditorChangeEvent