{"id":15439513,"url":"https://github.com/joelittlejohn/embedmongo-maven-plugin","last_synced_at":"2025-08-20T10:31:35.243Z","repository":{"id":3447581,"uuid":"4500731","full_name":"joelittlejohn/embedmongo-maven-plugin","owner":"joelittlejohn","description":"Maven plugin wrapper for the flapdoodle.de embedded MongoDB API","archived":false,"fork":false,"pushed_at":"2022-05-24T19:50:45.000Z","size":450,"stargazers_count":88,"open_issues_count":10,"forks_count":51,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-18T11:24:16.559Z","etag":null,"topics":["embedded","integration-testing","java","maven-plugin","mongodb"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joelittlejohn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-05-30T21:23:30.000Z","updated_at":"2024-03-31T14:12:50.000Z","dependencies_parsed_at":"2022-09-26T17:40:40.390Z","dependency_job_id":null,"html_url":"https://github.com/joelittlejohn/embedmongo-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":24,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fembedmongo-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fembedmongo-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fembedmongo-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joelittlejohn%2Fembedmongo-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joelittlejohn","download_url":"https://codeload.github.com/joelittlejohn/embedmongo-maven-plugin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230415317,"owners_count":18222158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded","integration-testing","java","maven-plugin","mongodb"],"created_at":"2024-10-01T19:07:06.112Z","updated_at":"2024-12-19T10:09:00.596Z","avatar_url":"https://github.com/joelittlejohn.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# embedmongo-maven-plugin [![Build Status](https://travis-ci.org/joelittlejohn/embedmongo-maven-plugin.png)](https://travis-ci.org/joelittlejohn/embedmongo-maven-plugin) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/com.github.joelittlejohn.embedmongo/embedmongo-maven-plugin/badge.svg)](https://maven-badges.herokuapp.com/maven-central/com.github.joelittlejohn.embedmongo/embedmongo-maven-plugin)\n\nMaven plugin wrapper for the [flapdoodle.de embedded MongoDB API](http://github.com/flapdoodle-oss/embedmongo.flapdoodle.de).\n\nThis 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.\n\n## Versions\n\n* For Java 8 and later: `\u003cversion\u003e0.4.1\u003c/version\u003e`\n* For Java 6/7: `\u003cversion\u003e0.3.5\u003c/version\u003e`\n\n## Usage\n\n```xml\n\u003cplugin\u003e\n  \u003cgroupId\u003ecom.github.joelittlejohn.embedmongo\u003c/groupId\u003e\n  \u003cartifactId\u003eembedmongo-maven-plugin\u003c/artifactId\u003e\n  \u003cversion\u003e0.4.1\u003c/version\u003e\n  \u003cexecutions\u003e\n    \u003cexecution\u003e\n      \u003cid\u003estart\u003c/id\u003e\n      \u003cgoals\u003e\n        \u003cgoal\u003estart\u003c/goal\u003e\n      \u003c/goals\u003e\n      \u003cconfiguration\u003e\n        \u003cport\u003e37017\u003c/port\u003e\n        \u003c!-- optional, default 27017 --\u003e\n        \n        \u003crandomPort\u003etrue\u003c/randomPort\u003e\n        \u003c!-- optional, default is false, if true allocates a random port and overrides embedmongo.port --\u003e\n        \n        \u003cversion\u003e2.0.4\u003c/version\u003e\n        \u003c!-- optional, default 2.2.1 --\u003e\n        \n        \u003cfeatures\u003eONLY_WITH_SSL, ONLY_WINDOWS_2008_SERVER, NO_HTTP_INTERFACE_ARG\u003c/features\u003e\n        \u003c!-- optional, default is none. Enables flapdoodle.embed.mongo features, for example to build Windows download URLs since 3.6 --\u003e\n        \n        \u003cdatabaseDirectory\u003e/tmp/mongotest\u003c/databaseDirectory\u003e\n        \u003c!-- optional, default is a new dir in java.io.tmpdir --\u003e\n        \n        \u003clogging\u003efile\u003c/logging\u003e\n        \u003c!-- optional (file|console|none), default console --\u003e\n        \n        \u003clogFile\u003e${project.build.directory}/myfile.log\u003c/logFile\u003e\n        \u003c!-- optional, can be used when logging=file, default is ./embedmongo.log --\u003e\n        \n        \u003clogFileEncoding\u003eutf-8\u003c/logFileEncoding\u003e\n        \u003c!-- optional, can be used when logging=file, default is utf-8 --\u003e\n        \n        \u003cbindIp\u003e127.0.0.1\u003c/bindIp\u003e\n        \u003c!-- optional, default is to listen on all interfaces --\u003e\n        \n        \u003cdownloadPath\u003ehttp://internal-mongo-repo/\u003c/downloadPath\u003e\n        \u003c!-- optional, default is http://fastdl.mongodb.org/ --\u003e\n\n        \u003cunixSocketPrefix\u003e${user.home}/.embedmongo\u003c/unixSocketPrefix\u003e\n        \u003c!-- optional, default is /tmp --\u003e\n        \n        \u003cstorageEngine\u003ewiredTiger\u003c/storageEngine\u003e\n        \u003c!--optional, one of wiredTiger or mmapv1 (default is mmapv1) --\u003e\n        \n        \u003cskip\u003efalse\u003c/skip\u003e\n        \u003c!-- optional, skips this plugin entirely, use on the command line like -Dembedmongo.skip --\u003e\n        \n      \u003c/configuration\u003e\n    \u003c/execution\u003e\n    \u003cexecution\u003e\n      \u003cid\u003emongo-scripts\u003c/id\u003e\n      \u003cgoals\u003e\n        \u003cgoal\u003emongo-scripts\u003c/goal\u003e\n      \u003c/goals\u003e\n      \u003cconfiguration\u003e\n        \u003cversion\u003e2.0.4\u003c/version\u003e\n        \u003c!-- optional, default 2.2.1 --\u003e\n\n        \u003cscriptsDirectory\u003e...\u003c/scriptsDirectory\u003e\n        \u003c!-- a directory containing scripts to run --\u003e\n        \n        \u003cscriptCharsetEncoding\u003eUTF-8\u003c/scriptCharsetEncoding\u003e\n        \u003c!-- optional, valid charset encoding for loading the scripts. Uses the underlying charset encoding of the platform if not assigned --\u003e\n        \n        \u003cdatabaseName\u003emydb\u003c/databaseName\u003e\n        \u003c!-- the name of the database to run scripts against --\u003e\n        \n      \u003c/configuration\u003e\n    \u003c/execution\u003e\n    \u003cexecution\u003e\n      \u003cid\u003emongo-import\u003c/id\u003e\n      \u003cgoals\u003e\n        \u003cgoal\u003emongo-import\u003c/goal\u003e\n      \u003c/goals\u003e\n      \u003cconfiguration\u003e\n        \u003cversion\u003e2.0.4\u003c/version\u003e\n        \u003c!-- optional, default 2.2.1 --\u003e\n\n        \u003cdefaultImportDatabase\u003etest\u003c/defaultImportDatabase\u003e\n        \u003c!-- optional, name of the default database to import data --\u003e\n        \n        \u003cparallel\u003efalse\u003c/parallel\u003e\n        \u003c!-- optional, default false, if true it launches in parallel all imports --\u003e\n        \n        \u003cwait\u003efalse\u003c/wait\u003e\n        \u003c!-- optional, default false, if true it will wait forever after it imports the data --\u003e\n        \n        \u003cimports\u003e\n          \u003cimport\u003e\n            \u003cdatabase\u003emy_db\u003c/database\u003e\n            \u003c!-- optional, name of the database, if null it will fallback to defaultImportDatabase --\u003e\n            \n            \u003ccollection\u003ecol\u003c/collection\u003e\n            \u003c!-- optional, collection to import data into (will use \u003cfile\u003e to derive this otherwise) --\u003e\n            \n            \u003cfile\u003eimport_file.json\u003c/file\u003e\n            \u003c!-- required, name of the json file to import --\u003e\n            \n            \u003cupsertOnImport\u003etrue\u003c/upsertOnImport\u003e\n            \u003c!-- optional, default true, if true it will do an upsert on each document imported --\u003e\n            \n            \u003cdropOnImport\u003efalse\u003c/dropOnImport\u003e\n            \u003c!-- optional, default true, if true it will do a drop the collection before starts to import --\u003e\n            \n            \u003ctimeout\u003e20000\u003c/timeout\u003e\n            \u003c!-- optional, default 20000, it will fail if it takes more than this time importing a file (time in millis) --\u003e\n            \n          \u003c/import\u003e\n          \u003c!-- More imports are accepted and it will be executed in strictly order (if parallel is not set) --\u003e\n        \u003c/imports\u003e\n      \u003c/configuration\u003e\n    \u003c/execution\u003e\n    \u003cexecution\u003e\n      \u003cid\u003estop\u003c/id\u003e\n      \u003cgoals\u003e\n        \u003cgoal\u003estop\u003c/goal\u003e\n      \u003c/goals\u003e\n    \u003c/execution\u003e\n  \u003c/executions\u003e\n\u003c/plugin\u003e\n```\n\n## Notes\n\n* 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.\n* If you omit/forget the `stop` goal, any Mongo process spawned by the `start` goal will be stopped when the JVM terminates.\n* 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`.\n  If you're using Jenkins, you can also try the [Port Allocator Plugin](https://wiki.jenkins-ci.org/display/JENKINS/Port+Allocator+Plugin).\n* 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](https://maven.apache.org/settings.html#Proxies).\n* If you're having trouble with Windows firewall rules, try setting the _bindIp_ config property to `127.0.0.1`.\n* 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\n* If you are using a charset encoding to load scripts, refer to the [IANA Charset Registry](http://www.iana.org/assignments/character-sets/character-sets.xhtml).  Accepted charsets are found in the __Preferred MIME Name__ column.\n\n### Copyright © 2012 Joe Littlejohn\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelittlejohn%2Fembedmongo-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoelittlejohn%2Fembedmongo-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoelittlejohn%2Fembedmongo-maven-plugin/lists"}