I use thrift and generates some java source files (interfaces) in the build directory (build/generated-sources/thrift/<package name>/<class>) , but under my src/main/java I have my classes that have the package definition is the same as in the generated java files, and my classes also implement the interfaces generated by the transaction, since I can configure this in my build.gradle , so it works with I ntelliJ , as well as with the construction
plugins { id "org.jruyi.thrift" version "0.3.1" } apply plugin: 'idea' apply plugin: 'java' apply plugin: 'maven' apply plugin: "org.jruyi.thrift" group 'com.hello' version '1.0-SNAPSHOT' sourceCompatibility = 1.5 repositories { mavenCentral() } dependencies { compile group: 'org.apache.thrift', name: 'libthrift', version:'0.9.3' compile 'com.datastax.cassandra:cassandra-driver-core:3.0.0' compile 'com.datastax.cassandra:cassandra-driver-mapping:3.0.0' testCompile group: 'junit', name: 'junit', version: '4.11' } compileThrift { thriftExecutable "/usr/local/hello/bin/thrift" sourceDir "src/main/thrift" createGenFolder false } task thrift(type: Exec) { commandLine '/usr/local/hello/bin/thrift' } compileJava { dependsOn 'compileThrift'
source share