Generate Java classes for thrift #46

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

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 --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

This comment has been minimized.

Show comment
Hide comment
@tblair-df

tblair-df Mar 26, 2013

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.

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

This comment has been minimized.

Show comment
Hide comment
@alokrep

alokrep 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.

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

This comment has been minimized.

Show comment
Hide comment
@eirslett

eirslett Apr 7, 2013

Contributor

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?

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@chunyan

chunyan Apr 7, 2013

Contributor

sounds great! Please go ahead.

Contributor

chunyan commented Apr 7, 2013

sounds great! Please go ahead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment