ce2789c7748de4de365f1a2eb0cfee1860005e24
[sdc/sdc-titan-cassandra.git] / pom.xml
1 <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">
2     <modelVersion>4.0.0</modelVersion>
3
4     <groupId>org.onap.sdc.sdc-titan-cassandra</groupId>
5     <artifactId>sdc-titan-cassandra</artifactId>
6     <version>1.2.0-SNAPSHOT</version>
7
8
9     <name>sdc-sdc-titan-cassandra</name>
10     <url>http://thinkaurelius.github.com/titan/</url>
11     <properties>
12         <astyanax.version>3.8.0</astyanax.version>
13         <jamm.group>com.github.jbellis</jamm.group>
14         <jamm.version>0.3.0</jamm.version>
15         <test.extra.jvm.opts>-javaagent:${basedir}/target/jamm-${jamm.version}.jar</test.extra.jvm.opts>
16         <default.test.jvm.opts>-Xms1024m -Xmx2048m -ea -XX:+HeapDumpOnOutOfMemoryError ${test.extra.jvm.opts}</default.test.jvm.opts>
17         <jna.version>4.0.0</jna.version>
18         <test.excluded.groups>com.thinkaurelius.titan.testcategory.MemoryTests,com.thinkaurelius.titan.testcategory.PerformanceTests,com.thinkaurelius.titan.testcategory.BrittleTests</test.excluded.groups>
19         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
20         <compiler.source>1.8</compiler.source>
21         <compiler.target>1.8</compiler.target>
22
23         <sitePath>/content/sites/site/org/onap/sdc/sdc-titan-cassandra/${project.version}</sitePath>
24         <nexusServer>https://nexus.onap.org</nexusServer>
25         <nexus.release.repository>releases</nexus.release.repository>
26         <nexus.snapshot.repository>snapshots</nexus.snapshot.repository>
27         <nexus.id.release>ecomp-releases</nexus.id.release>
28         <nexus.id.snapshot>ecomp-snapshots</nexus.id.snapshot>
29         <staging.profile.id>176c31dfe190a</staging.profile.id>
30
31         <!--tests-->
32         <test.skip.ordered>true</test.skip.ordered>
33         <test.skip.unordered>true</test.skip.unordered>
34         <test.skip.ssl>true</test.skip.ssl>
35         <test.skip.serial>true</test.skip.serial>
36
37     </properties>
38     <!-- Libraries -->
39     
40     <dependencies>
41         <dependency>
42             <groupId>com.thinkaurelius.titan</groupId>
43             <artifactId>titan-core</artifactId>
44             <version>1.0.0</version>
45         </dependency>
46         <dependency>
47             <groupId>com.thinkaurelius.titan</groupId>
48             <artifactId>titan-test</artifactId>
49             <version>1.0.0</version>
50             <scope>test</scope>
51         </dependency>
52         <dependency>
53             <groupId>com.codahale.metrics</groupId>
54             <artifactId>metrics-core</artifactId>
55             <version>3.0.1</version>
56         </dependency>
57         <dependency>
58             <groupId>com.carrotsearch</groupId>
59             <artifactId>junit-benchmarks</artifactId>
60             <version>0.7.0</version>
61         </dependency>
62         <!-- Logging backends.
63              Cassandra 2.1+ moved to Logback.  Titan is logging-backend-agnostic,
64              but still uses Log4j in testing.  The slf4j binding for logback is,
65              inconveniently, packed into the logback-classic artifact.  This means
66              the binding can't easily be removed from the classpath without losing
67              logback-classic or inserting some hack to mess with the jar contents.
68              We can't lose logback-classic because StorageProxy contains hardcoded
69              references to some of its classes (it contains some methods to change
70              logback loglevels at runtime).  Hence, to stick with Log4j, the
71              least-worst approach is to enforce a classpath ordering constraint: as
72              long as the slf4j-log4j12 binding appears on the classpath before
73              logback-classic, log4j will be used instead of logback.  I don't have
74              any special love for log4j, but Titan should use a single logging
75              backend throughout all its tests.   I don't want to maintain a mixture
76              of logback.xml and log4j.properties files scattered randomly through
77              the titan-* submodules.  Maven populates the classpath elements for
78              tests in pom appearance order.  That's why these dependencies are 
79              explicitly declared below: to make slf4j-log4j12 preced logback-classic
80              on the test classpath. -->
81         <dependency>
82             <groupId>org.slf4j</groupId>
83             <artifactId>slf4j-log4j12</artifactId>
84             <version>1.7.5</version>
85         </dependency>
86         <dependency>
87             <groupId>ch.qos.logback</groupId>
88             <artifactId>logback-classic</artifactId>
89             <version>1.1.2</version>
90         </dependency>
91         <!-- End logging backends. -->
92         <dependency>
93             <groupId>com.carrotsearch.randomizedtesting</groupId>
94             <artifactId>randomizedtesting-runner</artifactId>
95             <version>2.0.8</version>
96         </dependency>
97         <!--
98             JNA is not required to run Cassandra, but it improves
99             efficiency of certain of Cassandra's filesystem and memory
100             operations.  DataStax describes JNA as "required for
101             production installations":
102
103             http://www.datastax.com/docs/1.2/install/install_jre
104         -->
105         <dependency>
106             <groupId>net.java.dev.jna</groupId>
107             <artifactId>jna</artifactId>
108             <version>${jna.version}</version>
109             <optional>true</optional>
110         </dependency>
111         <dependency>
112             <groupId>org.apache.cassandra</groupId>
113             <artifactId>cassandra-all</artifactId>
114             <version>2.1.9</version>
115             <!-- The version is controlled in <dependencyManagement> in the parent pom -->
116         </dependency>
117         <dependency>
118             <groupId>commons-pool</groupId>
119             <artifactId>commons-pool</artifactId>
120             <version>1.6</version>
121         </dependency>
122         <dependency>
123             <groupId>com.netflix.astyanax</groupId>
124             <artifactId>astyanax-core</artifactId>
125             <version>${astyanax.version}</version>
126         </dependency>
127         <dependency>
128             <groupId>com.netflix.astyanax</groupId>
129             <artifactId>astyanax-thrift</artifactId>
130             <version>${astyanax.version}</version>
131         </dependency>
132         <dependency>
133             <groupId>com.netflix.astyanax</groupId>
134             <artifactId>astyanax-cassandra</artifactId>
135             <version>${astyanax.version}</version>
136         </dependency>
137         <dependency>
138              <groupId>com.netflix.astyanax</groupId>
139              <artifactId>astyanax-recipes</artifactId>
140              <version>${astyanax.version}</version>
141         </dependency>
142         <dependency>
143             <groupId>org.xerial.snappy</groupId>
144             <artifactId>snappy-java</artifactId>
145             <version>1.0.5-M3</version>
146         </dependency>
147     </dependencies>
148
149     <build>
150     
151         <resources>
152             <resource>
153                 <directory>${basedir}/src/main/resources</directory>
154                 <filtering>true</filtering>
155             </resource>
156         </resources>
157         <testResources>
158             <testResource>
159                 <directory>${basedir}/src/test/resources</directory>
160             </testResource>
161         </testResources>
162         
163         <plugins>
164             <plugin>
165                 <artifactId>maven-resources-plugin</artifactId>
166                 <version>2.6</version>
167                 <executions>
168                     <execution>
169                         <id>filter-cassandra-bop-config</id>
170                         <phase>process-test-resources</phase>
171                         <goals>
172                             <goal>copy-resources</goal>
173                         </goals>
174                         <configuration>
175                             <outputDirectory>${project.build.directory}/cassandra/conf/localhost-bop</outputDirectory>
176                             <filters>
177                                 <filter>${basedir}/config/cassandra-filters/localhost-bop.properties</filter>
178                             </filters>
179                             <resources>
180                                 <resource>
181                                     <directory>${basedir}/config/cassandra</directory>
182                                     <filtering>true</filtering>
183                                 </resource>
184                             </resources>
185                         </configuration>
186                     </execution>
187                     <execution>
188                         <id>filter-cassandra-murmur-config</id>
189                         <phase>process-test-resources</phase>
190                         <goals>
191                             <goal>copy-resources</goal>
192                         </goals>
193                         <configuration>
194                             <outputDirectory>${project.build.directory}/cassandra/conf/localhost-murmur</outputDirectory>
195                             <filters>
196                                 <filter>${basedir}/config/cassandra-filters/localhost-murmur.properties</filter>
197                             </filters>
198                             <resources>
199                                 <resource>
200                                     <directory>${basedir}/config/cassandra</directory>
201                                     <filtering>true</filtering>
202                                 </resource>
203                             </resources>
204                         </configuration>
205                     </execution>
206                     <execution>
207                         <id>filter-cassandra-murmur-ssl-config</id>
208                         <phase>process-test-resources</phase>
209                         <goals>
210                             <goal>copy-resources</goal>
211                         </goals>
212                         <configuration>
213                             <outputDirectory>${project.build.directory}/cassandra/conf/localhost-murmur-ssl</outputDirectory>
214                             <filters>
215                                 <filter>${basedir}/config/cassandra-filters/localhost-murmur-ssl.properties</filter>
216                             </filters>
217                             <resources>
218                                 <resource>
219                                     <directory>${basedir}/config/cassandra</directory>
220                                     <filtering>true</filtering>
221                                 </resource>
222                             </resources>
223                         </configuration>
224                     </execution>
225                     <execution>
226                         <!-- Need this to avoid corrupting the test keystore with nonsensical macro replacements -->
227                         <id>filter-cassandra-murmur-ssl-config-static</id>
228                         <phase>process-test-resources</phase>
229                         <goals>
230                             <goal>copy-resources</goal>
231                         </goals>
232                         <configuration>
233                             <outputDirectory>${project.build.directory}/cassandra/conf/localhost-murmur-ssl</outputDirectory>
234                             <resources>
235                                 <resource>
236                                     <directory>${basedir}/config/static</directory>
237                                     <filtering>false</filtering>
238                                 </resource>
239                             </resources>
240                         </configuration>
241                     </execution>
242                 </executions>
243             </plugin>
244             <plugin>
245                 <artifactId>maven-surefire-plugin</artifactId>
246                 <version>2.15</version>
247                 <executions>
248                     <execution>
249                         <!-- Run by "mvn test" -->
250                         <id>default-test</id>
251                         <phase>none</phase>
252                     </execution>
253                     <execution>
254                         <!-- Run by "mvn org.apache.maven.plugins:maven-surefire-plugin:test"
255                 
256                             Sonar does this when running JaCoCo and
257                             provides no configuration option to
258                             change its behavior. Define a safe
259                             configuration for JaCoCo to use when run
260                             by Sonar. This doesn't have to be fast,
261                             since it's only used for dynamic
262                             analysis, but it does have to cover all
263                             the tests.
264                         -->
265                         <id>default-cli</id>
266                         <phase>none</phase>
267                         <configuration>
268                             <includes>
269                                 <include>Nope.java</include>
270                             </includes>
271                             <exclude>
272                                 <exclude>**/*</exclude>
273                             </exclude>
274                             <parallel />
275                             <reuseForks>false</reuseForks>
276                             <threadCount>1</threadCount>
277                             <perCoreThreadCount>false</perCoreThreadCount>
278                             <runOrder>random</runOrder>
279                         </configuration>
280                     </execution>
281                     <execution>
282                         <id>bop-test</id>
283                         <goals>
284                             <goal>test</goal>
285                         </goals>
286                         <phase>test</phase>
287                         <configuration>
288                             <argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-bop -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-bop</argLine>
289                             <excludedGroups>${test.excluded.groups},com.thinkaurelius.titan.testcategory.UnorderedKeyStoreTests,com.thinkaurelius.titan.testcategory.SerialTests,com.thinkaurelius.titan.testcategory.CassandraSSLTests</excludedGroups>
290                             <groups />
291                             <forkCount>1</forkCount>
292                             <reuseForks>false</reuseForks>
293                             <parallel>classes</parallel>
294                             <perCoreThreadCount>true</perCoreThreadCount>
295                             <threadCount>2</threadCount>
296                             <runOrder>random</runOrder>
297                             <reportNameSuffix>bop</reportNameSuffix>
298                             <skip>${test.skip.ordered}</skip>
299                         </configuration>
300                     </execution>
301                     <execution>
302                         <id>murmur-test</id>
303                         <goals>
304                             <goal>test</goal>
305                         </goals>
306                         <phase>test</phase>
307                         <configuration>
308                             <argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-murmur -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-murmur</argLine>
309                             <excludedGroups>${test.excluded.groups},com.thinkaurelius.titan.testcategory.OrderedKeyStoreTests,com.thinkaurelius.titan.testcategory.SerialTests,com.thinkaurelius.titan.testcategory.CassandraSSLTests</excludedGroups>
310                             <groups />
311                             <forkCount>1</forkCount>
312                             <reuseForks>false</reuseForks>
313                             <parallel>classes</parallel>
314                             <perCoreThreadCount>true</perCoreThreadCount>
315                             <threadCount>2</threadCount>
316                             <runOrder>random</runOrder>
317                             <reportNameSuffix>murmur</reportNameSuffix>
318                             <skip>${test.skip.unordered}</skip>
319                         </configuration>
320                     </execution>
321                     <execution>
322                         <id>ssl-test</id>
323                         <goals>
324                             <goal>test</goal>
325                         </goals>
326                         <phase>test</phase>
327                         <configuration>
328                             <argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-murmur-ssl -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-murmur-ssl</argLine>
329                             <excludedGroups />
330                             <groups>com.thinkaurelius.titan.testcategory.CassandraSSLTests</groups>
331                             <!-- The TP3 JUnit Suite/Runner ignores groups/@Category and I'm not sure why.  Redundant excludes to keep TP3 tests from using non-SSL configs on SSL -->
332                             <excludes>
333                                 <exclude>**/*ComputerTest.java</exclude>
334                                 <exclude>**/*StructureTest.java</exclude>
335                                 <exclude>**/*ProcessTest.java</exclude>
336                             </excludes>
337                             <forkCount>1</forkCount>
338                             <reuseForks>false</reuseForks>
339                             <parallel>classes</parallel>
340                             <perCoreThreadCount>true</perCoreThreadCount>
341                             <threadCount>1</threadCount>
342                             <runOrder>random</runOrder>
343                             <reportNameSuffix>ssl</reportNameSuffix>
344                             <skip>${test.skip.ssl}</skip>
345                         </configuration>
346                     </execution>
347                     <execution>
348                         <id>serial-test</id>
349                         <goals>
350                             <goal>test</goal>
351                         </goals>
352                         <phase>test</phase>
353                         <configuration>
354                             <argLine>${default.test.jvm.opts} -Dtest.cassandra.confdir=${project.build.directory}/cassandra/conf/localhost-murmur -Dtest.cassandra.datadir=${project.build.directory}/cassandra/data/localhost-murmur</argLine>
355                             <excludedGroups />
356                             <groups>com.thinkaurelius.titan.testcategory.SerialTests</groups>
357                             <forkCount>1</forkCount>
358                             <reuseForks>false</reuseForks>
359                             <parallel>none</parallel>
360                             <perCoreThreadCount>false</perCoreThreadCount>
361                             <threadCount>1</threadCount>
362                             <runOrder>alphabetical</runOrder>
363                             <reportNameSuffix>serial</reportNameSuffix>
364                             <skip>${test.skip.serial}</skip>
365                         </configuration>
366                     </execution>
367                 </executions>
368             </plugin>
369             <plugin>
370                 <artifactId>maven-dependency-plugin</artifactId>
371                 <executions>
372                     <!-- Provide Java Memory Meter for Cassandra. Cassandra logs warnings if JAMM 
373                       is not available. Also, production Cassandra deployments will probably use JAMM, 
374                       so we might as well include it in our test configuration. -->
375                     <execution>
376                         <id>copy</id>
377                         <phase>process-resources</phase>
378                         <goals>
379                             <goal>copy</goal>
380                         </goals>
381                         <configuration>
382                             <artifactItems>
383                                 <artifactItem>
384                                     <groupId>${jamm.group}</groupId>
385                                     <artifactId>jamm</artifactId>
386                                     <version>${jamm.version}</version>
387                                     <outputDirectory>${project.build.directory}</outputDirectory>
388                                 </artifactItem>
389                             </artifactItems>
390                         </configuration>
391                     </execution>
392                 </executions>
393             </plugin>
394             <plugin>
395                 <artifactId>maven-jar-plugin</artifactId>
396                 <version>2.4</version>
397                 <executions>
398                     <execution>
399                         <id>pack-test-jar</id>
400                         <!-- prepare-package instead of package forces it to get signed -->
401                         <phase>prepare-package</phase>
402                         <goals>
403                             <goal>test-jar</goal>
404                         </goals>
405                     </execution>
406                 </executions>
407             </plugin>           
408                     <plugin>
409                                 <groupId>org.sonatype.plugins</groupId>
410                                 <artifactId>nexus-staging-maven-plugin</artifactId>
411                                 <version>1.6.7</version>
412                                 <extensions>true</extensions>
413                                 <configuration>
414                                         <nexusUrl>${nexusServer}</nexusUrl>
415                                         <stagingProfileId>${staging.profile.id}</stagingProfileId>
416                                         <serverId>ecomp-staging</serverId>
417                                 </configuration>
418                     </plugin>
419                     <plugin>
420                                 <groupId>org.apache.maven.plugins</groupId>
421                                 <artifactId>maven-site-plugin</artifactId>
422                                 <version>3.4</version>
423                                 <dependencies>
424                                         <dependency>
425                                                 <groupId>org.apache.maven.wagon</groupId>
426                                                 <artifactId>wagon-webdav-jackrabbit</artifactId>
427                                                 <version>2.10</version>
428                                         </dependency>
429                                 </dependencies>
430                         </plugin>
431             <!-- ================================================== -->
432             <!-- Set the JDK compiler version.                      -->
433             <!-- ================================================== -->
434             <plugin>
435                 <groupId>org.apache.maven.plugins</groupId>
436                 <artifactId>maven-compiler-plugin</artifactId>
437                 <version>2.5.1</version>
438                 <inherited>true</inherited>
439                 <configuration>
440                     <source>1.8</source>
441                     <target>1.8</target>
442                 </configuration>
443             </plugin>
444             <plugin>
445                                 <groupId>org.sonarsource.scanner.maven</groupId>
446                                 <artifactId>sonar-maven-plugin</artifactId>
447                                 <version>3.0.2</version>
448                         </plugin>
449         </plugins>
450     </build>
451
452     <profiles>
453       <profile>
454         <id>coverage</id>
455         <activation>
456           <activeByDefault>false</activeByDefault>
457         </activation>
458
459         <properties>
460           <test.extra.jvm.opts>${jacoco.opts} -javaagent:${basedir}/target/jamm-${jamm.version}.jar</test.extra.jvm.opts>
461         </properties>
462       </profile>
463     </profiles>
464     <distributionManagement>
465         <snapshotRepository>
466             <id>${nexus.id.snapshot}</id>
467             <name>repository-snapshots</name>
468             <url>${nexusServer}/content/repositories/${nexus.snapshot.repository}/</url>
469         </snapshotRepository>
470         <repository>
471             <id>${nexus.id.release}</id>
472             <name>repository-releases</name>
473             <url>${nexusServer}/content/repositories/${nexus.release.repository}/</url>
474         </repository>
475             <site>
476                 <id>ecomp-site</id>
477                 <url>dav:${nexusServer}${sitePath}</url>
478             </site>
479     </distributionManagement>
480 </project>
481