Skip to content

Commit

Permalink
Merge pull request #5 from funfried/release/0.x
Browse files Browse the repository at this point in the history
Release/0.x
  • Loading branch information
funfried authored Oct 7, 2024
2 parents 6683312 + 28a47b6 commit f4b2ceb
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 11 deletions.
8 changes: 4 additions & 4 deletions 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.2</version>
<version>0.3</version>
<packaging>maven-plugin</packaging>

<developers>
Expand Down Expand Up @@ -97,7 +97,7 @@
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.16.1</version>
<version>2.17.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -242,7 +242,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.5</version>
<version>3.2.7</version>
</plugin>
<plugin>
<groupId>net.revelc.code.formatter</groupId>
Expand Down Expand Up @@ -287,7 +287,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.10.0</version>
<version>3.10.1</version>
<configuration>
<quiet>true</quiet>
<doclint>all,-missing</doclint>
Expand Down
7 changes: 5 additions & 2 deletions src/changes/changes.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
</properties>

<body>
<release version="0.3-SNAPSHOT" date="n/a" description="n/a">
<release version="0.3-SNAPSHOT" date="2024-10-07" description="Bug fix release">
<action dev="bahlef" type="fix">
Missing properties after reinitialization
</action>
</release>

<release version="0.2" date="2024-09-23" description="Maintenance release">
<action dev="bahlef" type="change">
<action dev="bahlef" type="update">
Better stop logic and better detection of running instances
</action>
</release>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,14 @@ public void execute() throws MojoExecutionException {
throw new MojoExecutionException("Failed to reset embedded database", ex);
}

String workDir = project.getProperties().getProperty("zonky.work.directory");
String dataDir = project.getProperties().getProperty("zonky.data.directory");

File workDirFile = new File(workDir);
File dataDirFile = new File(dataDir);

started(pg, workDirFile, dataDirFile);

getLog().info("Embedded postgres database reinitialized");
} else if (AlreadyStartedPolicy.restart.equals(onAlreadyStarted)) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
* @author fbahle
*/
public class MavenProjectUtil {
private MavenProjectUtil() {
}

public static <E extends Object> E getProjectProperty(MavenProject project, List<MavenProject> reactorProjects, String key) {
E value = getProjectProperty(project, key);
if (value == null) {
Expand All @@ -33,13 +36,13 @@ private static <E extends Object> E getProjectProperty(MavenProject project, Str
}

public static void putProjectProperty(MavenProject project, List<MavenProject> reactorProjects, Map<String, Object> properties) {
for (String key : properties.keySet()) {
project.getProperties().put(key, properties.get(key));
for (Map.Entry<String, Object> item : properties.entrySet()) {
project.getProperties().put(item.getKey(), item.getValue());
}

for (MavenProject p : reactorProjects) {
for (String key : properties.keySet()) {
p.getProperties().put(key, properties.get(key));
for (Map.Entry<String, Object> item : properties.entrySet()) {
p.getProperties().put(item.getKey(), item.getValue());
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,13 @@
* @author fbahle
*/
public class ProcessUtil {
private static final Pattern PROCESS_ID_PATTERN = Pattern.compile("([0-9]{1,5}$)");
private static final Pattern PROCESS_ID_PATTERN = Pattern.compile("(\\d{1,5}$)");

public static final long DEFAULT_PROCESS_TIMEOUT = 5000L;

private ProcessUtil() {
}

public static Set<Integer> getProcessIdsByPort(int port) throws IOException, TimeoutException, InterruptedException {
return ProcessUtil.getProcessIdsByPort(port, DEFAULT_PROCESS_TIMEOUT);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
* @author fbahle
*/
public class ZonkyUtil {
private ZonkyUtil() {
}

public static EmbeddedPostgres start(int port, File workingDirectory, File dataDirectory) throws IOException {
return EmbeddedPostgres.builder().setCleanDataDirectory(false).setOverrideWorkingDirectory(workingDirectory).setDataDirectory(dataDirectory).setPort(port).start();
}
Expand Down

0 comments on commit f4b2ceb

Please sign in to comment.