META-INF.maven.io.daos.daos-java.pom.xml Maven / Gradle / Ivy
<?xml version="1.0" encoding="UTF-8"?> <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>io.daos</groupId> <artifactId>daos-java-root</artifactId> <version>1.2.1</version> </parent> <groupId>io.daos</groupId> <artifactId>daos-java</artifactId> <packaging>jar</packaging> <properties> <native.build.path>${project.basedir}/build</native.build.path> <daos.install.path>${project.basedir}/install</daos.install.path> <compile.proto>false</compile.proto> </properties> <dependencies> <dependency> <groupId>org.slf4j</groupId> <artifactId>slf4j-api</artifactId> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-slf4j-impl</artifactId> </dependency> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-core</artifactId> </dependency> <dependency> <groupId>commons-lang</groupId> <artifactId>commons-lang</artifactId> </dependency> <dependency> <groupId>com.google.protobuf</groupId> <artifactId>protobuf-java</artifactId> <version>3.11.4</version> </dependency> <dependency> <groupId>io.netty</groupId> <artifactId>netty-buffer</artifactId> <version>4.1.59.Final</version> </dependency> <dependency> <groupId>com.google.code.findbugs</groupId> <artifactId>jsr305</artifactId> </dependency> <dependency> <groupId>org.mockito</groupId> <artifactId>mockito-core</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-module-junit4</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mockito2</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <scope>test</scope> </dependency> </dependencies> <build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <compilerArgs> <arg>-h</arg> <arg>${project.basedir}/src/main/native/include</arg> </compilerArgs> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <executions> <execution> <goals> <goal>test-jar</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.8</version> <executions> <execution> <id>compile-proto</id> <phase>generate-sources</phase> <configuration> <target name="compile-proto" if="${compile.proto}"> <mkdir dir="${native.build.path}"/> <exec dir="${native.build.path}" failonerror="true" executable="protoc"> <arg value="-I=${project.basedir}/src/main/resources/"/> <arg value="--c_out=."/> <arg value="--java_out=."/> <arg value="DunsAttribute.proto"/> <arg value="DaosObjectAttribute.proto"/> </exec> <copy todir="${project.basedir}/src/main/java/io"> <fileset dir="${native.build.path}/io"/> </copy> <copy file="${native.build.path}/DunsAttribute.pb-c.h" todir="${project.basedir}/src/main/native/include"/> <copy file="${native.build.path}/DunsAttribute.pb-c.c" todir="${project.basedir}/src/main/native"/> <copy file="${native.build.path}/DaosObjectAttribute.pb-c.h" todir="${project.basedir}/src/main/native/include"/> <copy file="${native.build.path}/DaosObjectAttribute.pb-c.c" todir="${project.basedir}/src/main/native"/> </target> </configuration> <goals> <goal>run</goal> </goals> </execution> <execution> <id>build-so</id> <phase>compile</phase> <configuration> <tasks> <mkdir dir="${native.build.path}"/> <exec executable="sh" outputproperty="java-home" failonerror="true"> <arg value="./find_java_home.sh"/> </exec> <echo message="Java home is ${java-home}" /> <exec executable="bash" outputproperty="sl-prefix" failonerror="true"> <arg value="./find_build_paths.sh"/> <arg value="${daos.install.path}"/> <arg value="SL_PREFIX"/> </exec> <echo message="SL_PREFIX is ${sl-prefix}" /> <exec executable="bash" outputproperty="sl-protobufc-prefix" failonerror="true"> <arg value="./find_build_paths.sh"/> <arg value="${daos.install.path}"/> <arg value="SL_PROTOBUFC_PREFIX"/> </exec> <echo message="SL_PROTOBUFC_PREFIX is ${sl-protobufc-prefix}" /> <delete file="${project.basedir}/src/main/native/include/io_daos_dfs_DaosFsClient_DaosFsClientBuilder.h"/> <delete file="${project.basedir}/src/main/native/include/io_daos_DaosClient_DaosClientBuilder.h"/> <delete file="${project.basedir}/src/main/native/include/io_daos_obj_DaosObjClient_DaosObjClientBuilder.h"/> <exec dir="${native.build.path}" failonerror="true" executable="gcc"> <arg value="-v"/> <arg value="-I/usr/local/"/> <arg value="-I${java-home}/include/"/> <arg value="-I${java-home}/include/linux/"/> <arg value="-I${sl-prefix}/include/"/> <arg value="-I${project.basedir}/src/main/native/include/"/> <arg value="${project.basedir}/src/main/native/daos_jni_common.c"/> <arg value="-o${native.build.path}/daos_jni_common.o"/> <arg value="-c"/> <arg value="-fPIC"/> <arg value="--std=gnu99"/> </exec> <exec dir="${native.build.path}" failonerror="true" executable="gcc"> <arg value="-v"/> <arg value="-I/usr/local/"/> <arg value="-I${java-home}/include/"/> <arg value="-I${java-home}/include/linux/"/> <arg value="-I${sl-prefix}/include/"/> <arg value="-I${project.basedir}/src/main/native/include/"/> <arg value="${project.basedir}/src/main/native/io_daos_DaosClient.c"/> <arg value="-o${native.build.path}/io_daos_DaosClient.o"/> <arg value="-c"/> <arg value="-fPIC"/> <arg value="--std=gnu99"/> </exec> <exec dir="${native.build.path}" failonerror="true" executable="gcc"> <arg value="-v"/> <arg value="-I/usr/local/"/> <arg value="-I${java-home}/include/"/> <arg value="-I${java-home}/include/linux/"/> <arg value="-I${sl-prefix}/include/"/> <arg value="-I${sl-protobufc-prefix}/include/"/> <arg value="-I${project.basedir}/src/main/native/include/"/> <arg value="${project.basedir}/src/main/native/io_daos_obj_DaosObjClient.c"/> <arg value="-o${native.build.path}/io_daos_obj_DaosObjClient.o"/> <arg value="-c"/> <arg value="-fPIC"/> <arg value="--std=gnu99"/> </exec> <exec dir="${native.build.path}" failonerror="true" executable="gcc"> <arg value="-v"/> <arg value="-I/usr/local/"/> <arg value="-I${java-home}/include/"/> <arg value="-I${java-home}/include/linux/"/> <arg value="-I${sl-prefix}/include/"/> <arg value="-I${sl-protobufc-prefix}/include/"/> <arg value="-I${project.basedir}/src/main/native/include/"/> <arg value="${project.basedir}/src/main/native/io_daos_dfs_DaosFsClient.c"/> <arg value="-o${native.build.path}/io_daos_dfs_DaosFsClient.o"/> <arg value="-c"/> <arg value="-fPIC"/> <arg value="--std=gnu99"/> </exec> <exec dir="${native.build.path}" failonerror="true" executable="gcc"> <arg value="-v"/> <arg value="-I/usr/local/"/> <arg value="-I${java-home}/include/"/> <arg value="-I${java-home}/include/linux/"/> <arg value="-I${sl-prefix}/include/"/> <arg value="-I${sl-protobufc-prefix}/include/"/> <arg value="-I${project.basedir}/src/main/native/include/"/> <arg value="${project.basedir}/src/main/native/DunsAttribute.pb-c.c"/> <arg value="-o${native.build.path}/DunsAttribute.pb-c.o"/> <arg value="-c"/> <arg value="-fPIC"/> <arg value="--std=gnu99"/> </exec> <exec dir="${native.build.path}" failonerror="true" executable="gcc"> <arg value="-shared"/> <arg value="-o${native.build.path}/libdaos-jni.so"/> <arg value="${native.build.path}/daos_jni_common.o"/> <arg value="${native.build.path}/io_daos_dfs_DaosFsClient.o"/> <arg value="${native.build.path}/DunsAttribute.pb-c.o"/> <arg value="${native.build.path}/io_daos_DaosClient.o"/> <arg value="${native.build.path}/io_daos_obj_DaosObjClient.o"/> <arg value="-L${sl-prefix}/lib"/> <arg value="-L${sl-prefix}/lib64"/> <arg value="-L${sl-protobufc-prefix}/lib"/> <arg value="-L/usr/lib"/> <arg value="-L/usr/lib64"/> <arg value="-L/usr/local/lib"/> <arg value="-L/usr/local/lib64"/> <arg value="-ldaos"/> <arg value="-luuid"/> <arg value="-ldaos_common"/> <arg value="-ldfs"/> <arg value="-lduns"/> <arg value="-lcart"/> <arg value="-lprotobuf-c"/> </exec> <copy file="${native.build.path}/libdaos-jni.so" todir="${project.basedir}/target/classes"/> </tasks> </configuration> <goals> <goal>run</goal> </goals> </execution> </executions> </plugin> <plugin> <artifactId>maven-shade-plugin</artifactId> <executions> <execution> <id>shade-protobuf3-netty4</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <relocations> <relocation> <pattern>com.google.protobuf</pattern> <shadedPattern>com.google.protoshadebuf3</shadedPattern> </relocation> <relocation> <pattern>io.netty.buffer</pattern> <shadedPattern>io.netty.buffershade4</shadedPattern> </relocation> <relocation> <pattern>io.netty.util</pattern> <shadedPattern>io.netty.utilshade4</shadedPattern> </relocation> </relocations> <artifactSet> <excludes> <exclude>org.slf4j:slf4j-api</exclude> <exclude>org.apache.logging.log4j:*</exclude> <exclude>commons-lang:commons-lang</exclude> <exclude>com.google.code.findbugs:jsr305</exclude> <exclude>org.javassist:javassist</exclude> </excludes> </artifactSet> <finalName>${artifactId}-${version}-protobuf3-netty4-shaded</finalName> </configuration> </execution> <execution> <id>shade</id> <phase>package</phase> <goals> <goal>shade</goal> </goals> <configuration> <shadedArtifactAttached>true</shadedArtifactAttached> <relocations> <relocation> <pattern>com.google.protobuf</pattern> <shadedPattern>com.google.protoshadebuf3</shadedPattern> </relocation> <relocation> <pattern>io.netty.buffer</pattern> <shadedPattern>io.netty.buffershade4</shadedPattern> </relocation> <relocation> <pattern>io.netty.util</pattern> <shadedPattern>io.netty.utilshade4</shadedPattern> </relocation> </relocations> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>build-helper-maven-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>attach-shaded</id> <phase>package</phase> <goals> <goal>attach-artifact</goal> </goals> <configuration> <artifacts> <artifact> <file>target/${artifactId}-${version}-protobuf3-netty4-shaded.jar</file> <type>jar</type> <classifier>protobuf3-netty4-shaded</classifier> </artifact> <artifact> <file>target/${artifactId}-${version}-shaded.jar</file> <type>jar</type> <classifier>all-shaded</classifier> </artifact> </artifacts> </configuration> </execution> </executions> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-gpg-plugin</artifactId> </plugin> <plugin> <groupId>org.sonatype.plugins</groupId> <artifactId>nexus-staging-maven-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-source-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-failsafe-plugin</artifactId> <executions> <execution> <id>integration-test</id> <goals> <goal>integration-test</goal> </goals> </execution> <execution> <id>verify</id> <goals> <goal>verify</goal> </goals> </execution> </executions> </plugin> </plugins> </build> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-checkstyle-plugin</artifactId> <version>3.0.0</version> <configuration> <configLocation>../dev/checkstyle/checkstyle.xml</configLocation> <headerLocation>../dev/checkstyle/checkstyle.license</headerLocation> <suppressionsLocation>../dev/checkstyle/suppressions.xml</suppressionsLocation> <encoding>UTF-8</encoding> <failsOnError>false</failsOnError> <linkXRef>false</linkXRef> <includeTestSourceDirectory>false</includeTestSourceDirectory> </configuration> <reportSets> <reportSet> <reports> <report>checkstyle</report> </reports> </reportSet> </reportSets> </plugin> </plugins> </reporting> </project>