Skip to content

Commit

Permalink
Changed Mojo to not thread safe
Browse files Browse the repository at this point in the history
  • Loading branch information
funfried committed Oct 9, 2024
1 parent cbcd289 commit 15070f5
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

<groupId>de.funfried.maven.plugins</groupId>
<artifactId>zonky-maven-plugin</artifactId>
<version>0.5</version>
<version>0.6</version>
<packaging>maven-plugin</packaging>

<developers>
Expand Down
6 changes: 6 additions & 0 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
</properties>

<body>
<release version="0.6" date="2024-10-09" description="Maintenance release">
<action dev="bahlef" type="update">
Changed Mojo to not thread safe
</action>
</release>

<release version="0.5" date="2024-10-08" description="Feature release">
<action dev="bahlef" type="add">
Added flag to switch between single instance for all multimodule project or an instance for each sub module (which configures the plugin)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
/**
* Goal which starts an embedded postgres database.
*/
@Mojo(name = "start", defaultPhase = LifecyclePhase.INITIALIZE, requiresProject = true, threadSafe = true)
@Mojo(name = "start", defaultPhase = LifecyclePhase.INITIALIZE, requiresProject = true, threadSafe = false)
public class StartEmbeddedPostgresMojo extends AbstractMojo {
/**
* The port on which the database will be accessible. A value less than or equal to 0 means auto detect a free port. The port is available through the property ${zonky.port}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
/**
* Goal which stops the embedded postgres database.
*/
@Mojo(name = "stop", defaultPhase = LifecyclePhase.NONE)
@Mojo(name = "stop", defaultPhase = LifecyclePhase.PRE_CLEAN, threadSafe = false)
public class StopEmbeddedPostgresMojo extends AbstractMojo {
/**
* The maven project.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,14 @@
* @author fbahle
*/
public class MavenProjectUtil {
public static final String PROP_ENABLED = "zonky.required";

public static final String PROP_HOST = "zonky.host";

public static final String PROP_PORT = "zonky.port";

public static final String PROP_CREATE_DATABASE = "zonky.createDatabase";

public static final String PROP_DATABASE = "zonky.database";

public static final String PROP_USERNAME = "zonky.username";
Expand Down Expand Up @@ -52,6 +56,10 @@ public static <E extends Object> E getProjectProperty(MavenProject project, List
}

private static <E extends Object> E getProjectProperty(MavenProject project, String key) {
if (project == null) {
return null;
}

return (E) project.getProperties().get(key);
}

Expand Down

0 comments on commit 15070f5

Please sign in to comment.