facedb-client
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>com.gitee.l0km</groupId>
<artifactId>facedb-client</artifactId>
<version>3.3.0</version>
</dependency><?xml version="1.0"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.gitee.l0km</groupId>
<artifactId>facedb</artifactId>
<version>3.3.0</version>
<relativePath>..</relativePath>
</parent>
<artifactId>facedb-client</artifactId>
<name>facedb thrift client</name>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<codegen.dir>${project.basedir}/src/client/java</codegen.dir>
<stub.dir>${project.basedir}/src/thrift/java</stub.dir>
<automatic.module.name>facedb.client</automatic.module.name>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.gitee.l0km</groupId>
<artifactId>xthrift-thrift</artifactId>
<version>${xthrift.version}</version>
<exclusions>
<exclusion>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
</exclusion>
</exclusions>
</dependency>
<!--
common-thrift中为了解决 org.apache.thrift.protocol.TJSONProtocol.readJSONBase64()方法解码出错问题,
将依赖的libthrift的版本从0.9.1升级为0.12.0
但0.9.1版本中的org.apache.thrift.TApplicationException.read(Protocol)方法在在0.12.0版本改名为readFrom,不兼容
所以 client 端不能用0.12.0版本,还得换回0.9.1
-->
<dependency>
<groupId>org.apache.thrift</groupId>
<artifactId>libthrift</artifactId>
<version>0.9.1</version>
</dependency>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>facedb-base</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>com.gitee.l0km</groupId>
<artifactId>mtfsdk-base</artifactId>
<version>2.0.0</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<!-- 配置client,thrift文件夹,用于保存codegen和swift-generator生成的代码 -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>add-source</id>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>${codegen.dir}</source>
<source>${stub.dir}</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>
<!-- 生成FaceDb接口的基于facebook/swift的client实现代码 -->
<plugin>
<groupId>com.gitee.l0km</groupId>
<artifactId>codegen-thrift-maven-plugin</artifactId>
<version>${codegen.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<interfaceClass>net.gdface.facedb.FaceDb</interfaceClass>
<refClass>net.gdface.facedb.FacedbDefaultImpl</refClass>
<package>net.gdface.facedb.thrift</package>
<outputDir>${codegen.dir}</outputDir>
<thriftPackage>net.gdface.facedb.thrift.client</thriftPackage>
<taskType>CLIENT</taskType>
</configuration>
</plugin>
<!-- 根据IDL文件生成基于facebook/wwift的client实现代码 -->
<plugin>
<groupId>com.facebook.mojo</groupId>
<artifactId>swift-maven-plugin</artifactId>
<version>${swift.version}</version>
<executions>
<execution>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- 指定IDL文件 -->
<idlFiles>
<directory>${project.basedir}/../facedb-service</directory>
<include>FaceDb.thrift</include>
</idlFiles>
<!-- 指定生成标准java bean -->
<codeFlavor>java-regular</codeFlavor>
<!-- 指定代码生成位置 -->
<outputFolder>${stub.dir}</outputFolder>
<!-- 指定生成代码的package -->
<overridePackage>net.gdface.facedb.thrift.client</overridePackage>
<!-- 指定生成的client 代码是否抛出 TException 异常 -->
<addThriftExceptions>false</addThriftExceptions>
<!-- 指定生成的服务端异常是否为继承自RuntimeException -->
<extendRuntimeException>false</extendRuntimeException>
</configuration>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<!--This plugin's configuration is used to store Eclipse m2e settings only. It has no influence on the Maven build itself.-->
<plugin>
<groupId>org.eclipse.m2e</groupId>
<artifactId>lifecycle-mapping</artifactId>
<version>1.0.0</version>
<configuration>
<lifecycleMappingMetadata>
<pluginExecutions>
<pluginExecution>
<pluginExecutionFilter>
<groupId>
com.facebook.mojo
</groupId>
<artifactId>
swift-maven-plugin
</artifactId>
<versionRange>
[0.14.2,)
</versionRange>
<goals>
<goal>generate</goal>
</goals>
</pluginExecutionFilter>
<action>
<ignore />
</action>
</pluginExecution>
</pluginExecutions>
</lifecycleMappingMetadata>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>