1<?xml version="1.0" encoding="UTF-8"?>
2<project
3        xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
4        xmlns="http://maven.apache.org/POM/4.0.0"
5        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
6    <modelVersion>4.0.0</modelVersion>
7    <name>RocksDB JNI</name>
8    <url>http://rocksdb.org/</url>
9    <groupId>org.rocksdb</groupId>
10    <artifactId>rocksdbjni</artifactId>
11    <!-- Version will be automatically replaced -->
12    <version>-</version>
13    <description>RocksDB fat jar that contains .so files for linux32 and linux64 (glibc and musl-libc), jnilib files
14        for Mac OSX, and a .dll for Windows x64.
15    </description>
16    <licenses>
17        <license>
18            <name>Apache License 2.0</name>
19            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
20            <distribution>repo</distribution>
21        </license>
22        <license>
23            <name>GNU General Public License, version 2</name>
24            <url>http://www.gnu.org/licenses/gpl-2.0.html</url>
25            <distribution>repo</distribution>
26        </license>
27    </licenses>
28    <scm>
29        <connection>scm:git:git://github.com/dropwizard/metrics.git</connection>
30        <developerConnection>scm:git:[email protected]:dropwizard/metrics.git</developerConnection>
31        <url>http://github.com/dropwizard/metrics/</url>
32        <tag>HEAD</tag>
33    </scm>
34    <developers>
35        <developer>
36            <name>Facebook</name>
37            <email>[email protected]</email>
38            <timezone>America/New_York</timezone>
39            <roles>
40                <role>architect</role>
41            </roles>
42        </developer>
43    </developers>
44
45    <properties>
46        <project.build.source>1.7</project.build.source>
47        <project.build.target>1.7</project.build.target>
48        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
49    </properties>
50
51    <build>
52        <plugins>
53            <plugin>
54                <groupId>org.apache.maven.plugins</groupId>
55                <artifactId>maven-compiler-plugin</artifactId>
56                <version>3.2</version>
57                <configuration>
58                    <source>${project.build.source}</source>
59                    <target>${project.build.target}</target>
60                    <encoding>${project.build.sourceEncoding}</encoding>
61                </configuration>
62            </plugin>
63            <plugin>
64                <groupId>org.apache.maven.plugins</groupId>
65                <artifactId>maven-surefire-plugin</artifactId>
66                <version>2.18.1</version>
67                <configuration>
68                    <argLine>${argLine} -ea -Xcheck:jni -Djava.library.path=${project.build.directory}</argLine>
69                    <useManifestOnlyJar>false</useManifestOnlyJar>
70                    <useSystemClassLoader>false</useSystemClassLoader>
71                    <additionalClasspathElements>
72                        <additionalClasspathElement>${project.build.directory}/*</additionalClasspathElement>
73                    </additionalClasspathElements>
74                </configuration>
75            </plugin>
76            <plugin>
77                <groupId>org.jacoco</groupId>
78                <artifactId>jacoco-maven-plugin</artifactId>
79                <version>0.7.2.201409121644</version>
80                <executions>
81                    <execution>
82                        <goals>
83                            <goal>prepare-agent</goal>
84                        </goals>
85                    </execution>
86                    <execution>
87                        <id>report</id>
88                        <phase>prepare-package</phase>
89                        <goals>
90                            <goal>report</goal>
91                        </goals>
92                    </execution>
93                </executions>
94            </plugin>
95            <plugin>
96                <groupId>org.codehaus.gmaven</groupId>
97                <artifactId>groovy-maven-plugin</artifactId>
98                <version>2.0</version>
99                <executions>
100                    <execution>
101                        <phase>process-classes</phase>
102                        <goals>
103                            <goal>execute</goal>
104                        </goals>
105                        <configuration>
106                            <defaults>
107                                <name>Xenu</name>
108                            </defaults>
109                            <source>
110                                String fileContents = new File(project.basedir.absolutePath + '/../include/rocksdb/version.h').getText('UTF-8')
111                                matcher = (fileContents =~ /(?s).*ROCKSDB_MAJOR ([0-9]+).*?/)
112                                String major_version = matcher.getAt(0).getAt(1)
113                                matcher = (fileContents =~ /(?s).*ROCKSDB_MINOR ([0-9]+).*?/)
114                                String minor_version = matcher.getAt(0).getAt(1)
115                                matcher = (fileContents =~ /(?s).*ROCKSDB_PATCH ([0-9]+).*?/)
116                                String patch_version = matcher.getAt(0).getAt(1)
117                                String version = String.format('%s.%s.%s', major_version, minor_version, patch_version)
118                                // Set version to be used in pom.properties
119                                project.version = version
120                                // Set version to be set as jar name
121                                project.build.finalName = project.artifactId + "-" + version
122                            </source>
123                        </configuration>
124                    </execution>
125                </executions>
126            </plugin>
127        </plugins>
128    </build>
129
130    <dependencies>
131        <dependency>
132            <groupId>junit</groupId>
133            <artifactId>junit</artifactId>
134            <version>4.12</version>
135            <scope>test</scope>
136        </dependency>
137        <dependency>
138            <groupId>org.assertj</groupId>
139            <artifactId>assertj-core</artifactId>
140            <version>1.7.1</version>
141            <scope>test</scope>
142        </dependency>
143        <dependency>
144            <groupId>org.mockito</groupId>
145            <artifactId>mockito-all</artifactId>
146            <version>1.10.19</version>
147            <scope>test</scope>
148        </dependency>
149    </dependencies>
150</project>
151