dtrott / maven-thrift-plugin

Maven Thrift Plugin that executes the thrift code generator (base on protocol buffers plugin)
120 stars 68 forks source link

Generate hashCode() method using org.apache.commons.lang3.builder.HashCodeBuilder #31

Closed zoyanhui closed 8 years ago

zoyanhui commented 8 years ago

Build maven project via maven-thrift-plugin, the pom as below. The java class generated by thrift has hashcode method, which is using org.apache.commons.lang3.builder.HashCodeBuilder. But when I generate java code by thrift command in terminal, the hashcode method will not be using HashCodeBuilder.

Using HashCodeBuilder need to add a common-lang3 dependency, and the package jar will be different with the others.

What can I do to avoid HashCodeBuilder?

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.apache.thrift.tools</groupId>
                <artifactId>maven-thrift-plugin</artifactId>
                <version>0.1.11</version>
                <configuration>
                    <thriftExecutable>thrift</thriftExecutable>
                </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>
        </plugins>
    </build>