Code Monkey home page Code Monkey logo

embedmongo-maven-plugin's Introduction

embedmongo-maven-plugin Build Status Maven Central

Maven plugin wrapper for the flapdoodle.de embedded MongoDB API.

This plugin lets you start and stop an instance of MongoDB during a Maven build, e.g. for integration testing. The Mongo instance isn't strictly embedded (it's not running within the JVM of your application), but it is a managed instance that exists only for the lifetime of your build.

Versions

  • For Java 8 and later: <version>0.4.1</version>
  • For Java 6/7: <version>0.3.5</version>

Usage

<plugin>
  <groupId>com.github.joelittlejohn.embedmongo</groupId>
  <artifactId>embedmongo-maven-plugin</artifactId>
  <version>0.4.1</version>
  <executions>
    <execution>
      <id>start</id>
      <goals>
        <goal>start</goal>
      </goals>
      <configuration>
        <port>37017</port>
        <!-- optional, default 27017 -->
        
        <randomPort>true</randomPort>
        <!-- optional, default is false, if true allocates a random port and overrides embedmongo.port -->
        
        <version>2.0.4</version>
        <!-- optional, default 2.2.1 -->
        
        <features>ONLY_WITH_SSL, ONLY_WINDOWS_2008_SERVER, NO_HTTP_INTERFACE_ARG</features>
        <!-- optional, default is none. Enables flapdoodle.embed.mongo features, for example to build Windows download URLs since 3.6 -->
        
        <databaseDirectory>/tmp/mongotest</databaseDirectory>
        <!-- optional, default is a new dir in java.io.tmpdir -->
        
        <logging>file</logging>
        <!-- optional (file|console|none), default console -->
        
        <logFile>${project.build.directory}/myfile.log</logFile>
        <!-- optional, can be used when logging=file, default is ./embedmongo.log -->
        
        <logFileEncoding>utf-8</logFileEncoding>
        <!-- optional, can be used when logging=file, default is utf-8 -->
        
        <bindIp>127.0.0.1</bindIp>
        <!-- optional, default is to listen on all interfaces -->
        
        <downloadPath>http://internal-mongo-repo/</downloadPath>
        <!-- optional, default is http://fastdl.mongodb.org/ -->

        <unixSocketPrefix>${user.home}/.embedmongo</unixSocketPrefix>
        <!-- optional, default is /tmp -->
        
        <storageEngine>wiredTiger</storageEngine>
        <!--optional, one of wiredTiger or mmapv1 (default is mmapv1) -->
        
        <skip>false</skip>
        <!-- optional, skips this plugin entirely, use on the command line like -Dembedmongo.skip -->
        
      </configuration>
    </execution>
    <execution>
      <id>mongo-scripts</id>
      <goals>
        <goal>mongo-scripts</goal>
      </goals>
      <configuration>
        <version>2.0.4</version>
        <!-- optional, default 2.2.1 -->

        <scriptsDirectory>...</scriptsDirectory>
        <!-- a directory containing scripts to run -->
        
        <scriptCharsetEncoding>UTF-8</scriptCharsetEncoding>
        <!-- optional, valid charset encoding for loading the scripts. Uses the underlying charset encoding of the platform if not assigned -->
        
        <databaseName>mydb</databaseName>
        <!-- the name of the database to run scripts against -->
        
      </configuration>
    </execution>
    <execution>
      <id>mongo-import</id>
      <goals>
        <goal>mongo-import</goal>
      </goals>
      <configuration>
        <version>2.0.4</version>
        <!-- optional, default 2.2.1 -->

        <defaultImportDatabase>test</defaultImportDatabase>
        <!-- optional, name of the default database to import data -->
        
        <parallel>false</parallel>
        <!-- optional, default false, if true it launches in parallel all imports -->
        
        <wait>false</wait>
        <!-- optional, default false, if true it will wait forever after it imports the data -->
        
        <imports>
          <import>
            <database>my_db</database>
            <!-- optional, name of the database, if null it will fallback to defaultImportDatabase -->
            
            <collection>col</collection>
            <!-- optional, collection to import data into (will use <file> to derive this otherwise) -->
            
            <file>import_file.json</file>
            <!-- required, name of the json file to import -->
            
            <upsertOnImport>true</upsertOnImport>
            <!-- optional, default true, if true it will do an upsert on each document imported -->
            
            <dropOnImport>false</dropOnImport>
            <!-- optional, default true, if true it will do a drop the collection before starts to import -->
            
            <timeout>20000</timeout>
            <!-- optional, default 20000, it will fail if it takes more than this time importing a file (time in millis) -->
            
          </import>
          <!-- More imports are accepted and it will be executed in strictly order (if parallel is not set) -->
        </imports>
      </configuration>
    </execution>
    <execution>
      <id>stop</id>
      <goals>
        <goal>stop</goal>
      </goals>
    </execution>
  </executions>
</plugin>

Notes

  • By default, the start goal is bound to pre-integration-test, the stop goal is bound to post-integration-test. You can of course bind to different phases if required.
  • If you omit/forget the stop goal, any Mongo process spawned by the start goal will be stopped when the JVM terminates.
  • If you want to run Maven builds in parallel you can use randomPort to avoid port conflicts, the value allocated will be available to other plugins in the project as a property embedmongo.port. If you're using Jenkins, you can also try the Port Allocator Plugin.
  • If you need to use a proxy to download MongoDB then you can either use -Dhttp.proxyHost and -Dhttp.proxyPort as additional Maven arguments (this will affect the entire build) or add proxy settings to your settings.xml.
  • If you're having trouble with Windows firewall rules, try setting the bindIp config property to 127.0.0.1.
  • If you'd like the start goal to start mongodb and wait, you can add -Dembedmongo.wait to your Maven command line arguments or -Dembedmongo.import.wait if you want the imports
  • If you are using a charset encoding to load scripts, refer to the IANA Charset Registry. Accepted charsets are found in the Preferred MIME Name column.

Copyright © 2012 Joe Littlejohn

embedmongo-maven-plugin's People

Contributors

adamretter avatar bkmurchison avatar davidmc24 avatar dependabot[bot] avatar dietrichatadobe avatar gtexcalibur avatar joelittlejohn avatar matthewadams avatar mgaceanu avatar padilo avatar pires avatar rmarpozo avatar ryantenney avatar taher-ghaleb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

embedmongo-maven-plugin's Issues

Exception on Network.localhostIsIPv6() should be handled gracefully

When working at local coffee shop I get the following on running the start goal.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 3.770s
[INFO] Finished at: Thu Mar 07 07:09:10 EST 2013
[INFO] Final Memory: 27M/354M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.1.5:start (start) on project pem-system-tests-public-api-usage: Unable to determine if localhost is ipv6: capitalg: capitalg: nodename nor servname provided, or not known -> [Help 1]
[ERROR]

This also seems to happen if I disconnect myself and go offline.

In another maven module where I'm using de.flapdoodle.embed.mongo.MongodStarter in code as opposed to using your plugin as part of pre-integration-test and post-integration-test, I am wrapping MongodStarter jin this way to prevent that from happening.

public void startEmbeddedMongo() throws Exception {
    MongodConfig config = new MongodConfig(Version.V2_2_1, mongoPort, isLocalhostIPV6());
    MongodStarter runtime = MongodStarter.getDefaultInstance();
    mongod = runtime.prepare(config);
    mongod.start();
}

private boolean isLocalhostIPV6() {
    boolean isIp6;
    try {
        isIp6 = Network.localhostIsIPv6();
    } catch (Exception e) {
        isIp6 = false;
    }
    return isIp6;
}

If Network.localhostIsIPV6() fails for whatever reason, I'm just blithely setting MongodConfig's ipv6 property to false.

api update for embed-mongo

I did some changes to the api (uses builder for a lot more stuff). If you need support, feel free to ask.

Add compatibility with latest MongoDB

MongoDB 3.6 and older cannot be even downloaded by the plugin because there isn't the version without SSL available anymore and the plugin tries to use wrong file name. There is no way to override the file name.

Running embed Mongo manually fails

Hi, I'd like to run this plugin manually embedmongo:start (not binding it to maven lifecycle phases), but I'm getting java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils. inside plugin definition didn't help. When running for integration test I don't have this problem.

