I had been using javacc-maven-plugin 2.2-SNAPSHOT for a while now,
though its been months since I tried rebuilding my project which was
using it.
I'm using javacc:jjtree and then javacc:javacc, which used to work like:
----8<----
<execution>
<id>jjtree</id>
<phase>generate-sources</phase>
<goals>
<goal>jjtree</goal>
</goals>
<configuration>
<sourceDirectory>${pom.basedir}/src/main/grammar</
sourceDirectory>
<outputDirectory>${project.build.directory}/generated-
sources/jjtree</outputDirectory>
</configuration>
</execution>
<execution>
<id>jjtree-javacc</id>
<phase>generate-sources</phase>
<goals>
<goal>javacc</goal>
</goals>
<configuration>
<sourceDirectory>${project.build.directory}/generated-
sources/jjtree</sourceDirectory>
<outputDirectory>${project.build.directory}/generated-
sources/javacc</outputDirectory>
</configuration>
</execution>
---->8----
But now with the latest changes this isn't working at all. Looks
like the code added to copy all *.java sources from javacc's
sourceDirectory to its outputDirectory (MJAVACC-20) is causing
problems when using jjtree as both invoke project.addCompileSourceRoot
(), causing compilation failures due to duplicate class definitions.
Consequently with the latest 2.2-SNAPSHOT I'm not sure how its
possible ti use jjtree unless an antrun is invoked between jjtree and
javacc to clean up.
Personally I think that the changes made in MJAVACC-20 are invalid
and should either be rolled back or made to be optional, so I can at
least disable this behavior.
There is a general problem with how to deal with overriding sources
generated by javacc or jjtree... I had chosen to use antrun to remove
the generated classes which were overridden, though its a pain, it
does work. I'm not really sure that the best answer is, though I'm,
guessing that it requires a deeper integration with JavaCC, either
that or a whole lot more intellegence in the plugin to copy sources
around (which is a huge mess IMO).
Anyways, I think that the current plugin is broken for JJTree usage.
--jason
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email