I'm running antlr with maven. Antlr generates .java file from .g file and I need to post process generated java file (do some changes in it). How can I do it?
<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr3-maven-plugin</artifactId>
<version>3.5.2</version>
<configuration>
<outputDirectory>src/main/java</outputDirectory>
</configuration>
<executions>
<execution>
<goals>
<goal>antlr</goal>
</goals>
</execution>
</executions>
</plugin>
Finally I've found a solution. You have to use maven-antrun-plugin, it can execute java code. Another problem was that there were no compiled classes yet in the process-sources phase (you need to run it before compile). So before executing the java class, you need to compile it or do as I did - store the already compiled class and copy it to target classes.