Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Guava dependency from project-build-plugin #458

Merged
merged 1 commit into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading