diff --git a/pom.xml b/pom.xml
index 1d369af2..effebdce 100644
--- a/pom.xml
+++ b/pom.xml
@@ -119,7 +119,7 @@
commons-io
commons-io
- 2.17.0
+ 2.18.0
net.lingala.zip4j
diff --git a/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/dir/FileLogForwarder.java b/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/dir/FileLogForwarder.java
index 682fb80b..33b74aa4 100644
--- a/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/dir/FileLogForwarder.java
+++ b/src/main/java/ch/ivyteam/ivy/maven/engine/deploy/dir/FileLogForwarder.java
@@ -26,6 +26,7 @@
import org.apache.commons.io.monitor.FileAlterationListenerAdaptor;
import org.apache.commons.io.monitor.FileAlterationMonitor;
import org.apache.commons.io.monitor.FileAlterationObserver;
+import org.apache.commons.io.monitor.FileEntry;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
@@ -55,11 +56,14 @@ public synchronized void activate() throws MojoExecutionException {
IOFileFilter logFilter = FileFilterUtils.and(
FileFilterUtils.fileFileFilter(),
FileFilterUtils.nameFileFilter(engineLog.getFileName().toString()));
- FileAlterationObserver fileObserver = new FileAlterationObserver(engineLog.getParent().toFile(), logFilter);
- fileObserver.addListener(new LogModificationListener());
- monitor = new FileAlterationMonitor(100);
- monitor.addObserver(fileObserver);
try {
+ FileAlterationObserver fileObserver = FileAlterationObserver.builder()
+ .setRootEntry(new FileEntry(engineLog.getParent().toFile()))
+ .setFileFilter(logFilter)
+ .get();
+ fileObserver.addListener(new LogModificationListener());
+ monitor = new FileAlterationMonitor(100);
+ monitor.addObserver(fileObserver);
monitor.start();
} catch (Exception ex) {
throw new MojoExecutionException("Failed to activate deploy log forwarder", ex);