[INFO] --- embedmongo-maven-plugin:0.1.12:start (default-cli) @ technicalblog ---
Extract C:\Users\.embedmongo\win32\mongodb-win32-x86_64-2008plus-2.2.1.zip START
Extract C:\Users\.embedmongo\win32\mongodb-win32-x86_64-2008plus-2.2.1.zip DONE
[mongod output]note: noprealloc may hurt performance in many applications
[mongod output] Mon Jun 15 10:03:47 [initandlisten] MongoDB starting : pid=11436 port=27017 dbpath=C:\Users\-\AppData\Local\Temp\embedmongo-db-a9bae38c-0479-404a-9a91-f9ed63d03fa4 64-bit host=jj
[mongod output] Mon Jun 15 10:03:47 [initandlisten] db version v2.2.1, pdfile version 4.5
[mongod output] Mon Jun 15 10:03:47 [initandlisten] git version: d6764bf8dfe0685521b8bc7b98fd1fab8cfeb5ae
[mongod output] Mon Jun 15 10:03:47 [initandlisten] build info: windows sys.getwindowsversion(major=6, minor=1, build=7601, platform=2, service_pack='Service Pack 1') BOOST_LIB_VERSION=1_49
[mongod output] Mon Jun 15 10:03:47 [initandlisten] options: { dbpath: "C:\Users\AppData\Local\Temp\embedmongo-db-a9bae38c-0479-404a-9a91-f9ed63d03fa4", noauth: true, nohttpinterface: true, nojournal: true, nopreal
loc: true, port: 27017, smallfiles: true }
[mongod output] Mon Jun 15 10:03:47 [initandlisten] Unable to check for journal files due to: boost::filesystem::basic_directory_iterator constructor: SystÚm nem¨×e nalÚzt uvedenou cestu: "C:\Users\AppData\Local\Te
mp\embedmongo-db-a9bae38c-0479-404a-9a91-f9ed63d03fa4\journal"
[mongod output] Mon Jun 15 10:03:47 [initandlisten] waiting for connections on port 27017
[mongod output] VI 15, 2015 10:03:47 DOP. MongodExecutable start
INFO: de.flapdoodle.embed.mongo.config.MongodConfigBuilder$ImmutableMongodConfig@4a980530
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.039 s
[INFO] Finished at: 2015-06-15T10:03:47+02:00
[INFO] Final Memory: 9M/154M
[INFO] ------------------------------------------------------------------------
Exception in thread "Thread-2" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
        at de.flapdoodle.embed.process.io.file.Files.forceDelete(Files.java:104)
        at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:91)
        at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:151)
        at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:94)
        at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:171)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
        at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
        at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
        ... 6 more
Mon Jun 15 10:03:47 [initandlisten] connection accepted from 127.0.0.1:59032 #1 (1 connection now open)
[mongod output] Mon Jun 15 10:03:47 [conn1] terminating, shutdown command received
[mongod output] Mon Jun 15 10:03:47 dbexit: shutdown called
[mongod output] Mon Jun 15 10:03:47 [conn1] shutdown: going to close listening sockets...
[mongod output] Mon Jun 15 10:03:47 [conn1] closing listening socket: 364
[mongod output] Mon Jun 15 10:03:47 [conn1] shutdown: going to flush diaglog...
[mongod output] Mon Jun 15 10:03:47 [conn1] shutdown: going to close sockets...
[mongod output] Mon Jun 15 10:03:47 [conn1] shutdown: waiting for fs preallocator...
[mongod output] Mon Jun 15 10:03:47 [conn1] shutdown: closing all files...
[mongod output] Mon Jun 15 10:03:47 [conn1] closeAllFiles() finished
[mongod output] Mon Jun 15 10:03:47 [conn1] shutdown: removing fs lock...
[mongod output] Mon Jun 15 10:03:47 dbexit: really exiting now
[mongod output]
Exception in thread "Thread-3" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
        at de.flapdoodle.embed.process.io.file.Files.forceDelete(Files.java:104)
        at de.flapdoodle.embed.mongo.MongodProcess.deleteTempFiles(MongodProcess.java:92)
        at de.flapdoodle.embed.mongo.AbstractMongoProcess.cleanupInternal(AbstractMongoProcess.java:116)
        at de.flapdoodle.embed.process.runtime.AbstractProcess.stop(AbstractProcess.java:167)
        at de.flapdoodle.embed.process.runtime.Executable.stop(Executable.java:71)
        at de.flapdoodle.embed.process.runtime.Executable$JobKiller.run(Executable.java:88)
        at java.lang.Thread.run(Thread.java:745)

Plugin should use user proxy settings by default

Current proxy configuration is done inside project pom.xml. This is not valid for a project share between users having different proxies.
The plugin should user Maven user settings proxy configuration to download MongoDB.

Proxy settings are not used

In 0.2.1-SNAPSHOT, you've moved the proxy config to maven. Since then, proxy support is broken:

  • existing proxyHost and proxyPort from pom.xml is ignored;
  • ~/.m2/settings.xml is ignored even if it's configured properly, e.g. even with the below config:
<settings>
<proxies>
        <proxy>
        <id>egy</id>
            <active>true</active>
            <protocol>https</protocol>
            <host>does.not.exist</host>
            <port>3128</port>
        </proxy>
        <proxy>
            <active>true</active>
            <protocol>http</protocol>
            <host>does.not.exist</host>
            <port>3128</port>
        </proxy>
    </proxies>
</settings>

it just goes on and download. Also with valid hostnames, but it is still not using them.

Cant start mongodb 3.2.1 with mmapv1 storage engine

Hi and thanks for a great plugin.

I am however having problems with starting mongo DB 3.2.1 with storage engine mmapv1.
My maven config is:

<plugin>
    <groupId>com.github.joelittlejohn.embedmongo</groupId>
    <artifactId>embedmongo-maven-plugin</artifactId>
    <version>0.3.4</version>
    <executions>
        <execution>
            <id>start</id>
            <phase>pre-integration-test</phase>
            <goals>
                <goal>start</goal>
            </goals>
            <configuration>
                <storageEngine>mmapv1</storageEngine>
                <databaseDirectory>${basedir}/target/mongodb/${buildNumber}</databaseDirectory>
                <logging>none</logging>
                <port>${mongodb.port}</port>
                <version>3.2.1</version>
            </configuration>
        </execution>
        <execution>
            <id>stop</id>
            <phase>verify</phase>
            <goals>
                <goal>stop</goal>
            </goals>
            <configuration>
                <port>27015</port>
            </configuration>
        </execution>
    </executions>
</plugin>

But after startup i get the following when running:

connecting to: 127.0.0.1:27015/test
db.serverStatus().storageEngine
{ "name" : "wiredTiger", "supportsCommittedReads" : true }
> db.version()
3.2.1

Can I use this for a hooked mongoDB?

Hello,
I am curious if I could use this plugin to start a mongoDB together with a tomcat + webapp.
ATM I am tired of starting a mongo instance by hand every time I run the webapp. Because the webapp does start without it but is very slowly. Therefore I'd like not to care about this anymore and just run my goal and see the mongoDB starting with it as well.

again - is this possible with this plugin?

Connection refused

I am trying to connect to the embedded mongo instance from a unit test.
My configuration looks like this:

            <plugin>
                <groupId>com.github.joelittlejohn.embedmongo</groupId>
                <artifactId>embedmongo-maven-plugin</artifactId>
                <version>0.1.9</version>
                <configuration>
                    <bindIp>127.0.0.1</bindIp>
                    <port>37017</port> 
                    <randomPort>true</randomPort>
                    <version>2.2.3</version>
                    <databaseDirectory>/tmp</databaseDirectory>
                    <logging>file</logging>
                    <logFile>${project.build.directory}/mongodb.log</logFile>
                    <logFileEncoding>utf-8</logFileEncoding>
                </configuration>
                <executions>
                    <execution>
                        <id>start-mongo</id>
                        <phase>pre-integration-test</phase>
                        <goals>
                            <goal>start</goal>
                        </goals>
                    </execution>
                    <execution>
                        <id>stop-mongo</id>
                        <phase>post-integration-test</phase>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

When in the unit test I try to connect from an integration test. I see the following error. (The mongolog is clean and stops mongod only post-integration-test.

Sep 02, 2013 2:15:26 PM com.mongodb.DBTCPConnector initDirectConnection
WARNING: Exception executing isMaster command on localhost/127.0.0.1:37017
java.io.IOException: couldn't connect to [localhost/127.0.0.1:37017] bc:java.net.ConnectException: Connection refused
        at com.mongodb.DBPort._open(DBPort.java:214)
        at com.mongodb.DBPort.go(DBPort.java:107)
        at com.mongodb.DBPort.go(DBPort.java:88)
        at com.mongodb.DBPort.findOne(DBPort.java:143)
        at com.mongodb.DBPort.runCommand(DBPort.java:148)
        at com.mongodb.DBTCPConnector.initDirectConnection(DBTCPConnector.java:548)
        at com.mongodb.DBTCPConnector.isMongosConnection(DBTCPConnector.java:372)
        at com.mongodb.Mongo.isMongosConnection(Mongo.java:627)
        at com.mongodb.DBCollection.findOne(DBCollection.java:723)
        at com.mongodb.DBCollection.findOne(DBCollection.java:669)
        at com.mongodb.DBCollection.findOne(DBCollection.java:659)
        at at itests.MongoTest.testUpload(MongoTest.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at com.sun.proxy.$Proxy0.invoke(Unknown Source)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

Sep 02, 2013 2:15:26 PM com.mongodb.DBTCPConnector initDirectConnection
WARNING: Exception executing isMaster command on localhost/127.0.0.1:37017
java.io.IOException: couldn't connect to [localhost/127.0.0.1:37017] bc:java.net.ConnectException: Connection refused
        at com.mongodb.DBPort._open(DBPort.java:214)
        at com.mongodb.DBPort.go(DBPort.java:107)
        at com.mongodb.DBPort.go(DBPort.java:88)
        at com.mongodb.DBPort.findOne(DBPort.java:143)
        at com.mongodb.DBPort.runCommand(DBPort.java:148)
        at com.mongodb.DBTCPConnector.initDirectConnection(DBTCPConnector.java:548)
        at com.mongodb.DBTCPConnector.checkMaster(DBTCPConnector.java:527)
        at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:277)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
        at com.mongodb.DBCollection.findOne(DBCollection.java:727)
        at com.mongodb.DBCollection.findOne(DBCollection.java:669)
        at com.mongodb.DBCollection.findOne(DBCollection.java:659)
        at at itests.MongoTest.testUpload(MongoTest.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at com.sun.proxy.$Proxy0.invoke(Unknown Source)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

Sep 02, 2013 2:15:26 PM com.mongodb.DBPortPool gotError
WARNING: emptying DBPortPool to localhost/127.0.0.1:37017 b/c of error
java.io.IOException: couldn't connect to [localhost/127.0.0.1:37017] bc:java.net.ConnectException: Connection refused
        at com.mongodb.DBPort._open(DBPort.java:214)
        at com.mongodb.DBPort.go(DBPort.java:107)
        at com.mongodb.DBPort.call(DBPort.java:74)
        at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
        at com.mongodb.DBCollection.findOne(DBCollection.java:727)
        at com.mongodb.DBCollection.findOne(DBCollection.java:669)
        at com.mongodb.DBCollection.findOne(DBCollection.java:659)
        at itests.MongoTest.testUpload(MongoTest.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at com.sun.proxy.$Proxy0.invoke(Unknown Source)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)

com.mongodb.MongoException$Network: can't call something : localhost/127.0.0.1:37017/svmreporter
        at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:295)
        at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:257)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:310)
        at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:295)
        at com.mongodb.DBCollection.findOne(DBCollection.java:727)
        at com.mongodb.DBCollection.findOne(DBCollection.java:669)
        at com.mongodb.DBCollection.findOne(DBCollection.java:659)
        at itests.MongoTest.testUpload(MongoTest.java:96)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
        at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
        at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:76)
        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)
        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
        at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
        at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
        at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
        at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:35)
        at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:146)
        at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:97)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.apache.maven.surefire.booter.ProviderFactory$ClassLoaderProxy.invoke(ProviderFactory.java:103)
        at com.sun.proxy.$Proxy0.invoke(Unknown Source)
        at org.apache.maven.surefire.booter.SurefireStarter.invokeProvider(SurefireStarter.java:145)
        at org.apache.maven.surefire.booter.SurefireStarter.runSuitesInProcess(SurefireStarter.java:87)
        at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:69)
Caused by: java.io.IOException: couldn't connect to [localhost/127.0.0.1:37017] bc:java.net.ConnectException: Connection refused
        at com.mongodb.DBPort._open(DBPort.java:214)
        at com.mongodb.DBPort.go(DBPort.java:107)
        at com.mongodb.DBPort.call(DBPort.java:74)
        at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:286)
        ... 39 more

how to consum the mongodb file from Nexus only

Hi,
There is a problem on the Jenkin server, it only allows to download dependency from company Nexus.
So the plugin can't download the db file outside of company. After I upload the DB file to Nexus, whether the plugin could get it from Nexus.

I just know a stupid solution, that is to add the db file to my project, the file too big. Is there other solutions to prepare the db file for the plugin?

Best regards

Add ability to specify init script for mongoDB.

I am having trouble finding a way to add some test data to the DB before my httptests are run. I am trying to use the @BeforeClass annotation but am unable to figure out what i need to do in that method to add something. I think it would be good if I could add a script file to the config of the plugin to be run once the DB is brought up. Any thoughts?

Enable authentication for Mongo

We have tests that require Mongo authentication to be turned on. This is not possible with the current plugin.
I have already added support to my local copy and can send a patch if needed.

            if (authEnabled) {
                commandLinePostProcessor = new ICommandLinePostProcessor() {
                    @Override
                    public List<String> process(
                            final Distribution distribution, final List<String> args) {
                        args.remove("--noauth");
                        args.add("--auth");
                        return args;
                    }
                };
            }

Unclean Shutdown

After my mvn run I'm seeing something odd. There is a class not found exception (below). I've checked that the dependency/class exists in the embedmongo-maven-plugin pom. I'm guessing there is some kind of shutdown hook and it's occurring after mvn releases it's class loader. I don't mind tracking this down more but I'm curious if you could provide some insight.

[INFO] BUILD SUCCESS [INFO] ------------------------------------------------------------------------ [INFO] Total time: 03:02 min [INFO] Finished at: 2016-12-07T10:32:44-05:00 [INFO] Final Memory: 117M/907M [INFO] ------------------------------------------------------------------------ [DEBUG] force delete for Version{3.0.7}:OS_X:B64 and de.flapdoodle.embed.process.extract.ImmutableExtractedFileSet@60bf9e2b [DEBUG] Free 1 de.flapdoodle.embed.process.extract.ImmutableExtractedFileSet@60bf9e2bException in thread "Thread-19" java.lang.NoClassDefFoundError: de/flapdoodle/embed/process/extract/ExtractedFileSets at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:90) at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:176) at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:100) at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:196) at java.lang.Thread.run(Thread.java:745) Caused by: java.lang.ClassNotFoundException: de.flapdoodle.embed.process.extract.ExtractedFileSets at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50) at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247) at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239) ... 5 more

Migrate to refactored embedmongo 1.19 API

As you can see, there is a lot of refactoring in embedmongo project trunk. If you want to switch to a new Version you may need help. Feel free to ask any questions.

Michael:)

occasional "text file busy" error

Hi,

we're struggling with occasional strange "text file busy" error:
[ERROR] Failed to execute goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.1.8:start (start) on project ***: Unable to start the mongod: Cannot run program "/tmp/extract-4938eb39-e49d-4dff-bfa9-7e48da910665mongod": error=26, Text file busy -> [Help 1] [ERROR]

This error occurs on our jenkins machines (Linux) quite frequently (6 occurrences from 100 job executions in last 14 days) .
I was not able to reproduce this issue on my local computer (Mac OS X).

I thought that this issue is related to the fact that we are running maven build in parallel (mvn -T 4C) and plugin reuse /tmp/extract-* directory. However, as far as I understand the process there is a new "extract-" directory for each plugin run. Therefore it does not make any sense.

Have you got any idea what can be the root cause of this problem?

On Windows failed downloadPath with protocol file

On windows seven,

file:///${project.basedir}/src.resources/

running with
mvn monogo:start

I have
[ERROR] Failed to execute goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.3.4:start (default-cli) on project questionnaire: Execution default-cli of goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.3.4:start failed: Illegal character in path at index 10: file:///E:...../resources/mongo/ -> [Help 1]

