Skip to content

chore: get rid of Plexus DI and more #1851

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
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
134 changes: 72 additions & 62 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
<jnr-jffi.version>1.3.11</jnr-jffi.version>
<jnr-unixsocket.version>0.38.19</jnr-unixsocket.version>
<junit.jupiter.version>5.8.2</junit.jupiter.version>
<maven.version>3.8.1</maven.version>
<maven.version>3.8.8</maven.version>
<minimum.maven.version>3.3.9</minimum.maven.version>
<mockito.version>4.5.1</mockito.version>
<project.build.outputTimestamp>2024-09-29T06:28:50Z</project.build.outputTimestamp>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<surefire.version>3.0.0-M2</surefire.version>
<surefire.version>3.5.2</surefire.version>
<system-stubs.version>2.0.1</system-stubs.version>
<version.assertj-core>3.25.3</version.assertj-core>
<version.sonar-maven-plugin>3.11.0.3922</version.sonar-maven-plugin>
Expand Down Expand Up @@ -144,16 +144,22 @@
<version>2.4.0</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.27.1</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.6</version>
<version>3.17.0</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.1</version>
<version>1.12.0</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -214,18 +220,19 @@
<dependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<exclusions>
<exclusion>
<groupId>org.apache.maven</groupId>
<artifactId>maven-project</artifactId>
</exclusion>
<!-- Doesn't work with guava which contains newer versions of utilities -->
<exclusion>
<groupId>com.google.collections</groupId>
<artifactId>google-collections</artifactId>
</exclusion>
</exclusions>
<version>3.7.1</version>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-filtering</artifactId>
<version>3.4.0</version>
</dependency>

<dependency>
<groupId>org.apache.maven.shared</groupId>
<artifactId>maven-shared-utils</artifactId>
<version>3.4.2</version>
</dependency>

<dependency>
Expand All @@ -237,27 +244,26 @@

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.65</version>
<artifactId>bcpkix-jdk18on</artifactId>
<version>1.79</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-annotations</artifactId>
<version>1.6</version>
<scope>provided</scope>
<artifactId>plexus-interpolation</artifactId>
<version>1.24</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-interpolation</artifactId>
<version>1.24</version>
<artifactId>plexus-utils</artifactId>
<version>4.0.2</version>
</dependency>

<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.0.24</version>
<artifactId>plexus-xml</artifactId>
<version>3.0.1</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -311,7 +317,7 @@
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.32</version>
<version>2.3</version>
</dependency>

<dependency>
Expand All @@ -331,18 +337,41 @@
</dependencies>

<build>

<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/main/resources-filtered</directory>
</resource>
</resources>
<pluginManagement>
<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.4.0</version>
</plugin>

<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<version>3.1.3</version>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>3.2.7</version>
</plugin>

<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>3.1.3</version>
</plugin>

<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.2.0</version>
<version>3.4.2</version>
<configuration>
<archive>
<addMavenDescriptor>true</addMavenDescriptor>
Expand All @@ -352,17 +381,17 @@

<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.2.0</version>
<version>3.11.1</version>
</plugin>

<plugin>
<artifactId>maven-release-plugin</artifactId>
<version>3.0.0-M1</version>
<version>3.1.1</version>
</plugin>

<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.2.0</version>
<version>3.3.1</version>
</plugin>

<plugin>
Expand Down Expand Up @@ -428,18 +457,18 @@

<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<version>3.13.0</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<source>8</source>
<target>8</target>
<compilerArgument>-Xlint:deprecation</compilerArgument>
<showWarnings>true</showWarnings>
</configuration>
</plugin>

<plugin>
<artifactId>maven-plugin-plugin</artifactId>
<version>3.6.0</version>
<version>3.13.1</version>
<configuration>
<goalPrefix>docker</goalPrefix>
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
Expand All @@ -463,24 +492,8 @@

