Maven2 compatibility layer providing legacy APIs for Maven3 environment.
—
Runtime information and execution context compatibility for Maven2 patterns, providing version information and runtime details.
Main interface for accessing Maven runtime information.
/**
* Provides runtime information about the Maven installation
* @deprecated Use org.apache.maven.rtinfo.RuntimeInformation instead
*/
@Deprecated
public interface RuntimeInformation {
/**
* Gets the version of the current Maven application
* @return ArtifactVersion representing the Maven version
*/
ArtifactVersion getApplicationVersion();
}Usage Example:
import org.apache.maven.execution.RuntimeInformation;
import org.apache.maven.execution.DefaultRuntimeInformation;
import org.apache.maven.artifact.versioning.ArtifactVersion;
// Create runtime information instance
RuntimeInformation runtimeInfo = new DefaultRuntimeInformation();
// Get Maven version
ArtifactVersion version = runtimeInfo.getApplicationVersion();
System.out.println("Maven version: " + version.toString());Default implementation of the RuntimeInformation interface.
/**
* Default implementation of RuntimeInformation
*/
public class DefaultRuntimeInformation implements RuntimeInformation {
/**
* Gets the version of the current Maven application
* @return ArtifactVersion representing the Maven version
*/
public ArtifactVersion getApplicationVersion();
}This interface is deprecated and maintained only for backward compatibility. New code should use:
// Instead of maven-compat RuntimeInformation
import org.apache.maven.rtinfo.RuntimeInformation;
// Modern approach
@Component
private RuntimeInformation runtimeInfo;The legacy interface follows the Plexus component pattern used in Maven 2.x, while the modern Maven 3.x approach uses standard dependency injection patterns.
Install with Tessl CLI
npx tessl i tessl/maven-org-apache-maven--maven-compat