I have a plugin which generates lots of java files (i.e FileA.java, FileB.java) under target
folder. I'm using "exec-maven-plugin" to execute my plugin as follows
<build>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<id>generate-event-beans</id>
<phase>generate-sources</phase>
<goals>
<goal>java</goal>
</goals>
<configuration>
<mainClass>com.my.project.generate.GenerateJavaFiles</mainClass>
<classpathScope>compile</classpathScope>
<arguments>
<argument>${basedir}/src/main/resources</argument>
<argument>${project.build.directory}/generated-sources/generated</argument>
</arguments>
</configuration>
</execution>
</executions>
</plugin>
I want to compile these java files created under ${project.build.directory}/generated-sources/generated
without adding them to source and package them in jar