[ 
https://issues.apache.org/jira/browse/THRIFT-1069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12997596#comment-12997596
 ] 

Jake Farrell commented on THRIFT-1069:
--------------------------------------

Nice plugin. The maven build helper and the eclipse plugins will take care of 
what you are looking for. I've been using an ant task to accomplish what your 
plugin does. Here is a the section from the pom which should help you not have 
to copy files around and provides eclipse integration  


        <!-- Run an ant task to generate the thrift source -->
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.6</version>
                <executions>
                        <execution>
                                <id>thrift-gen</id>
                                <phase>generate-sources</phase>
                                <goals>
                                        <goal>run</goal>
                                </goals>
                                <configuration>
                                        <tasks>
                                                <property name="target.dir" 
value="${project.build.directory}/generated-sources"/>
                                                <mkdir dir="${target.dir}"/>
                                                <exec 
executable="/usr/bin/thrift">
                                                        <arg line="-o 
${target.dir} --gen java interface/${project.artifactId}.thrift"/>
                                                </exec>
                                        </tasks>
                                </configuration>
                        </execution>
                </executions>
        </plugin>
        <!-- Include the thrift generated sources in the build -->
        <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>1.5</version>
                <executions>
                        <execution>
                                <id>add-source</id>
                                <phase>generate-sources</phase>
                                <goals>
                                        <goal>add-source</goal>
                                </goals>
                                <configuration>
                                        <sources>
                                                
<source>${project.build.directory}/generated-sources/gen-java</source>
                                        </sources>
                                </configuration>
                        </execution>
                </executions>
        </plugin>
        <!-- Add generated sources to eclipse build sources list -->
        <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-eclipse-plugin</artifactId>
                <version>2.8</version>
                <configuration>
                        <sourceIncludes>
                                
<sourceInclude>${project.build.directory}/generated-sources/gen-java/**/*.java</sourceInclude>
                        </sourceIncludes>
                </configuration>
        </plugin>

> Add command line option to prevent thrift from inserting gen-* directories
> --------------------------------------------------------------------------
>
>                 Key: THRIFT-1069
>                 URL: https://issues.apache.org/jira/browse/THRIFT-1069
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Compiler
>    Affects Versions: 0.5
>         Environment: OSX
>            Reporter: David Trott
>
> I maintain a plug-in to execute thrift under maven:
> https://github.com/dtrott/maven-thrift-plugin
> The gen-* directories do not add any value for me (I have to add additional 
> code to move the files back up one level after generation - for IDE 
> integration).
> Would it be possible to add an additional command line option to either:
> * Suppress the insertion of the gen- directory
> * or, Allow me to specify the full path to the output directory (without the 
> gen- postfix)

-- 
This message is automatically generated by JIRA.
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to