mongo-scripts trys to execute directories

I have this plugin working via Jenkins however when I create a directory for scripts to run from, during the mongo-scripts goal, our version control repository automatically adds a directory called .svn.

So I have
/var/builduser/workspace/fil-jobq/src/test/resources/mongodb_init_scripts/create_user.js
/var/builduser/workspace/fil-jobq/src/test/resources/mongodb_init_scripts/.svn

As a result, the plugin tries to execute the directory as if it were a file and fails the build:

[ERROR] Failed to execute goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.3.0:mongo-scripts (mongo-scripts) on project fil-jobq: Unable to find file with name '.svn': /var/builduser/workspace/fil-jobq/src/test/resources/mongodb_init_scripts/.svn (Is a directory) -> [Help 1]

Is there a way to wildcard the directory, like /some/dir/*.js

Alternatively, is there a way to create a user via import mechanism? i.e. using the json file to create a user...

Thanks,
Matt.

java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils

When running the command

mvn -Dtest=br.com.levaetraz.facade.LogisticMapFacadeTestIT -Pintegration-test test-compile surefire:test

With maven

Apache Maven 3.0.5 (r01de14724cdef164cd33c7c8c2fe155faf9602da; 2013-02-19 10:51:28-0300)
Maven home: /home/francisco/programas/netbeans-8.0/java/maven
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_21/jre
Default locale: pt_BR, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-62-generic", arch: "amd64", family: "unix"

It's all fine and i get the output bellow at the end of the script

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.301s
[INFO] Finished at: Thu Aug 27 11:05:26 BRT 2015
[INFO] Final Memory: 14M/336M
[INFO] ------------------------------------------------------------------------
Thu Aug 27 11:05:26 [initandlisten] connection accepted from 127.0.0.1:35309 #3 (1 connection now open)
[mongod output] Thu Aug 27 11:05:26 [conn3] terminating, shutdown command received
[mongod output] Thu Aug 27 11:05:26 dbexit: shutdown called
[mongod output] Thu Aug 27 11:05:26 [conn3] shutdown: going to close listening sockets...
[mongod output] Thu Aug 27 11:05:26 [conn3] closing listening socket: 5
[mongod output] Thu Aug 27 11:05:26 [conn3] closing listening socket: 6
[mongod output] Thu Aug 27 11:05:26 [conn3] removing socket file: /tmp/mongodb-37018.sock
[mongod output] Thu Aug 27 11:05:26 [conn3] shutdown: going to flush diaglog...
[mongod output] Thu Aug 27 11:05:26 [conn3] shutdown: going to close sockets...
[mongod output] Thu Aug 27 11:05:26 [conn3] shutdown: waiting for fs preallocator...
[mongod output] 
Thu Aug 27 11:05:26 [conn3] shutdown: closing all files...
[mongod output] Thu Aug 27 11:05:26 [conn3] closeAllFiles() finished
[mongod output] Thu Aug 27 11:05:26 [conn3] shutdown: removing fs lock...
[mongod output] Thu Aug 27 11:05:26 dbexit: really exiting now

But when running the same command with this maven version

Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T15:37:52-03:00)
Maven home: /usr/share/maven3
Java version: 1.7.0_21, vendor: Oracle Corporation
Java home: /usr/java/jdk1.7.0_21/jre
Default locale: pt_BR, platform encoding: UTF-8
OS name: "linux", version: "3.13.0-62-generic", arch: "amd64", family: "unix"

Got this stranges java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 5.358 s
[INFO] Finished at: 2015-08-27T11:22:58-03:00
[INFO] Final Memory: 18M/338M
[INFO] ------------------------------------------------------------------------
Exception in thread "Thread-2" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
    a  t  de.flapdoodle.embed.pr ocess.io.file.Files.forceDelete(Files.java:104)
    a  t  de.flapdoodle.embed.pr ocess.store.ArtifactStore.removeFileSet(ArtifactStore.java:91)
    a  t  de.flapdoodle.embed.pr ocess.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:151)
    a  t  de.flapdoodle.embed.pr ocess.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:94)
    a  t  de.flapdoodle.embed.pr ocess.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:171)
    a  t  java.lang.Thread.run(T hread.java:722)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.io.FileUtils
    a  t  org.codehaus.plexus.cl assworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
    a  t  org.codehaus.plexus.cl assworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:259)
    a  t  org.codehaus.plexus.cl assworlds.realm.ClassRealm.loadClass(ClassRealm.java:235)
    a  t  org.codehaus.plexus.cl assworlds.realm.ClassRealm.loadClass(ClassRealm.java:227)
    .  . . 6 more
Thu Aug 27 11:22:58 [initandlisten] connection accepted from 127.0.0.1:35918 #3 (1 connection now open)
[mongod output] 
Thu Aug 27 11:22:58 [conn3] terminating, shutdown command received
[mongod output] Thu Aug 27 11:22:58 dbexit: shutdown called
[mongod output] Thu Aug 27 11:22:58 [conn3] shutdown: going to close listening sockets...
[mongod output] Thu Aug 27 11:22:58 [conn3] closing listening socket: 5
[mongod output] Thu Aug 27 11:22:58 [conn3] closing listening socket: 6
[mongod output] Thu Aug 27 11:22:58 [conn3] removing socket file: /tmp/mongodb-37018.sock
[mongod output] Thu Aug 27 11:22:58 [conn3] shutdown: going to flush diaglog...
[mongod output] Thu Aug 27 11:22:58 [conn3] shutdown: going to close sockets...
[mongod output] Thu Aug 27 11:22:58 [conn3] shutdown: waiting for fs preallocator...
[mongod output] Thu Aug 27 11:22:58 [conn3] shutdown: closing all files...
[mongod output] Thu Aug 27 11:22:58 [conn3] closeAllFiles() finished
[mongod output] Thu Aug 27 11:22:58 [conn3] shutdown: removing fs lock...
[mongod output] Thu Aug 27 11:22:58 dbexit: really exiting now
[mongod output] Exception in thread "Thread-3" java.lang.NoClassDefFoundError: org/apache/commons/io/FileUtils
    a  t  de.flapdoodle.embed.pr ocess.io.file.Files.forceDelete(Files.java:104)
    a  t  de.flapdoodle.embed.mo ngo.MongodProcess.deleteTempFiles(MongodProcess.java:92)
    a  t  de.flapdoodle.embed.mo ngo.AbstractMongoProcess.cleanupInternal(AbstractMongoProcess.java:116)
    a  t  de.flapdoodle.embed.pr ocess.runtime.AbstractProcess.stop(AbstractProcess.java:167)
    a  t  de.flapdoodle.embed.pr ocess.runtime.Executable.stop(Executable.java:71)
    a  t  de.flapdoodle.embed.pr ocess.runtime.Executable$JobKiller.run(Executable.java:88)
    a  t  java.lang.Thread.run(T hread.java:722)

Any clue?

Skip should apply to the stop goal

Hi,

I'm using a simple configuration like the one below in my parent pom which is inherited to all child poms.

<plugin>
  <groupId>com.github.joelittlejohn.embedmongo</groupId>
  <artifactId>embedmongo-maven-plugin</artifactId>
  <version>0.3.0</version>
  <executions>
    <execution>
      <id>start</id>
      <goals>
        <goal>start</goal>
      </goals>
    </execution>
    <execution>
      <id>stop</id>
      <goals>
        <goal>stop</goal>
      </goals>
    </execution>
  </executions>
</plugin>

I run the command

mvn clean install -Dembedmongo.skip

The skip (-Dembedmongo.skip) option only applies to the start goal, which means that the stop goal will run and fail with

Failed to execute goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.3.0:stop (stop) on project pushnotification-persistence-mongo: No mongod process found, it appears embedmongo:start was not called

Maybe the skip flag should be global at plugin level. Or should the plugin be configured differently?

Incomplete db initialization before starting integration tests.

Hi John. I have some problem with usage embedded mongodb in integration tests for my rest services (i use jersey) . I found what when I use common mongodb (as single process ) then all my tests work correctly, by when i use plugin i get several failed test . I think what no enough time for starting mongodb process and initialization data for test, therefore my rest-services return wrong result. How I can add additional time for starting embedded mongodb before tests run?

journal option on configuration doesn't seems picks

threw exception; nested exception is com.mongodb.MongoCommandException: Command failed with error 2: 'cannot use 'j' option when a host does not have journaling enabled' on server localhost:27017. The full response is { "ok" : 0, "code" : 2, "errmsg" : "cannot use 'j' option when a host does not have journaling enabled" }

<groupId>com.github.joelittlejohn.embedmongo</groupId> <artifactId>embedmongo-maven-plugin</artifactId> <version>0.3.5-SNAPSHOT</version> <executions> <execution> <id>start</id> <goals> <goal>start</goal> </goals> <configuration> <port>27017</port> <randomPort>false</randomPort> <version>3.2.1</version> <databaseDirectory>${project.build.directory}/mongotest</databaseDirectory> <bindIp>127.0.0.1</bindIp> <journal>true</journal> </configuration> </execution> <execution> <id>stop</id> <goals> <goal>stop</goal> </goals> </execution>

Can I update the project to Java 8?

If I sent a PR which updates everything to the latest versions for Java 8, such as de.flapdoodle.embed.mongo version 2, would it be accepted? or is this project determined to stay with Java 6 compatibility?

Add config option to enable text search

Hello,
I can't find any way to activate the text search (--setParameter textSearchEnabled=true). Is there a way to do it, or does the plugin need a patch ?

Thanks !
Sébastien

MVN repo and downloads of mongo artifact

It seems that the plugin doesn't attempt to load the mongo artifact from the current mvn repo and instead caches it in a .embedmongo dir. Is there a way to use the mvn repo? My build agents don't have access to the outside internet and can only get stuff from our nexus. Thoughts?

Stop goal should be "ignored" if skip=true

StopMojo should have the same behaviour as StartMojo when skip is true.
Otherwise you will get execeptions like the ones below

--- embedmongo-maven-plugin:0.3.0-AGILE:start (start) @ ctv-pubfrontal-core --
--- embedmongo-maven-plugin:0.3.0-AGILE:mongo-import (mongo-import) @ ctv-pubfrontal-core --
--- maven-surefire-plugin:2.18.1:test (default-test) @ ctv-pubfrontal-core ---
Tests are skipped.
--- maven-jar-plugin:2.4:jar (default-jar) @ ctv-pubfrontal-core ---
...
--- maven-failsafe-plugin:2.18.1:integration-test (default) @ ctv-pubfrontal-core ---
Tests are skipped.
--- embedmongo-maven-plugin:0.3.0-AGILE:stop (stop) @ ctv-pubfrontal-core ---
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
------------------------------------------------------------------------
Failed to execute goal com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.3.0-AGILE:stop (stop) on project ctv-pubfrontal-core: No mongod process found, it appears embedmongo:start was not called -> [Help 1]

embedmongo-maven-plugin is not thread safe.

I'm trying to build multimodule maven project with configured embedmongo-maven-plugin on Jenkins but the build is stucked (see output below).

Note: The maven build is executed in a parallel fashion (-T -4C) and maven explicitly states that embed-maven-plugin is not marked as thread safe.

Any ideas why the job is running forever?

[mongod output] Thu Apr 25 14:10:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:10:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:10:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:11:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:11:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:11:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:11:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:12:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:12:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:12:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:12:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:13:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:13:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:13:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:13:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:14:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:14:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:14:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:14:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:14:07 [clientcursormon] mem (MB) res:15 virt:480 mapped:0
[mongod output] Thu Apr 25 14:15:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:15:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:15:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:15:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:16:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:16:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:16:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:16:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:17:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:17:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:17:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:17:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:18:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:18:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:18:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:18:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:19:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:19:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:19:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:19:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:19:07 [clientcursormon] mem (MB) res:15 virt:480 mapped:0
[mongod output] Thu Apr 25 14:20:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:20:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:20:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:20:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:21:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:21:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:21:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:21:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:22:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:22:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:22:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:22:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:23:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:23:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:23:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:23:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:24:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:24:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:24:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:24:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:24:07 [clientcursormon] mem (MB) res:15 virt:480 mapped:0
[mongod output] Thu Apr 25 14:25:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:25:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:25:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:25:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:26:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:26:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:26:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:26:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:27:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:27:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:27:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:27:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:28:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:28:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:28:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:28:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:29:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:29:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:29:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:29:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:29:07 [clientcursormon] mem (MB) res:15 virt:480 mapped:0
[mongod output] Thu Apr 25 14:30:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:30:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:30:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:30:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:31:06 [DataFileSync] flushing mmap took 0ms  for 1 files
[mongod output] Thu Apr 25 14:31:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:31:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:31:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:32:06 [DataFileSync] flushing mmap took 1ms  for 1 files
[mongod output] Thu Apr 25 14:32:07 [PeriodicTask::Runner] task: WriteBackManager::cleaner took: 0ms
[mongod output] Thu Apr 25 14:32:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms
[mongod output] Thu Apr 25 14:32:07 [PeriodicTask::Runner] task: DBConnectionPool-cleaner took: 0ms

Set MongoDB version across different plugin executions

If maven property "embedmongo.version" is no set one have to set it as follows

<plugin>
            <groupId>com.github.joelittlejohn.embedmongo</groupId>
            <artifactId>embedmongo-maven-plugin</artifactId>
            <version>0.3.0</version>
            <configuration>
                <version>2.7.5</version> <!-- defined here the same version is applied everywhere -->
            </configuration>
            <executions>
                 ...

Otherwise If you use the goals start and mongo-import they will have different MongoDb versions.
See the following output

[INFO] --- embedmongo-maven-plugin:0.3.0:start (start) @ ctv-pubfrontal-core ---
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.7.5.zip START
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.7.5.zip DONE
...
[INFO] --- embedmongo-maven-plugin:0.3.0:mongo-import (mongo-import) @ ctv-pubfrontal-core ---
...
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.2.1.zip START 
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.2.1.zip DONE

So the behaviour of this "version" property is not the same as "port", which is stored in order be accessible from all the executions. This is absolutely fine but must be well documented IMHO

But note than when setting embedmongo.version as a property in my pom.xml MongoDb is extracted twice although using the same version, which I think is not the desired behaviour

[INFO] --- embedmongo-maven-plugin:0.3.0:start (start) @ ctv-pubfrontal-core ---
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.7.5.zip START
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.7.5.zip DONE
[INFO] --- embedmongo-maven-plugin:0.3.0:mongo-import (mongo-import) @ ctv-pubfrontal-core ---
[WARNING] Unrecognised MongoDB version '2.7.5', this might be a new version that we don't yet know about. Attemping download anyway...
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.7.5.zip START
Extract C:\Users\jllach\.embedmongo\win32\mongodb-win32-x86_64-2.7.5.zip DONE

Maybe this happens because is an unrecognised version ?

Enable the usage of other maven phases

Please allow for the running in the test-compile phase so this can be used for unit tests with out having to launch mongod over and over for each test.

Automatically choose collection names in mongoimport

It woudl be awesome if the new mongo-import goal could use the name of the json files as collection's name.
With this enhancement one could configure this goal like this

<imports>
                <import>
                    <file>NEWS.json,ASSET.json</file>
                </import>
</imports>

instead of

<imports>
                <import>
                    <collection>NEWS.</collection>
                    <file>NEWS.json</file>
                </import>
               <import>
                    <collection>ASSET</collection>
                    <file>ASSET.json</file>
                </import>

</imports>

There is a notably difference when working with a few dozens of collections :)

Ease of use mongo-import goal

In #48 an easier way to import collections has been implemented, but I also think that being able to point to a "directory" instead of a single file(or list, whatever) would definetly increase the ease of use of this goal

<execution>
                <id>mongo-import</id>
                <phase>process-test-resources</phase>
                <goals>
                  <goal>mongo-import</goal>
                </goals>
                <configuration>
                  <imports>
                    <import>
                      <database>${mongodb.database.name}</database>
                      <file>${basedir}/src/test/resources/mongodata</file>
                    </import>
                  </imports>
                </configuration>
              </execution>

In mongodata I have a few dozen of json files which are created by following the convention described in issue #48.

Embedded mongo is shutdown before tests end

Hi, I just tried out this plugin and it's cool! However, sometimes I got this error:

[INFO] --- embedmongo-maven-plugin:0.1.9:start (start) @ erp-impl ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0/maven-project-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-project/2.0/maven-project-2.0.pom (2 KB at 34.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0/maven-profile-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-profile/2.0/maven-profile-2.0.pom (2 KB at 28.5 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0/maven-model-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-model/2.0/maven-model-2.0.pom (3 KB at 50.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0/maven-artifact-manager-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact-manager/2.0/maven-artifact-manager-2.0.pom (2 KB at 28.6 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.pom (2 KB at 24.0 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-artifact/2.0/maven-artifact-2.0.pom (723 B at 15.3 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.mongo/1.31/de.flapdoodle.embed.mongo-1.31.pom
Downloaded: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.mongo/1.31/de.flapdoodle.embed.mongo-1.31.pom (7 KB at 148.5 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.process/1.27/de.flapdoodle.embed.process-1.27.pom
Downloaded: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.process/1.27/de.flapdoodle.embed.process-1.27.pom (9 KB at 190.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/commons-io/commons-io/2.2/commons-io-2.2.pom
Downloaded: http://repo.maven.apache.org/maven2/commons-io/commons-io/2.2/commons-io-2.2.pom (11 KB at 207.2 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.3/commons-compress-1.3.pom
Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.3/commons-compress-1.3.pom (11 KB at 227.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/google/guava/guava/11.0.1/guava-11.0.1.pom
Downloaded: http://repo.maven.apache.org/maven2/com/google/guava/guava/11.0.1/guava-11.0.1.pom (6 KB at 116.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/google/guava/guava-parent/11.0.1/guava-parent-11.0.1.pom
Downloaded: http://repo.maven.apache.org/maven2/com/google/guava/guava-parent/11.0.1/guava-parent-11.0.1.pom (2 KB at 40.7 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
Downloading: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.mongo/1.31/de.flapdoodle.embed.mongo-1.31.jar
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar
Downloading: http://repo.maven.apache.org/maven2/commons-io/commons-io/2.2/commons-io-2.2.jar
Downloading: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.process/1.27/de.flapdoodle.embed.process-1.27.jar
Downloaded: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.mongo/1.31/de.flapdoodle.embed.mongo-1.31.jar (47 KB at 349.5 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/com/google/guava/guava/11.0.1/guava-11.0.1.jar
Downloaded: http://repo.maven.apache.org/maven2/de/flapdoodle/embed/de.flapdoodle.embed.process/1.27/de.flapdoodle.embed.process-1.27.jar (86 KB at 571.0 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/commons-io/commons-io/2.2/commons-io-2.2.jar (170 KB at 997.2 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar (160 KB at 850.9 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-compress/1.3/commons-compress-1.3.jar (220 KB at 1130.3 KB/sec)
Downloaded: http://repo.maven.apache.org/maven2/com/google/guava/guava/11.0.1/guava-11.0.1.jar (1612 KB at 5574.8 KB/sec)
Sep 10, 2013 11:39:25 AM de.flapdoodle.embed.process.store.ArtifactStoreBuilder build
SEVERE: Build ArtifactStore(useCache:true)
[WARNING] Unrecognised MongoDB version '2.4.6', this might be a new version that we don't yet know about. Attemping download anyway...
Download GenericVersion{2.4.6}:Linux:B64 START
Download GenericVersion{2.4.6}:Linux:B64 DownloadSize: 94940554
Download GenericVersion{2.4.6}:Linux:B64 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 11% 12% 13% 14% 15% 16% 17% 18% 19% 20% 21% 22% 23% 24% 25% 26% 27% 28% 29% 30% 31% 32% 33% 34% 35% 36% 37% 38% 39% 40% 41% 42% 43% 44% 45% 46% 47% 48% 49% 50% 51% 52% 53% 54% 55% 56% 57% 58% 59% 60% 61% 62% 63% 64% 65% 66% 67% 68% 69% 70% 71% 72% 73% 74% 75% 76% 77% 78% 79% 80% 81% 82% 83% 84% 85% 86% 87% 88% 89% 90% 91% 92% 93% 94% 95% 96% 97% 98% 99% 100% Download GenericVersion{2.4.6}:Linux:B64 DONE
Extract /opt/jenkins/jenkins_home/.embedmongo/linux/mongodb-linux-x86_64-2.4.6.tgz START
Extract /opt/jenkins/jenkins_home/.embedmongo/linux/mongodb-linux-x86_64-2.4.6.tgz DONE
[mongod output]note: noprealloc may hurt performance in many applications
[mongod output] Tue Sep 10 11:39:30.567 BackgroundJob starting: DataFileSync
[mongod output] Tue Sep 10 11:39:30.567 versionArrayTest passed
[mongod output] Tue Sep 10 11:39:30.567 shardKeyTest passed
[mongod output] Tue Sep 10 11:39:30.567 isInRangeTest passed
[mongod output] Tue Sep 10 11:39:30.567 shardObjTest passed
[mongod output] Tue Sep 10 11:39:30.583 [initandlisten] MongoDB starting : pid=17132 port=27017 dbpath=/tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c 64-bit host=INTPAY-T1
[mongod output] Tue Sep 10 11:39:30.583 [initandlisten] db version v2.4.6
[mongod output] Tue Sep 10 11:39:30.583 [initandlisten] git version: b9925db5eac369d77a3a5f5d98a145eaaacd9673
[mongod output] Tue Sep 10 11:39:30.583 [initandlisten] build info: Linux ip-10-2-29-40 2.6.21.7-2.ec2.v1.2.fc8xen #1 SMP Fri Nov 20 17:48:28 EST 2009 x86_64 BOOST_LIB_VERSION=1_49
[mongod output] Tue Sep 10 11:39:30.583 [initandlisten] allocator: tcmalloc
[mongod output] Tue Sep 10 11:39:30.583 [initandlisten] options: { dbpath: "/tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c", noauth: true, nohttpinterface: true, nojournal: true, noprealloc: true, port: 27017, smallfiles: true, verbose: true }
[mongod output] Tue Sep 10 11:39:30.631 [initandlisten] flushing directory /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c
[mongod output] Tue Sep 10 11:39:30.661 [initandlisten] opening db:  local
[mongod output] Tue Sep 10 11:39:30.661 [initandlisten] enter repairDatabases (to check pdfile version #)
[mongod output] Tue Sep 10 11:39:30.661 [initandlisten] done repairDatabases
[mongod output] Tue Sep 10 11:39:30.661 BackgroundJob starting: snapshot
[mongod output] Tue Sep 10 11:39:30.661 BackgroundJob starting: PeriodicTask::Runner
[mongod output] Tue Sep 10 11:39:30.661 BackgroundJob starting: ClientCursorMonitor
[mongod output] Tue Sep 10 11:39:30.661 [initandlisten] run command local.$cmd { create: "startup_log", size: 10485760, capped: true }
[mongod output] Tue Sep 10 11:39:30.661 [initandlisten] create collection local.startup_log { create: "startup_log", size: 10485760, capped: true }
[mongod output] Tue Sep 10 11:39:30.661 [FileAllocator] allocating new datafile /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c/local.ns, filling with zeroes...
[mongod output] Tue Sep 10 11:39:30.661 [FileAllocator] creating directory /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c/_tmp
[mongod output] Tue Sep 10 11:39:30.661 [FileAllocator] flushing directory /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c
[mongod output] Tue Sep 10 11:39:30.662 BackgroundJob starting: TTLMonitor
[mongod output] Tue Sep 10 11:39:30.694 [FileAllocator] flushing directory /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c
[mongod output] Tue Sep 10 11:39:30.719 [FileAllocator] done allocating datafile /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c/local.ns, size: 16MB,  took 0.025 secs
[mongod output] Tue Sep 10 11:39:30.719 [FileAllocator] allocating new datafile /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c/local.0, filling with zeroes...
[mongod output] Tue Sep 10 11:39:30.719 [FileAllocator] flushing directory /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c
[mongod output] Tue Sep 10 11:39:30.736 [FileAllocator] done allocating datafile /tmp/embedmongo-db-5a0789bd-f03b-4713-b8af-ec2f9afad64c/local.0, size: 16MB,  took 0.016 secs
[mongod output] Tue Sep 10 11:39:30.737 [initandlisten] allocExtent local.startup_log size 10485760 0
[mongod output] Tue Sep 10 11:39:30.737 [initandlisten] New namespace: local.startup_log
[mongod output] Tue Sep 10 11:39:30.738 [initandlisten] allocExtent local.system.namespaces size 5888 0
[mongod output] Tue Sep 10 11:39:30.738 [initandlisten] New namespace: local.system.namespaces
[mongod output] Tue Sep 10 11:39:30.738 [initandlisten] command local.$cmd command: { create: "startup_log", size: 10485760, capped: true } ntoreturn:1 keyUpdates:0  reslen:37 76ms
[mongod output] Tue Sep 10 11:39:30.738 [initandlisten] insert local.startup_log ninserted:1 keyUpdates:0  0ms
[mongod output] Tue Sep 10 11:39:30.738 [initandlisten] fd limit hard:8192 soft:8192 max conn: 6553
[mongod output] Tue Sep 10 11:39:30.738 [initandlisten] waiting for connections on port 27017
[INFO] 
[INFO] --- maven-surefire-plugin:2.15:test (integration-tests) @ erp-impl ---

... few tests run ok ...

[mongod output] Tue Sep 10 11:39:36.390 [initandlisten] connection accepted from 127.0.0.1:47733 #2 (2 connections now open)
[mongod output] Tue Sep 10 11:39:36.391 [conn2] run command admin.$cmd { shutdown: 1, force: true }
[mongod output] Tue Sep 10 11:39:36.391 [conn2] terminating, shutdown command received
[mongod output] Tue Sep 10 11:39:36.391 dbexit: shutdown called
[mongod output] Tue Sep 10 11:39:36.391 [conn2] shutdown: going to close listening sockets...
[mongod output] Tue Sep 10 11:39:36.391 [conn2] closing listening socket: 7
[mongod output] Tue Sep 10 11:39:36.391 [conn2] closing listening socket: 8
[mongod output] Tue Sep 10 11:39:36.391 [conn2] removing socket file: /tmp/mongodb-27017.sock
[mongod output] Tue Sep 10 11:39:36.391 [conn2] shutdown: going to flush diaglog...
[mongod output] Tue Sep 10 11:39:36.391 [conn2] shutdown: going to close sockets...
[mongod output] Tue Sep 10 11:39:36.391 [conn2] shutdown: waiting for fs preallocator...
[mongod output] Tue Sep 10 11:39:36.391 [conn2] shutdown: closing all files...
[mongod output] Tue Sep 10 11:39:36.391 [conn1] got request after shutdown()
[mongod output] Tue Sep 10 11:39:36.391 [conn2] closeAllFiles() finished
[mongod output] Tue Sep 10 11:39:36.391 [conn2] shutdown: removing fs lock...
[mongod output] Tue Sep 10 11:39:36.391 dbexit: really exiting now
[mongod output] 
Sep 10, 2013 9:39:36 AM com.mongodb.DBPortPool gotError
WARNING: emptying DBPortPool to localhost/127.0.0.1:27017 b/c of error
java.io.EOFException
    at org.bson.io.Bits.readFully(Bits.java:48)
    at org.bson.io.Bits.readFully(Bits.java:33)
    at org.bson.io.Bits.readFully(Bits.java:28)
    at com.mongodb.Response.<init>(Response.java:40)
    at com.mongodb.DBPort.go(DBPort.java:142)
    at com.mongodb.DBPort.call(DBPort.java:92)
    at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:244)
    at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216)
    at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:288)
    at com.mongodb.DBApiLayer$MyCollection.__find(DBApiLayer.java:273)
    at com.mongodb.DBCollection.findOne(DBCollection.java:347)
    at com.mongodb.DBCollection.findOne(DBCollection.java:332)
    at com.mongodb.DBRefBase.fetch(DBRefBase.java:53)
    at org.springframework.data.mongodb.core.convert.MappingMongoConverter.readCollectionOrArray(MappingMongoConverter.java:743)

... subsequent tests fail on read/write ...

First it occured during first run of the plugin, then it ran successfully, then 3rd run also failed. Nothing was changed in between, seems like random behavior.
My tests are plain simple read/write, nothing special.

My maven config:

        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                    <trimStackTrace>false</trimStackTrace>
                </configuration>
                <executions>
                    <execution>
                        <id>unit-tests</id>
                        <phase>test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <includes>
                                <include>**/*Test.java</include>
                            </includes>
                            <excludes>
                                <exclude>**/*IntegrationTest.java</exclude>
                            </excludes>
                        </configuration>
                    </execution>
                    <execution>
                        <id>integration-tests</id>
                        <phase>integration-test</phase>
                        <goals>
                            <goal>test</goal>
                        </goals>
                        <configuration>
                            <skip>false</skip>
                            <includes>
                                <include>**/*IntegrationTest.java</include>
                            </includes>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>com.github.joelittlejohn.embedmongo</groupId>
                <artifactId>embedmongo-maven-plugin</artifactId>
                <version>0.1.9</version>
                <executions>
                    <execution>
                        <id>start</id>
                        <goals>
                            <goal>start</goal>
                        </goals>
                        <configuration>
                            <version>2.4.6</version>
                        </configuration>
                    </execution>
                    <execution>
                        <id>stop</id>
                        <goals>
                            <goal>stop</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        </plugins>

