Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
maven-mongodb-plugin
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
We are moving to Forgejo!
You are on a read-only GitLab instance.
Show more breadcrumbs
Syncleus
maven-mongodb-plugin
Commits
dba09d84
Commit
dba09d84
authored
10 years ago
by
Jeffrey Phillips Freeman
Browse files
Options
Downloads
Patches
Plain Diff
Added replication set support.
parent
e5eb6afc
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java
+13
-6
13 additions, 6 deletions
...va/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java
src/test/resources/example3/pom.xml
+1
-1
1 addition, 1 deletion
src/test/resources/example3/pom.xml
with
14 additions
and
7 deletions
src/main/java/com/syncleus/maven/plugins/mongodb/StartMongoMojo.java
+
13
−
6
View file @
dba09d84
...
@@ -65,7 +65,7 @@ import de.flapdoodle.embed.process.store.IArtifactStore;
...
@@ -65,7 +65,7 @@ import de.flapdoodle.embed.process.store.IArtifactStore;
/**
/**
* When invoked, this goal starts an instance of mongo. The required binaries
* When invoked, this goal starts an instance of mongo. The required binaries
* are downloaded if no mongo release is found in <code>~/.mongo
db
</code>.
* are downloaded if no mongo release is found in <code>~/.
embed
mongo</code>.
*
*
* @goal start
* @goal start
* @phase pre-integration-test
* @phase pre-integration-test
...
@@ -155,7 +155,7 @@ public class StartMongoMojo extends AbstractMojo {
...
@@ -155,7 +155,7 @@ public class StartMongoMojo extends AbstractMojo {
/**
/**
* @parameter expression="${mongodb.logFile}"
* @parameter expression="${mongodb.logFile}"
* default-value="
embed
mongo.log"
* default-value="mongo
db
.log"
* @since 1.0.0
* @since 1.0.0
*/
*/
private
String
logFile
;
private
String
logFile
;
...
@@ -199,6 +199,13 @@ public class StartMongoMojo extends AbstractMojo {
...
@@ -199,6 +199,13 @@ public class StartMongoMojo extends AbstractMojo {
*/
*/
private
boolean
authEnabled
;
private
boolean
authEnabled
;
/**
* Sets a value for the --replSet
*
* @parameter expression="${mongodb.replSet}"
*/
private
String
replSet
;
/**
/**
* The maven project.
* The maven project.
*
*
...
@@ -217,7 +224,7 @@ public class StartMongoMojo extends AbstractMojo {
...
@@ -217,7 +224,7 @@ public class StartMongoMojo extends AbstractMojo {
public
void
execute
()
throws
MojoExecutionException
,
MojoFailureException
{
public
void
execute
()
throws
MojoExecutionException
,
MojoFailureException
{
if
(
skip
)
{
if
(
skip
)
{
getLog
().
debug
(
"skip=true, not starting
embed
mongo"
);
getLog
().
debug
(
"skip=true, not starting mongo
db
"
);
return
;
return
;
}
}
...
@@ -256,7 +263,7 @@ public class StartMongoMojo extends AbstractMojo {
...
@@ -256,7 +263,7 @@ public class StartMongoMojo extends AbstractMojo {
IMongodConfig
config
=
new
MongodConfigBuilder
()
IMongodConfig
config
=
new
MongodConfigBuilder
()
.
version
(
getVersion
()).
net
(
new
Net
(
bindIp
,
port
,
Network
.
localhostIsIPv6
()))
.
version
(
getVersion
()).
net
(
new
Net
(
bindIp
,
port
,
Network
.
localhostIsIPv6
()))
.
replication
(
new
Storage
(
getDataDirectory
(),
null
,
0
))
.
replication
(
new
Storage
(
getDataDirectory
(),
replSet
,
0
))
.
build
();
.
build
();
executable
=
MongodStarter
.
getInstance
(
runtimeConfig
).
prepare
(
config
);
executable
=
MongodStarter
.
getInstance
(
runtimeConfig
).
prepare
(
config
);
...
@@ -289,11 +296,11 @@ public class StartMongoMojo extends AbstractMojo {
...
@@ -289,11 +296,11 @@ public class StartMongoMojo extends AbstractMojo {
/**
/**
* Saves port to the {@link MavenProject#getProperties()} (with the property
* Saves port to the {@link MavenProject#getProperties()} (with the property
* name {@code
embed
mongo.port}) to allow others (plugins, tests, etc) to
* name {@code mongo
db
.port}) to allow others (plugins, tests, etc) to
* find the randomly allocated port.
* find the randomly allocated port.
*/
*/
private
void
savePortToProjectProperties
()
{
private
void
savePortToProjectProperties
()
{
project
.
getProperties
().
put
(
"
embed
mongo.port"
,
String
.
valueOf
(
port
));
project
.
getProperties
().
put
(
"mongo
db
.port"
,
String
.
valueOf
(
port
));
}
}
private
ProcessOutput
getOutputConfig
()
throws
MojoFailureException
{
private
ProcessOutput
getOutputConfig
()
throws
MojoFailureException
{
...
...
This diff is collapsed.
Click to expand it.
src/test/resources/example3/pom.xml
+
1
−
1
View file @
dba09d84
...
@@ -56,7 +56,7 @@
...
@@ -56,7 +56,7 @@
<port>
37017
</port>
<port>
37017
</port>
<databaseDirectory>
/tmp/mongotest
</databaseDirectory>
<databaseDirectory>
/tmp/mongotest
</databaseDirectory>
<logging>
console
</logging>
<logging>
console
</logging>
<version>
v
2.2.0
</version>
<version>
v
3.0.2
</version>
<authEnabled>
true
</authEnabled>
<authEnabled>
true
</authEnabled>
</configuration>
</configuration>
</execution>
</execution>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment