Skip to content

Generate Java classes for thrift #46

Closed
alokrep opened this Issue Mar 12, 2013 · 4 comments

4 participants

@alokrep
alokrep commented Mar 12, 2013

I cannot find a way to tell the scrooge-maven-plugin how to use the --language java.
Here is my pom.xml


com.twitter
scrooge-maven-plugin
3.0.8-SNAPSHOT

java

<!-- add other Scrooge command line options using thriftOpts -->
--finagle

-v

            </configuration>
            <executions>
                <execution>
                    <id>thrift-sources</id>
                    <phase>generate-sources</phase>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
                <execution>
                    <id>thrift-test-sources</id>
                    <phase>generate-test-sources</phase>
                    <goals>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
@tblair-df

I'm having the same issue.

From what I can tell, adding:

<thriftOpt>--language java</thriftOpt>

will pass the equivalent of --language\ java and adding:

<thriftOpt>--language</thriftOpt>
<thriftOpt>java</thriftOpt>

doesn't work because the options are converted to a set and the ordering is not maintained. The error message tells me: language option /path/to/my.thrift not supported, so it appears to be adding the --language option last.

@alokrep
alokrep commented Mar 26, 2013

Yes the latter solution worked for me too. So spilting into two lines and keeping at as the last options generates Java.

@eirslett
eirslett commented Apr 7, 2013

I had the same problem. This fixed it for me:

<configuration>
  <thriftOpts>
    <thriftOpt>-l</thriftOpt>
    <thriftOpt>java</thriftOpt>
  </thriftOpts>
</configuration>

(Using -l instead of --language)

But it would be nice to be able to have a language tag, like this:

<configuration>
  <language>java</language>
</configuration>

@chunyan Any chance you would accept a pull request adding a tag?

@chunyan
chunyan commented Apr 7, 2013

sounds great! Please go ahead.

@chunyan chunyan closed this in 76c252a Apr 15, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.