Error while removeFileSet - should i include de.flapdoodle.embed as dependency?

I thought maven plugin will take de.flapdoodle.embed.

[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 01:48 min
[INFO] Finished at: 2016-02-11T13:28:50-08:00
[INFO] Final Memory: 79M/1102M
[INFO] ------------------------------------------------------------------------
Exception in thread "Thread-1" Exception in thread "Thread-97" Exception in thread "Thread-12" java.lang.NoClassDefFoundError: de/flapdoodle/embed/process/extract/ExtractedFileSets
at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:90)
at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:176)
at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:100)
at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:196)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassNotFoundException: de.flapdoodle.embed.process.extract.ExtractedFileSets
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:239)
... 5 more
Exception in thread "Thread-24" java.lang.NoClassDefFoundError: de/flapdoodle/embed/process/extract/ExtractedFileSets
at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:90)
at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:176)
at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:100)
at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:196)
at java.lang.Thread.run(Thread.java:745)
java.lang.NoClassDefFoundError: de/flapdoodle/embed/process/extract/ExtractedFileSets
at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:90)
at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:176)
at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:100)
at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:196)
at java.lang.Thread.run(Thread.java:745)
java.lang.NoClassDefFoundError: de/flapdoodle/embed/process/extract/ExtractedFileSets
at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:90)
at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:176)
at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:100)
at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:196)
at java.lang.Thread.run(Thread.java:745)
Exception in thread "Thread-37" java.lang.NoClassDefFoundError: de/flapdoodle/embed/process/extract/ExtractedFileSets
at de.flapdoodle.embed.process.store.ArtifactStore.removeFileSet(ArtifactStore.java:90)
at de.flapdoodle.embed.process.store.CachingArtifactStore$FilesWithCounter.forceDelete(CachingArtifactStore.java:176)
at de.flapdoodle.embed.process.store.CachingArtifactStore.removeAll(CachingArtifactStore.java:100)
at de.flapdoodle.embed.process.store.CachingArtifactStore$CacheCleaner.run(CachingArtifactStore.java:196)
at java.lang.Thread.run(Thread.java:745)

Upgrade de.flapdoodle.embed.mongo in order to support MongoDb-3.x

In order to be able to use MongoDB 3.x embedmongo-maven-plugin needs to upgrade its dependency de.flapdoodle.embed.mongo version to at least 1.47.1 (1.47.3 is the last tag from this branch)
For more info see below

flapdoodle-oss/de.flapdoodle.embed.mongo#119

FYI I have tested my application with 1.50.0 and everything works fine

BTW : for the ones reading this and using https://github.com/jirutka/embedmongo-spring check that de.flapdoodle.embed.process dependency has the same version as de.flapdoodle.embed.mongo

Change phase in the exection

As the documentation precises:

"By default, the start goal is bound to pre-integration-test, the stop goal is bound to post-integration-test. You can of course bind to different phases if required."

I test to changed the phase like :

<goals>
    <goal>start</goal>
</goals>
<phase>test</phase>
[ERROR] Could not find goal 'test' in plugin com.github.joelittlejohn.embedmongo:embedmongo-maven-plugin:0.1.7 among available goals stop, start -> [Help 1]

It seems that not working. Can you check it please ?

NoSuchMethodException java.lang.Process.getPid()

Using the plugin (docker image running within kubernetes)

[INFO] --- embedmongo-maven-plugin:0.3.5:start (start) @ test-mongodb-sessions ---
Extract /home/jenkins/.embedmongo/linux/mongodb-linux-x86_64-2.2.1.tgz START
Extract /home/jenkins/.embedmongo/linux/mongodb-linux-x86_64-2.2.1.tgz extract mongodb-linux-x86_64-2.2.1/bin/mongod
Extract /home/jenkins/.embedmongo/linux/mongodb-linux-x86_64-2.2.1.tgz noting left
Extract /home/jenkins/.embedmongo/linux/mongodb-linux-x86_64-2.2.1.tgz DONE
java.lang.NoSuchMethodException: java.lang.Process.getPid()
	at java.base/java.lang.Class.getMethod(Class.java:2065)
	at de.flapdoodle.embed.process.runtime.Processes$PidHelper$1.getPid(Processes.java:195)
	at de.flapdoodle.embed.process.runtime.Processes.processId(Processes.java:72)
	at de.flapdoodle.embed.process.runtime.ProcessControl.<init>(ProcessControl.java:64)
	at de.flapdoodle.embed.process.runtime.ProcessControl.start(ProcessControl.java:205)
	at de.flapdoodle.embed.process.runtime.ProcessControl.fromCommandLine(ProcessControl.java:201)
	at de.flapdoodle.embed.process.runtime.NUMA.isNUMAOnce(NUMA.java:60)
	at de.flapdoodle.embed.process.runtime.NUMA.isNUMA(NUMA.java:48)
	at de.flapdoodle.embed.mongo.runtime.Mongod.enhanceCommandLinePlattformSpecific(Mongod.java:214)
	at de.flapdoodle.embed.mongo.MongodProcess.getCommandLine(MongodProcess.java:85)
	at de.flapdoodle.embed.mongo.MongodProcess.getCommandLine(MongodProcess.java:41)
	at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:86)
	at de.flapdoodle.embed.mongo.AbstractMongoProcess.<init>(AbstractMongoProcess.java:53)
	at de.flapdoodle.embed.mongo.MongodProcess.<init>(MongodProcess.java:50)
	at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:44)
	at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:34)
	at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:101)
	at com.github.joelittlejohn.embedmongo.StartMojo.executeStart(StartMojo.java:202)
	at com.github.joelittlejohn.embedmongo.AbstractEmbeddedMongoMojo.execute(AbstractEmbeddedMongoMojo.java:90)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
java.lang.NoSuchMethodException: java.lang.Process.getPid()
	at java.base/java.lang.Class.getMethod(Class.java:2065)
	at de.flapdoodle.embed.process.runtime.Processes$PidHelper$1.getPid(Processes.java:195)
	at de.flapdoodle.embed.process.runtime.Processes.processId(Processes.java:72)
	at de.flapdoodle.embed.process.runtime.ProcessControl.<init>(ProcessControl.java:64)
	at de.flapdoodle.embed.process.runtime.ProcessControl.start(ProcessControl.java:205)
	at de.flapdoodle.embed.process.runtime.AbstractProcess.<init>(AbstractProcess.java:98)
	at de.flapdoodle.embed.mongo.AbstractMongoProcess.<init>(AbstractMongoProcess.java:53)
	at de.flapdoodle.embed.mongo.MongodProcess.<init>(MongodProcess.java:50)
	at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:44)
	at de.flapdoodle.embed.mongo.MongodExecutable.start(MongodExecutable.java:34)
	at de.flapdoodle.embed.process.runtime.Executable.start(Executable.java:101)
	at com.github.joelittlejohn.embedmongo.StartMojo.executeStart(StartMojo.java:202)
	at com.github.joelittlejohn.embedmongo.AbstractEmbeddedMongoMojo.execute(AbstractEmbeddedMongoMojo.java:90)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
	at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
	at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
	at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56)
	at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305)
	at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:192)
	at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:105)
	at org.apache.maven.cli.MavenCli.execute(MavenCli.java:956)
	at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:290)
	at org.apache.maven.cli.MavenCli.main(MavenCli.java:194)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:564)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
	at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
	at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
	at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)

release 0.4.1

Can you tag 0.4.1 with the updated version of flapdoodle embed-mongo.

Nicely support Mongo versions flapdoodle doesn't yet support

Basically the list of "features" to use for mongo, and therefore things like command line arguments, comes from a Version.java file in flapdoodle, but the kicker is that the version needs to match exactly. Since the latest flapdoodle in the maven central repo (2.0.3) only supports 3.6.2, when I specify 3.6.5, we can't match the enum, and therefore no "features" are specified.

Right now this results in the "--nohttpinterface" option being passed to the mongod process, which is invalid in 3.6.x, and mongo doesn't start propertly.

If we instead "downgrade" unknown versions, we could for instance borrow the config for the 3.6.2 version and apply it to the 3.6.5 actual binary, which I think would work fine.

I tried to get the flapdoodle folks to support this at their level, but that doesn't seem like it's going to happen:
https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/issues/255

For now I've worked around this by using 3.6.2 in our tests instead of 3.6.5, but this is less than ideal as we are trying to vet upgrading to 3.6.5, and would like to test with the same version.

Problem with Windows Firewall

The maven plugin extracts the mongod into a unique file every time it runs, for example:
C:\users\fmayer\appdata\local\temp\extract-b83962b6-16dc-4d2f-85ea-11e6c64d15c1mongod.exe

This is a problem with the Windows Firewall, because it means I have to approve a new executable to communicate through the Windows Firewall for every build. In my case it would be better if the maven plugin behaved like the basic Java API, i.e. just use the same name for mongod in each run. That fails the build if mongod was not shut down properly, but it's much easier to deal with under Windows.

Add capability to pass bind_ip address

embed mongo 1.26 (being released tonight) will have the capability to pass bind_ip to the MongoProcess. Can embedmongo-maven-plugin be upgraded to that version and add a parameter to the plugin to support such a configuration?

Socket Timeout Exception when trying to download embedded mongo

Hello all,

I've been getting a timeout issue when running a maven install everytime it tries to install embedded mongo db.

[INFO] --- embedmongo-maven-plugin:0.1.9:start (start) @ unity-platform ---
Oct 31, 2013 4:52:18 PM de.flapdoodle.embed.process.store.ArtifactStoreBuilder build
SEVERE: Build ArtifactStore(useCache:true)
[WARNING] Unrecognised MongoDB version '2.4.4', this might be a new version that we don't yet know about. Attemping download anyway...
Download GenericVersion{2.4.4}:Windows:B64 START
Download GenericVersion{2.4.4}:Windows:B64 DownloadSize: 106026199
Download GenericVersion{2.4.4}:Windows:B64 0% 1% 2% Oct 31, 2013 4:52:31 PM de.flapdoodle.embed.process.runtime.Starter prepare
SEVERE: start
java.net.SocketTimeoutException: Read timed out
        at java.net.SocketInputStream.socketRead0(Native Method)
        at java.net.SocketInputStream.read(SocketInputStream.java:150)
        at java.net.SocketInputStream.read(SocketInputStream.java:121)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at sun.net.www.MeteredStream.read(MeteredStream.java:134)
        at java.io.FilterInputStream.read(FilterInputStream.java:133)
        at sun.net.www.protocol.http.HttpURLConnection$HttpInputStream.read(HttpURLConnection.java:3052)
        at java.io.BufferedInputStream.read1(BufferedInputStream.java:273)
        at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
        at java.io.FilterInputStream.read(FilterInputStream.java:107)
        at de.flapdoodle.embed.process.store.Downloader.download(Downloader.java:87)
        at de.flapdoodle.embed.process.store.ArtifactStore.checkDistribution(ArtifactStore.java:53)
        at de.flapdoodle.embed.process.store.CachingArtifactStore.checkDistribution(CachingArtifactStore.java:54)
        at de.flapdoodle.embed.process.runtime.Starter.prepare(Starter.java:55)
        at com.github.joelittlejohn.embedmongo.StartEmbeddedMongoMojo.execute(StartEmbeddedMongoMojo.java:212)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:601)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)

I am on a windows 7 machine, and the firewall is turned off. I have tried running with -Dembedmongo.bindIp=127.0.0.1, but this doesn't make a difference.

Does anyone have any ideas? I've seen some similar issues reported, but I haven't managed to sort this out on my machine.

Thanks
Stuart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.