[ 
http://jira.codehaus.org/browse/MJAVACC-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_121041
 ] 

Paul Gier commented on MJAVACC-53:
----------------------------------

There is some code in the javacc mojo that copies all the .java files from the 
source directory to the output directory.
Removing this code fixes this issue, but I'm not sure if it would break 
anything else.  I'll try to figure out why this code is there so I can make a 
decent fix to the issue.

The fix doesn't break any existing tests, but our tests are not comprehensive, 
so there could be an edge case I'm missing.

The offending code:

{code:java}
            // Copy all .java file from sourceDirectory to outputDirectory, in
            // order to override Token.java
            try
            {
                FileUtils.copyDirectory( sourceDirectory, outputDirPackages, 
"*.java", "*.jj,*.JJ" );
            }
            catch ( IOException e )
            {
                throw new MojoExecutionException( "Unable to copy overriden 
java files.", e );
            }
{code}

> 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

Reply via email to