diff --git a/src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java b/src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java index c61ab8c2fa111941b29ecccf5091c019c32ef53c..fe925b1bbbd78330eab5e576a0c8fde6bc761d6b 100644 --- a/src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java +++ b/src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java @@ -65,7 +65,7 @@ import de.flapdoodle.embed.process.store.IArtifactStore; /** * When invoked, this goal starts an instance of mongo. The required binaries - * are downloaded if no mongo release is found in <code>~/.mongodb</code>. + * are downloaded if no mongo release is found in <code>~/.embedmongo</code>. * * @goal start * @phase pre-integration-test @@ -155,7 +155,7 @@ public class StartMongoMojo extends AbstractMojo { /** * @parameter expression="${mongodb.logFile}" - * default-value="embedmongo.log" + * default-value="mongodb.log" * @since 1.0.0 */ private String logFile; @@ -199,6 +199,13 @@ public class StartMongoMojo extends AbstractMojo { */ private boolean authEnabled; + /** + * Sets a value for the --replSet + * + * @parameter expression="${mongodb.replSet}" + */ + private String replSet; + /** * The maven project. * @@ -217,7 +224,7 @@ public class StartMongoMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { if (skip) { - getLog().debug("skip=true, not starting embedmongo"); + getLog().debug("skip=true, not starting mongodb"); return; } @@ -256,7 +263,7 @@ public class StartMongoMojo extends AbstractMojo { IMongodConfig config = new MongodConfigBuilder() .version(getVersion()).net(new Net(bindIp, port, Network.localhostIsIPv6())) - .replication(new Storage(getDataDirectory(), null, 0)) + .replication(new Storage(getDataDirectory(), replSet, 0)) .build(); executable = MongodStarter.getInstance(runtimeConfig).prepare(config); @@ -289,11 +296,11 @@ public class StartMongoMojo extends AbstractMojo { /** * Saves port to the {@link MavenProject#getProperties()} (with the property - * name {@code embedmongo.port}) to allow others (plugins, tests, etc) to + * name {@code mongodb.port}) to allow others (plugins, tests, etc) to * find the randomly allocated port. */ private void savePortToProjectProperties() { - project.getProperties().put("embedmongo.port", String.valueOf(port)); + project.getProperties().put("mongodb.port", String.valueOf(port)); } private ProcessOutput getOutputConfig() throws MojoFailureException { diff --git a/src/test/resources/example3/pom.xml b/src/test/resources/example3/pom.xml index e224016b6e10e02552c2da15c8b5900205f7aa48..125184af43e66eb3f60987039f6ef565bfcc6831 100644 --- a/src/test/resources/example3/pom.xml +++ b/src/test/resources/example3/pom.xml @@ -56,7 +56,7 @@ <port>37017</port> <databaseDirectory>/tmp/mongotest</databaseDirectory> <logging>console</logging> - <version>v2.2.0</version> + <version>v3.0.2</version> <authEnabled>true</authEnabled> </configuration> </execution>