Skip to content

Commit

Permalink
Merge pull request #458 from axonivy/remove-guava
Browse files Browse the repository at this point in the history
Remove guava dependency from project-build-plugin
  • Loading branch information
alexsuter authored Jul 19, 2024
2 parents e5dfaea + c86a60f commit 6db7f83
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 16 deletions.
5 changes: 0 additions & 5 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,6 @@
<version>${maven.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>33.2.1-jre</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/ch/ivyteam/ivy/maven/engine/OsgiRuntime.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;

/**
Expand Down Expand Up @@ -54,7 +52,13 @@ void runThreadWithProperties(Callable<?> function, int timeoutEngineStartInSecon
Map<String, String> properties = createOsgiConfigurationProps();
Map<String, String> 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 {
Expand Down
19 changes: 11 additions & 8 deletions src/test/java/ch/ivyteam/ivy/maven/test/TestStartEngine.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
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;
import org.apache.maven.plugin.MojoExecutionException;
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;
Expand Down Expand Up @@ -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();
}
Expand All @@ -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();
}
Expand All @@ -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();
}
Expand Down

0 comments on commit 6db7f83

Please sign in to comment.