<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
<version>3.3.1</version>
<executions>
<execution>
<id>copy-plexus-resources</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>process-resources</phase>
<configuration>
<outputDirectory>${basedir}/target/filtered-resources/META-INF/plexus</outputDirectory>
<resources>
<resource>
<directory>src/main/resources/META-INF/plexus</directory>
<filtering>true</filtering>
</resource>
</resources>
</configuration>
</execution>
<execution>
<id>copy-asciidoc</id>
<goals>
Expand All @@ -499,18 +512,16 @@
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-component-metadata</artifactId>
<version>2.1.0</version>
<configuration>
<staticMetadataDirectory>${basedir}/target/filtered-resources/META-INF/plexus</staticMetadataDirectory>
</configuration>
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
<version>0.9.0.M3</version>
<executions>
<execution>
<id>index-project</id>
<goals>
<goal>generate-metadata</goal>
<goal>main-index</goal>
<goal>test-index</goal>
</goals>
</execution>
</executions>
Expand Down Expand Up @@ -544,7 +555,6 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<configuration>
<skip>false</skip>
<gpgArguments>
Expand Down
18 changes: 4 additions & 14 deletions src/main/java/io/fabric8/maven/docker/AbstractDockerMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.util.Properties;
import java.util.regex.Matcher;
Expand Down Expand Up @@ -56,11 +56,6 @@
import org.apache.maven.shared.filtering.MavenFileFilter;
import org.apache.maven.shared.filtering.MavenReaderFilter;
import org.apache.maven.shared.utils.logging.MessageUtils;
import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.fusesource.jansi.Ansi;

/**
Expand All @@ -69,7 +64,7 @@
* @author roland
* @since 26.03.14
*/
public abstract class AbstractDockerMojo extends AbstractMojo implements Contextualizable, ConfigHelper.Customizer {
public abstract class AbstractDockerMojo extends AbstractMojo implements ConfigHelper.Customizer {

// Key for indicating that a "start" goal has run
public static final String CONTEXT_KEY_START_CALLED = "CONTEXT_KEY_DOCKER_START_CALLED";
Expand Down Expand Up @@ -256,6 +251,7 @@ public abstract class AbstractDockerMojo extends AbstractMojo implements Context
List<ImageConfiguration> resolvedImages;

// Handler dealing with authentication credentials
@Component
AuthConfigFactory authConfigFactory;

protected AnsiLogger log;
Expand Down Expand Up @@ -482,12 +478,6 @@ protected List<VolumeConfiguration> getVolumes() {

// =================================================================================

@Override
public void contextualize(Context context) throws ContextException {
authConfigFactory = new AuthConfigFactory((PlexusContainer) context.get(PlexusConstants.PLEXUS_KEY));
}

// =================================================================================
protected GavLabel getGavLabel() {
// Label used for this run
return new GavLabel(project.getGroupId(), project.getArtifactId(), project.getVersion());
Expand Down
5 changes: 0 additions & 5 deletions src/main/java/io/fabric8/maven/docker/StopMojo.java
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,6 @@ public void execute() throws MojoExecutionException, MojoFailureException {
// HttpDelete class is not used during start mojo, so we need to load it and initialize it. It is not
// possible to load classes in the shutdown hook as
Class.forName("org.apache.http.client.methods.HttpDelete", true, this.getClass().getClassLoader());

// com.google.common.base.Strings class from com.google.guava is required and it depends on Platforms
// Used in @see io.fabric8.maven.docker.util.ImageNameFormatter
Class.forName("com.google.common.base.Strings", true, this.getClass().getClassLoader());
Class.forName("com.google.common.base.Platform", true, this.getClass().getClassLoader());
} catch (ClassNotFoundException e) {
log.error("Failure in loading org.apache.http.client.methods.HttpDelete class: %s", e.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@
import java.io.*;
import java.util.concurrent.*;

import io.fabric8.maven.docker.util.AnsiLogger;
import io.fabric8.maven.docker.util.Logger;
import org.apache.maven.shared.utils.StringUtils;
import org.codehaus.plexus.util.StringUtils;

/**
* @author roland
Expand Down
Loading
Loading