hibernate-ogm-mongodb
Used in:
components
- OverviewOverview
- VersionsVersions
- DependentsDependents
- DependenciesDependencies
<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-mongodb</artifactId>
<version>4.0.0.Beta4</version>
</dependency><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>
<artifactId>hibernate-ogm-parent</artifactId>
<groupId>org.hibernate.ogm</groupId>
<version>4.0.0.Beta4</version>
<relativePath>..</relativePath>
</parent>
<artifactId>hibernate-ogm-mongodb</artifactId>
<name>Hibernate OGM for MongoDB</name>
<description>Persist objects in MongoDB</description>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<MONGODB_HOSTNAME>${env.MONGODB_HOSTNAME}</MONGODB_HOSTNAME>
<MONGODB_PORT>${env.MONGODB_PORT}</MONGODB_PORT>
</environmentVariables>
<forkMode>once</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>org.bsc.maven</groupId>
<artifactId>maven-processor-plugin</artifactId>
</plugin>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-checkstyle-plugin</artifactId>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-core</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-entitymanager</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate.hql</groupId>
<artifactId>hibernate-hql-parser</artifactId>
</dependency>
<dependency>
<groupId>org.mongodb</groupId>
<artifactId>mongo-java-driver</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-testing</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-orm</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate.ogm</groupId>
<artifactId>hibernate-ogm-core</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-search-engine</artifactId>
<type>test-jar</type>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.jbossts</groupId>
<artifactId>jbossjta</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easytesting</groupId>
<artifactId>fest-assert</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.jboss.shrinkwrap</groupId>
<artifactId>shrinkwrap-impl-base</artifactId>
<scope>test</scope>
</dependency>
</dependencies>
<profiles>
<profile>
<id>embedded-mongodb</id>
<activation>
<property>
<name>!useExternalMongoDb</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<groupId>org.codehaus.gmaven</groupId>
<artifactId>gmaven-plugin</artifactId>
<executions>
<execution>
<id>log-info</id>
<phase>generate-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
println "[INFO] ------------------------------------------------------------------------";
println "[INFO] MONGO DB BUILD INFO ";
println "[INFO] ------------------------------------------------------------------------";
println "[INFO] Extracting MongoDB distribution to ${embeddedMongoDbTempDir} and ";
println "[INFO] launching MongoDB process on port ${embeddedMongoDbPort}. The properties";
println "[INFO] 'embeddedMongoDbTempDir' and 'embeddedMongoDbPort' can be used to ";
println "[INFO] specify another directory and/or port like this: ";
println "[INFO] ";
println "[INFO] mvn test -DembeddedMongoDbTempDir=%dir% -DembeddedMongoDbPort=%port%";
println "[INFO] ";
println "[INFO] To use an external Mongo DB instance instead, specify the ";
println "[INFO] 'useExternalMongoDb' property: ";
println "[INFO] ";
println "[INFO] mvn test -DuseExternalMongoDb ";
println "[INFO] ";
println "[INFO] In this case, host and port are retrieved from the environment ";
println "[INFO] variables MONGODB_HOSTNAME and MONGODB_PORT, respectively. ";
println "[INFO] ------------------------------------------------------------------------";
</source>
</configuration>
</execution>
<execution>
<id>prepare-mongodb-directories</id>
<phase>generate-test-resources</phase>
<goals>
<goal>execute</goal>
</goals>
<configuration>
<source>
def tempDir = new File(project.properties['embeddedMongoDbTempDir']);
ant.delete(dir : tempDir);
ant.mkdir(dir : tempDir);
def logDir = new File(project.properties['embeddedMongoDbLogDir']);
ant.delete(dir : logDir);
ant.mkdir(dir : logDir);
System.setProperty( "de.flapdoodle.embed.io.tmpdir", "${embeddedMongoDbTempDir}" );
</source>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<environmentVariables>
<MONGODB_PORT>${embeddedMongoDbPort}</MONGODB_PORT>
<MONGODB_HOSTNAME>${embeddedMongoDbBindIp}</MONGODB_HOSTNAME>
</environmentVariables>
<forkMode>once</forkMode>
</configuration>
</plugin>
<plugin>
<groupId>com.github.joelittlejohn.embedmongo</groupId>
<artifactId>embedmongo-maven-plugin</artifactId>
<executions>
<execution>
<id>start-embedded-mongodb</id>
<phase>generate-test-resources</phase>
<goals>
<goal>start</goal>
</goals>
</execution>
<execution>
<id>stop-embedded-mongodb</id>
<!--
Using phase "test" to trigger shut down when running "mvn test". This is safe
because the Surefire plug-in is configured above and order of declaration
within a POM is considered to resolve execution order of two plug-ins with
executions in the same phase
-->
<phase>test</phase>
<goals>
<goal>stop</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>