diff --git a/pom.xml b/pom.xml index 7a1a08a9..c75ab127 100644 --- a/pom.xml +++ b/pom.xml @@ -101,11 +101,6 @@ ${maven.version} provided - - com.google.guava - guava - 33.2.1-jre - org.apache.commons diff --git a/src/main/java/ch/ivyteam/ivy/maven/engine/OsgiRuntime.java b/src/main/java/ch/ivyteam/ivy/maven/engine/OsgiRuntime.java index 949857ab..b0b16983 100644 --- a/src/main/java/ch/ivyteam/ivy/maven/engine/OsgiRuntime.java +++ b/src/main/java/ch/ivyteam/ivy/maven/engine/OsgiRuntime.java @@ -17,8 +17,6 @@ import org.apache.maven.plugin.logging.Log; -import com.google.common.util.concurrent.ThreadFactoryBuilder; - import ch.ivyteam.ivy.maven.engine.EngineClassLoaderFactory.OsgiDir; /** @@ -54,7 +52,13 @@ void runThreadWithProperties(Callable function, int timeoutEngineStartInSecon Map properties = createOsgiConfigurationProps(); Map oldProperties = setSystemProperties(properties); try { - ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("Init Engine Thread").build(); + ThreadFactory threadFactory = new ThreadFactory() { + + @Override + public Thread newThread(Runnable r) { + return new Thread(r, "Init Engine Thread"); + } + }; ExecutorService singleThreadExecutor = Executors.newSingleThreadExecutor(threadFactory); Future result = singleThreadExecutor.submit(function); try { diff --git a/src/test/java/ch/ivyteam/ivy/maven/test/TestStartEngine.java b/src/test/java/ch/ivyteam/ivy/maven/test/TestStartEngine.java index ed23f7c8..9a14307a 100644 --- a/src/test/java/ch/ivyteam/ivy/maven/test/TestStartEngine.java +++ b/src/test/java/ch/ivyteam/ivy/maven/test/TestStartEngine.java @@ -19,6 +19,8 @@ import static org.assertj.core.api.Assertions.assertThat; import java.io.File; +import java.io.IOException; +import java.nio.file.Files; import org.apache.commons.exec.Executor; import org.apache.commons.exec.ShutdownHookProcessDestroyer; @@ -26,8 +28,6 @@ import org.junit.Rule; import org.junit.Test; -import com.google.common.io.Files; - import ch.ivyteam.ivy.maven.BaseEngineProjectMojoTest; import ch.ivyteam.ivy.maven.engine.EngineControl; import ch.ivyteam.ivy.maven.log.LogCollector; @@ -78,12 +78,13 @@ public void testKillEngineOnVmExit() throws Exception { * do not copy 2. If engine * {@link ch.ivyteam.ivy.maven.AbstractEngineMojo#engineCacheDirectory} exists * -> do not copy + * @throws IOException */ @Test - public void startEngine_MODIFY_EXISTING_configuredEngine() throws MojoExecutionException { + public void startEngine_MODIFY_EXISTING_configuredEngine() throws MojoExecutionException, IOException { StartTestEngineMojo mojo = rule.getMojo(); mojo.testEngine = TestEngineLocation.MODIFY_EXISTING; - mojo.engineDirectory = Files.createTempDir(); + mojo.engineDirectory = Files.createTempDirectory("test").toFile(); assertThat(mojo.engineToTarget()).as("MODIFY_EXISTING set and using configured engine do not copy") .isFalse(); } @@ -101,12 +102,13 @@ public void startEngine_MODIFY_EXISTING_cacheEngine() throws MojoExecutionExcept * do copy 2. If engine * {@link ch.ivyteam.ivy.maven.AbstractEngineMojo#engineCacheDirectory} exists * -> do copy + * @throws IOException */ @Test - public void startEngine_COPY_FROM_TEMPLATE_configuredEngine() throws MojoExecutionException { + public void startEngine_COPY_FROM_TEMPLATE_configuredEngine() throws MojoExecutionException, IOException { StartTestEngineMojo mojo = rule.getMojo(); mojo.testEngine = TestEngineLocation.COPY_FROM_TEMPLATE; - mojo.engineDirectory = Files.createTempDir(); + mojo.engineDirectory = Files.createTempDirectory("test").toFile(); assertThat(mojo.engineToTarget()).as("COPY_FROM_TEMPLATE set and using configured engine do copy") .isTrue(); } @@ -124,12 +126,13 @@ public void startEngine_COPY_FROM_TEMPLATE_cacheEngine() throws MojoExecutionExc * do not copy 2. If engine * {@link ch.ivyteam.ivy.maven.AbstractEngineMojo#engineCacheDirectory} exists * -> do copy + * @throws IOException */ @Test - public void startEngine_COPY_FROM_CACHE_configuredEngine() throws MojoExecutionException { + public void startEngine_COPY_FROM_CACHE_configuredEngine() throws MojoExecutionException, IOException { StartTestEngineMojo mojo = rule.getMojo(); mojo.testEngine = TestEngineLocation.COPY_FROM_CACHE; - mojo.engineDirectory = Files.createTempDir(); + mojo.engineDirectory = Files.createTempDirectory("test").toFile(); assertThat(mojo.engineToTarget()).as("COPY_FROM_CACHE set and using configured engine do not copy") .isFalse(); }