[ http://jira.codehaus.org/browse/MJAVACC-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_121066 ]
Benjamin Bentmann commented on MJAVACC-53: ------------------------------------------ bq. one idea would be to not include the jjtree source directory in the compile path. I think this is actually a requirement when using JJTree and JavaCC for the following reasons. The {{javacc}} mojo must copy Java sources to the output directory (MJAVACC-20). This copying creates duplicate source files in different root directories. Hence, these root directories must not be both registered as compile source roots or javac will fail. Naturally, the source directory for the {{javacc}} must be excluded here. When using the {{jjtree}} mojo, its output directory is used as the source directory for the {{javacc}} mojo. So, if {{javacc}}'s source directory has to be excluded from the compile source roots, so must the output directory of the {{jjtree}} mojo because they are the same directories in the intended pipeline of JJTree and JavaCC execution. Are there any use-cases where one would want to execute only JJTree and not JavaCC afterwards? For me it seems this would not make much sense but I am not used to JJTree. > Cannot get javacc plugin to work on windows > ------------------------------------------- > > Key: MJAVACC-53 > URL: http://jira.codehaus.org/browse/MJAVACC-53 > Project: Maven 2.x JavaCC Plugin > Issue Type: Bug > Components: javacc, jjtree > Affects Versions: 2.2 > Reporter: Andrea Aime > Fix For: 2.3 > > Attachments: jjtreebug.zip > > > I'm trying to use the javacc plugin without much success. > If I configure it this way: > {code:xml} > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>javacc-maven-plugin</artifactId> > <version>2.2</version> > <executions> > <execution> > <goals> > <goal>jjtree</goal> > </goals> > </execution> > </executions> > <configuration> > > <sourceDirectory>src/main/java/org/geoserver/wcs/kvp/rangesubset</sourceDirectory> > <outputDirectory>target/generated-sources/jjtree</outputDirectory> > </configuration> > </plugin> > {code} > the build fails reporting that: > {code} > ... > File > "target\generated-sources\jjtree\org\geoserver\wcs\kvp\rangesubset\ASTKey.java" > does not exist. Will create one. > Annotated grammar generated successfully in > target\generated-sources\jjtree\org\geoserver\wcs\kvp\rangesubset\rangeset.jj > [INFO] > ------------------------------------------------------------------------ > [ERROR] BUILD ERROR > [INFO] > ------------------------------------------------------------------------ > [INFO] JJTree execution failed > Embedded error: > C:\progetti\geoserver\src\trunkClean\geoserver\wcs1_1\target\generated-sources\jjtree-timestamp\C:\progetti\geoserver\src\trunkClean\geoserver\wcs1_1\src\main\java\org\geoserver\wcs\kvp\rangesubset\rangeset.jjt > (La sintassi > del nome del file, della directory o del volume Þ incorretta) > {code} > If I configure it so that timestamp directory is more explicit, say > {{<timestampDirectory>target/generated-sources/jjtree-timestamp</timestampDirectory>}} > then the jjtree phase works but the parser is not generated. So I guess I'm > missing the javacc part (no documentation on how to use both javacc and > jjtree btw), I've tried with this: > {code} > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>javacc-maven-plugin</artifactId> > <version>2.2</version> > <executions> > <execution> > <goals> > <goal>jjtree</goal> > </goals> > </execution> > </executions> > <configuration> > > <sourceDirectory>src/main/java/org/geoserver/wcs/kvp/rangesubset</sourceDirectory> > <outputDirectory>target/generated-sources/jjtree</outputDirectory> > > <timestampDirectory>target/generated-sources/jjtree-timestamp</timestampDirectory> > </configuration> > </plugin> > <plugin> > <groupId>org.codehaus.mojo</groupId> > <artifactId>javacc-maven-plugin</artifactId> > <version>2.2</version> > <executions> > <execution> > <goals> > <goal>javacc</goal> > </goals> > </execution> > </executions> > <configuration> > > <sourceDirectory>target/generated-sources/jjtree/org/geoserver/wcs/kvp/rangesubset</sourceDirectory> > <outputDirectory>target/generated-sources/javacc</outputDirectory> > > <timestampDirectory>target/generated-sources/javacc-timestamp</timestampDirectory> > </configuration> > </plugin> > {code} > but the same error as the first run occurrs... > It seems to me there is some problems in the code about how to decide wheter > a path is absolute or not. If that is the problem, File.isAbsolute provides a > platform independent check for it. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: http://jira.codehaus.org/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira --------------------------------------------------------------------- To unsubscribe from this list please visit: http://xircles.codehaus.org/manage_email