Repository: incubator-sentry Updated Branches: refs/heads/master 2e509e4bc -> a79e39a53
SENTRY-523: Add maven-thrift-plugin back into provider-db pom.xml (Dapeng Sun via Arun Suresh) Project: http://git-wip-us.apache.org/repos/asf/incubator-sentry/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-sentry/commit/a79e39a5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-sentry/tree/a79e39a5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-sentry/diff/a79e39a5 Branch: refs/heads/master Commit: a79e39a53e0311f98f5a5d08fe156beda8b669d4 Parents: 2e509e4 Author: Arun Suresh <[email protected]> Authored: Thu Nov 13 09:12:53 2014 -0800 Committer: Arun Suresh <[email protected]> Committed: Thu Nov 13 09:12:53 2014 -0800 ---------------------------------------------------------------------- sentry-provider/sentry-provider-db/pom.xml | 64 ++++++++++++++++++++++++- 1 file changed, 63 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-sentry/blob/a79e39a5/sentry-provider/sentry-provider-db/pom.xml ---------------------------------------------------------------------- diff --git a/sentry-provider/sentry-provider-db/pom.xml b/sentry-provider/sentry-provider-db/pom.xml index e2f035f..3c9d318 100644 --- a/sentry-provider/sentry-provider-db/pom.xml +++ b/sentry-provider/sentry-provider-db/pom.xml @@ -229,5 +229,67 @@ limitations under the License. </plugin> </plugins> </build> - + <profiles> + <profile> + <id>thriftif</id> + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <executions> + <execution> + <id>generate-thrift-sources</id> + <phase>generate-sources</phase> + <configuration> + <target> + <taskdef name="for" classname="net.sf.antcontrib.logic.ForTask" + classpathref="maven.plugin.classpath" /> + <property name="thrift.args" value="-I ${thrift.home} --gen java:beans,hashcode"/> + <property name="thrift.gen.dir" value="${basedir}/src/gen/thrift"/> + <delete dir="${thrift.gen.dir}"/> + <mkdir dir="${thrift.gen.dir}"/> + <for param="thrift.file"> + <path> + <fileset dir="${basedir}/src/main/resources/" includes="**/*.thrift" /> + </path> + <sequential> + <echo message="Generating Thrift code for @{thrift.file}"/> + <exec executable="${thrift.home}/bin/thrift" failonerror="true" dir="."> + <arg line="${thrift.args} -I ${basedir}/src/main/resources/ -o ${thrift.gen.dir} @{thrift.file} " /> + </exec> + </sequential> + </for> + </target> + </configuration> + <goals> + <goal>run</goal> + </goals> + </execution> + </executions> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-enforcer-plugin</artifactId> + <executions> + <execution> + <id>enforce-property</id> + <goals> + <goal>enforce</goal> + </goals> + <configuration> + <rules> + <requireProperty> + <property>thrift.home</property> + </requireProperty> + </rules> + <fail>true</fail> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + </profile> + </profiles> </project>
