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

[MNG-8332] Detach CLIng from deprecated Embedder #1882

Merged
merged 10 commits into from
Nov 8, 2024
Merged
34 changes: 5 additions & 29 deletions compat/maven-embedder/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,18 @@ under the License.

<artifactId>maven-embedder</artifactId>

<name>Maven Embedder</name>
<name>Maven Embedder (deprecated)</name>
<description>Maven embeddable component, with CLI and logging support.</description>

<dependencies>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-api-cli</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-cli</artifactId>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-settings</artifactId>
Expand Down Expand Up @@ -183,34 +187,6 @@ under the License.
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
<version>1.2.0</version>
<models>
<model>../../api/maven-api-cli/src/main/mdo/core-extensions.mdo</model>
</models>
<templates>
<template>reader-stax.vm</template>
<template>writer-stax.vm</template>
</templates>
<params>
<param>packageModelV4=org.apache.maven.api.cli.extensions</param>
<param>packageToolV4=org.apache.maven.cli.internal.extension.io</param>
</params>
<velocityBasedir>${project.basedir}/../../src/mdo</velocityBasedir>
</configuration>
<executions>
<execution>
<id>modello</id>
<goals>
<goal>velocity</goal>
<goal>xsd</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

/**
*/
@Deprecated
public class CLIManager {
public static final char ALTERNATE_POM_FILE = 'f';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
* Utility class used to report errors, statistics, application version info, etc.
*
*/
@Deprecated
public final class CLIReportingUtils {
// CHECKSTYLE_OFF: MagicNumber
public static final long MB = 1024 * 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/**
* CleanArgument
*/
@Deprecated
public class CleanArgument {
public static String[] cleanArgs(String[] args) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
/**
* CliRequest
*/
@Deprecated
public class CliRequest {
String[] args;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
import org.apache.maven.model.v4.MavenTransformer;
import org.codehaus.plexus.configuration.PlexusConfiguration;

@Deprecated
public class ExtensionConfigurationModule implements Module {

private final CoreExtensionEntry extension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@
import org.apache.maven.cli.event.DefaultEventSpyContext;
import org.apache.maven.cli.event.ExecutionEventLogger;
import org.apache.maven.cli.internal.BootstrapCoreExtensionManager;
import org.apache.maven.cli.internal.extension.io.CoreExtensionsStaxReader;
import org.apache.maven.cli.logging.Slf4jConfiguration;
import org.apache.maven.cli.logging.Slf4jConfigurationFactory;
import org.apache.maven.cli.logging.Slf4jLoggerManager;
import org.apache.maven.cli.logging.Slf4jStdoutLogger;
import org.apache.maven.cli.props.MavenPropertiesLoader;
import org.apache.maven.cli.transfer.ConsoleMavenTransferListener;
import org.apache.maven.cli.transfer.QuietMavenTransferListener;
import org.apache.maven.cli.transfer.SimplexTransferListener;
import org.apache.maven.cli.transfer.Slf4jMavenTransferListener;
import org.apache.maven.cling.internal.extension.io.CoreExtensionsStaxReader;
import org.apache.maven.cling.logging.Slf4jConfiguration;
import org.apache.maven.cling.logging.Slf4jConfigurationFactory;
import org.apache.maven.cling.logging.Slf4jLoggerManager;
import org.apache.maven.di.Injector;
import org.apache.maven.eventspy.internal.EventSpyDispatcher;
import org.apache.maven.exception.DefaultExceptionHandler;
Expand Down Expand Up @@ -141,6 +141,7 @@

/**
*/
@Deprecated
public class MavenCli {

public static final String MULTIMODULE_PROJECT_DIRECTORY = "maven.multiModuleProjectDirectory";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
/**
* Resolve relative file path against the given base directory
*/
@Deprecated
public class ResolveFile {
public static File resolveFile(File file, String baseDirectory) {
if (file == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
/**
* ConfigurationProcessor
*/
@Deprecated
public interface ConfigurationProcessor {
void process(CliRequest request) throws Exception;
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
*/
@Named(SettingsXmlConfigurationProcessor.HINT)
@Singleton
@Deprecated
public class SettingsXmlConfigurationProcessor implements ConfigurationProcessor {
public static final String HINT = "settings";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
/**
* DefaultEventSpyContext
*/
@Deprecated
public class DefaultEventSpyContext implements EventSpy.Context {

private final Map<String, Object> data = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
* Logs execution events to logger, eventually user-supplied.
*
*/
@Deprecated
public class ExecutionEventLogger extends AbstractExecutionListener {
private static final int MAX_LOG_PREFIX_SIZE = 8; // "[ERROR] "
private static final int PROJECT_STATUS_SUFFIX_SIZE = 20; // "SUCCESS [ 0.000 s]"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@
/**
* BootstrapCoreExtensionManager
*/
@Deprecated
@Named
public class BootstrapCoreExtensionManager {
public static final String STRATEGY_PARENT_FIRST = "parent-first";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
* Exception occurring trying to resolve a plugin.
*
*/
@Deprecated
public class ExtensionResolutionException extends Exception {

private final CoreExtension extension;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/**
* @since 3.1.0
*/
@Deprecated
public class Slf4jStdoutLogger implements Logger {
private static final String ERROR = "[ERROR] ";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
* Enhancement of the standard <code>Properties</code>
* managing the maintain of comments, etc.
*/
@Deprecated
public class MavenProperties extends AbstractMap<String, String> {

/** Constant for the supported comment characters.*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@

import org.apache.maven.internal.impl.model.DefaultInterpolator;

@Deprecated
public class MavenPropertiesLoader {

public static final String INCLUDES_PROPERTY = "${includes}"; // includes
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
/**
* AbstractMavenTransferListener
*/
@Deprecated
public abstract class AbstractMavenTransferListener extends AbstractTransferListener {
public static final String STYLE = ".transfer:-faint";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
* <p>
* This listener is not thread-safe and should be wrapped in the {@link SimplexTransferListener} in a multi-threaded scenario.
*/
@Deprecated
public class ConsoleMavenTransferListener extends AbstractMavenTransferListener {

private final Map<TransferResourceIdentifier, TransferResourceAndSize> transfers = new LinkedHashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* @see <a
* href="https://en.wikipedia.org/wiki/Octet_%28computing%29">https://en.wikipedia.org/wiki/Octet_(computing)</a>
*/
@Deprecated
public class FileSizeFormat {
public enum ScaleUnit {
BYTE {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,5 @@

/**
*/
@Deprecated
public class QuietMavenTransferListener extends AbstractTransferListener {}
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
*
* @since 4.0.0
*/
@Deprecated
public final class SimplexTransferListener extends AbstractTransferListener {
private static final Logger LOGGER = LoggerFactory.getLogger(SimplexTransferListener.class);
private static final int QUEUE_SIZE = 1024;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
/**
* Slf4jMavenTransferListener
*/
@Deprecated
public class Slf4jMavenTransferListener extends AbstractTransferListener {

protected final Logger out;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* The {@link TransferResource} is not immutable and does not implement {@code Objects#equals} and {@code Objects#hashCode} methods,
* making it not very suitable for usage in collections.
*/
@Deprecated
record TransferResourceIdentifier(String repositoryId, String repositoryUrl, String resourceName, @Nullable File file) {
TransferResourceIdentifier(TransferResource resource) {
this(resource.getRepositoryId(), resource.getRepositoryUrl(), resource.getResourceName(), resource.getFile());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
*/
@Singleton
@Priority(10)
@Deprecated
public final class PlexusXmlBeanConverter implements PlexusBeanConverter {
// ----------------------------------------------------------------------
// Constants
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
* with maven-shared-utils, while Maven has migrated to JLine (into which Jansi has been merged
* since JLine 3.25.0).
*/
@Deprecated
@SuppressWarnings("unused")
public class Ansi implements Appendable {

Expand Down
34 changes: 33 additions & 1 deletion impl/maven-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ under the License.
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-embedder</artifactId>
<artifactId>maven-core</artifactId>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down Expand Up @@ -78,6 +78,11 @@ under the License.
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<optional>true</optional>
</dependency>

<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -98,6 +103,33 @@ under the License.
<groupId>org.eclipse.sisu</groupId>
<artifactId>sisu-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.codehaus.modello</groupId>
<artifactId>modello-maven-plugin</artifactId>
<configuration>
<version>1.2.0</version>
<models>
<model>../../api/maven-api-cli/src/main/mdo/core-extensions.mdo</model>
</models>
<templates>
<template>reader-stax.vm</template>
<template>writer-stax.vm</template>
</templates>
<params>
<param>packageModelV4=org.apache.maven.api.cli.extensions</param>
<param>packageToolV4=org.apache.maven.cling.internal.extension.io</param>
</params>
<velocityBasedir>${project.basedir}/../../src/mdo</velocityBasedir>
</configuration>
<executions>
<execution>
<id>modello</id>
<goals>
<goal>velocity</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
Expand Down
Loading