diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/ExtensibleEnums.java b/api/maven-api-core/src/main/java/org/apache/maven/api/ExtensibleEnums.java index 7843cbef70..b23e85da75 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/ExtensibleEnums.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/ExtensibleEnums.java @@ -18,7 +18,11 @@ */ package org.apache.maven.api; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Objects; +import java.util.Set; abstract class ExtensibleEnums { diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java b/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java index c461ef0ad0..13d9b6d12b 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/Lifecycle.java @@ -18,7 +18,9 @@ */ package org.apache.maven.api; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Optional; import org.apache.maven.api.annotations.Experimental; import org.apache.maven.api.annotations.Immutable; diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/PathScope.java b/api/maven-api-core/src/main/java/org/apache/maven/api/PathScope.java index b32dd3c172..bd8a6f1bf5 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/PathScope.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/PathScope.java @@ -18,7 +18,7 @@ */ package org.apache.maven.api; -import java.util.*; +import java.util.Set; import org.apache.maven.api.annotations.Experimental; import org.apache.maven.api.annotations.Immutable; diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactCoordinateFactoryRequest.java b/api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactCoordinateFactoryRequest.java index 975c2a39bb..3b8a6a459d 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactCoordinateFactoryRequest.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/services/ArtifactCoordinateFactoryRequest.java @@ -177,6 +177,7 @@ public interface ArtifactCoordinateFactoryRequest { private final String type; private final String coordinateString; + @SuppressWarnings("checkstyle:ParameterNumber") DefaultArtifactFactoryRequestArtifact( @Nonnull Session session, String groupId, diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/services/ChecksumAlgorithmService.java b/api/maven-api-core/src/main/java/org/apache/maven/api/services/ChecksumAlgorithmService.java index 51f72d591e..7344cc8d10 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/services/ChecksumAlgorithmService.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/services/ChecksumAlgorithmService.java @@ -18,7 +18,8 @@ */ package org.apache.maven.api.services; -import java.io.*; +import java.io.IOException; +import java.io.InputStream; import java.nio.ByteBuffer; import java.nio.file.Path; import java.util.Collection; diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java b/api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java index dfc7760fc7..9aced53f01 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/services/DependencyResolverRequest.java @@ -360,6 +360,7 @@ public interface DependencyResolverRequest { * @param rootArtifact The root dependency whose transitive dependencies should be collected, may be {@code * null}. */ + @SuppressWarnings("checkstyle:ParameterNumber") DefaultDependencyResolverRequest( @Nonnull Session session, @Nonnull RequestType requestType, diff --git a/api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectManager.java b/api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectManager.java index d4b3847276..e42ce0b3f1 100644 --- a/api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectManager.java +++ b/api/maven-api-core/src/main/java/org/apache/maven/api/services/ProjectManager.java @@ -19,9 +19,17 @@ package org.apache.maven.api.services; import java.nio.file.Path; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Map; +import java.util.Optional; -import org.apache.maven.api.*; +import org.apache.maven.api.Artifact; +import org.apache.maven.api.Project; +import org.apache.maven.api.ProjectScope; +import org.apache.maven.api.RemoteRepository; +import org.apache.maven.api.Service; +import org.apache.maven.api.Session; import org.apache.maven.api.annotations.Experimental; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.annotations.Nullable; diff --git a/api/maven-api-di/src/main/java/org/apache/maven/api/di/Inject.java b/api/maven-api-di/src/main/java/org/apache/maven/api/di/Inject.java index d31a4d11fb..29df0db7b4 100644 --- a/api/maven-api-di/src/main/java/org/apache/maven/api/di/Inject.java +++ b/api/maven-api-di/src/main/java/org/apache/maven/api/di/Inject.java @@ -22,7 +22,9 @@ import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.ElementType.CONSTRUCTOR; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Target({FIELD, CONSTRUCTOR, METHOD}) diff --git a/api/maven-api-di/src/main/java/org/apache/maven/api/di/Named.java b/api/maven-api-di/src/main/java/org/apache/maven/api/di/Named.java index d38dfadc2e..933c375042 100644 --- a/api/maven-api-di/src/main/java/org/apache/maven/api/di/Named.java +++ b/api/maven-api-di/src/main/java/org/apache/maven/api/di/Named.java @@ -21,7 +21,6 @@ package org.apache.maven.api.di; import java.lang.annotation.Documented; import java.lang.annotation.Retention; -import static java.lang.annotation.ElementType.*; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Qualifier diff --git a/api/maven-api-di/src/main/java/org/apache/maven/api/di/Typed.java b/api/maven-api-di/src/main/java/org/apache/maven/api/di/Typed.java index b2c78606c1..d92ba97821 100644 --- a/api/maven-api-di/src/main/java/org/apache/maven/api/di/Typed.java +++ b/api/maven-api-di/src/main/java/org/apache/maven/api/di/Typed.java @@ -22,7 +22,9 @@ import java.lang.annotation.Documented; import java.lang.annotation.Retention; import java.lang.annotation.Target; -import static java.lang.annotation.ElementType.*; +import static java.lang.annotation.ElementType.FIELD; +import static java.lang.annotation.ElementType.METHOD; +import static java.lang.annotation.ElementType.TYPE; import static java.lang.annotation.RetentionPolicy.RUNTIME; @Target({FIELD, METHOD, TYPE}) diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java index 4504376296..df9d911cff 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/AbstractSession.java @@ -60,7 +60,31 @@ import org.apache.maven.api.VersionRange; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.annotations.Nullable; import org.apache.maven.api.model.Repository; -import org.apache.maven.api.services.*; +import org.apache.maven.api.services.ArtifactCoordinateFactory; +import org.apache.maven.api.services.ArtifactDeployer; +import org.apache.maven.api.services.ArtifactDeployerException; +import org.apache.maven.api.services.ArtifactFactory; +import org.apache.maven.api.services.ArtifactInstaller; +import org.apache.maven.api.services.ArtifactInstallerException; +import org.apache.maven.api.services.ArtifactManager; +import org.apache.maven.api.services.ArtifactResolver; +import org.apache.maven.api.services.ArtifactResolverException; +import org.apache.maven.api.services.DependencyCoordinateFactory; +import org.apache.maven.api.services.DependencyResolver; +import org.apache.maven.api.services.DependencyResolverException; +import org.apache.maven.api.services.DependencyResolverRequest; +import org.apache.maven.api.services.LanguageRegistry; +import org.apache.maven.api.services.LocalRepositoryManager; +import org.apache.maven.api.services.Lookup; +import org.apache.maven.api.services.LookupException; +import org.apache.maven.api.services.PackagingRegistry; +import org.apache.maven.api.services.PathScopeRegistry; +import org.apache.maven.api.services.ProjectScopeRegistry; +import org.apache.maven.api.services.RepositoryFactory; +import org.apache.maven.api.services.TypeRegistry; +import org.apache.maven.api.services.VersionParser; +import org.apache.maven.api.services.VersionRangeResolver; +import org.apache.maven.api.services.VersionResolver; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.RepositorySystemSession; diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java index e5f7be518d..83f06eb6d4 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactDeployer.java @@ -29,7 +29,6 @@ import org.apache.maven.api.services.ArtifactDeployer; import org.apache.maven.api.services.ArtifactDeployerException; import org.apache.maven.api.services.ArtifactDeployerRequest; import org.eclipse.aether.deployment.DeployRequest; -import org.eclipse.aether.deployment.DeployResult; import org.eclipse.aether.deployment.DeploymentException; import static org.apache.maven.internal.impl.Utils.nonNull; @@ -52,7 +51,7 @@ public class DefaultArtifactDeployer implements ArtifactDeployer { .setRepository(session.toRepository(repository)) .setArtifacts(session.toArtifacts(artifacts)); - DeployResult result = session.getRepositorySystem().deploy(session.getSession(), deployRequest); + session.getRepositorySystem().deploy(session.getSession(), deployRequest); } catch (DeploymentException e) { throw new ArtifactDeployerException("Unable to deploy artifacts", e); } diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java index d8eafe3aba..edb87b9aba 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultArtifactInstaller.java @@ -27,7 +27,6 @@ import org.apache.maven.api.services.ArtifactInstallerException; import org.apache.maven.api.services.ArtifactInstallerRequest; import org.eclipse.aether.RepositorySystem; import org.eclipse.aether.installation.InstallRequest; -import org.eclipse.aether.installation.InstallResult; import org.eclipse.aether.installation.InstallationException; import static org.apache.maven.internal.impl.Utils.nonNull; @@ -51,7 +50,7 @@ public class DefaultArtifactInstaller implements ArtifactInstaller { InstallRequest installRequest = new InstallRequest().setArtifacts(session.toArtifacts(request.getArtifacts())); - InstallResult result = repositorySystem.install(session.getSession(), installRequest); + repositorySystem.install(session.getSession(), installRequest); } catch (InstallationException e) { throw new ArtifactInstallerException(e.getMessage(), e); } diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java index 1105c2ab5d..df9a8eb436 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultDependencyResolver.java @@ -28,17 +28,26 @@ import java.util.Set; import java.util.function.Predicate; import java.util.stream.Collectors; -import org.apache.maven.api.*; import org.apache.maven.api.Artifact; import org.apache.maven.api.ArtifactCoordinate; import org.apache.maven.api.Dependency; +import org.apache.maven.api.DependencyCoordinate; +import org.apache.maven.api.DependencyScope; import org.apache.maven.api.Node; +import org.apache.maven.api.PathScope; import org.apache.maven.api.PathType; +import org.apache.maven.api.Project; +import org.apache.maven.api.RemoteRepository; import org.apache.maven.api.Session; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.di.Named; import org.apache.maven.api.di.Singleton; -import org.apache.maven.api.services.*; +import org.apache.maven.api.services.ArtifactResolverException; +import org.apache.maven.api.services.DependencyResolver; +import org.apache.maven.api.services.DependencyResolverException; +import org.apache.maven.api.services.DependencyResolverRequest; +import org.apache.maven.api.services.DependencyResolverResult; +import org.apache.maven.api.services.ProjectManager; import org.eclipse.aether.DefaultRepositorySystemSession; import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.collection.CollectRequest; diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultSettingsValidator.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultSettingsValidator.java index 904b62d032..e3cc996c58 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultSettingsValidator.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultSettingsValidator.java @@ -40,6 +40,7 @@ public class DefaultSettingsValidator { private static final String ILLEGAL_REPO_ID_CHARS = "\\/:\"<>|?*"; // ILLEGAL_FS_CHARS + @SuppressWarnings("checkstyle:MethodLength") public void validate(Settings settings, boolean isProjectSettings, List problems) { if (isProjectSettings) { String msgS = "is not supported on project settings."; diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultToolchainsXmlFactory.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultToolchainsXmlFactory.java index 85d626dd0d..e20990bb0f 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultToolchainsXmlFactory.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/DefaultToolchainsXmlFactory.java @@ -27,7 +27,6 @@ import java.util.Objects; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.di.Named; import org.apache.maven.api.di.Singleton; -import org.apache.maven.api.model.InputSource; import org.apache.maven.api.services.xml.ToolchainsXmlFactory; import org.apache.maven.api.services.xml.XmlReaderException; import org.apache.maven.api.services.xml.XmlReaderRequest; @@ -53,10 +52,6 @@ public class DefaultToolchainsXmlFactory implements ToolchainsXmlFactory { throw new IllegalArgumentException("reader or inputStream must be non null"); } try { - InputSource source = null; - if (request.getModelId() != null || request.getLocation() != null) { - source = new InputSource(request.getModelId(), request.getLocation()); - } MavenToolchainsStaxReader xml = new MavenToolchainsStaxReader(); xml.setAddDefaultEntities(request.isAddDefaultEntities()); if (reader != null) { diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementImporter.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementImporter.java index 25258ff1b2..3a407ba089 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementImporter.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementImporter.java @@ -37,7 +37,7 @@ import org.apache.maven.api.services.BuilderProblem.Severity; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblem.Version; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.DependencyManagementImporter; /** * Handles the import of dependency management from other models into the target model. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementInjector.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementInjector.java index b249b828ee..f85a946fa2 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementInjector.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultDependencyManagementInjector.java @@ -32,7 +32,7 @@ import org.apache.maven.api.model.Exclusion; import org.apache.maven.api.model.Model; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.DependencyManagementInjector; /** * Handles injection of dependency management into the model. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInheritanceAssembler.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInheritanceAssembler.java index d00352165f..43d75e184b 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInheritanceAssembler.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultInheritanceAssembler.java @@ -35,7 +35,7 @@ import org.apache.maven.api.model.ReportPlugin; import org.apache.maven.api.model.Reporting; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.InheritanceAssembler; /** * Handles inheritance of model values. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultLifecycleBindingsInjector.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultLifecycleBindingsInjector.java index 3418ef1d1b..73b9e912a7 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultLifecycleBindingsInjector.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultLifecycleBindingsInjector.java @@ -43,7 +43,7 @@ import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblem.Version; import org.apache.maven.api.services.ModelProblemCollector; import org.apache.maven.api.services.PackagingRegistry; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.LifecycleBindingsInjector; /** * Handles injection of plugin executions induced by the lifecycle bindings for a packaging. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java index 079f960f0e..18cc372d85 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelBuilder.java @@ -78,7 +78,25 @@ import org.apache.maven.api.services.ModelTransformerException; import org.apache.maven.api.services.Source; import org.apache.maven.api.services.SuperPomProvider; import org.apache.maven.api.services.VersionParserException; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.DependencyManagementImporter; +import org.apache.maven.api.services.model.DependencyManagementInjector; +import org.apache.maven.api.services.model.InheritanceAssembler; +import org.apache.maven.api.services.model.LifecycleBindingsInjector; +import org.apache.maven.api.services.model.ModelBuildingEvent; +import org.apache.maven.api.services.model.ModelBuildingListener; +import org.apache.maven.api.services.model.ModelInterpolator; +import org.apache.maven.api.services.model.ModelNormalizer; +import org.apache.maven.api.services.model.ModelPathTranslator; +import org.apache.maven.api.services.model.ModelProcessor; +import org.apache.maven.api.services.model.ModelUrlNormalizer; +import org.apache.maven.api.services.model.ModelValidator; +import org.apache.maven.api.services.model.ModelVersionParser; +import org.apache.maven.api.services.model.PluginConfigurationExpander; +import org.apache.maven.api.services.model.PluginManagementInjector; +import org.apache.maven.api.services.model.ProfileActivationContext; +import org.apache.maven.api.services.model.ProfileInjector; +import org.apache.maven.api.services.model.ProfileSelector; +import org.apache.maven.api.services.model.WorkspaceModelResolver; import org.apache.maven.api.services.xml.XmlReaderException; import org.apache.maven.api.services.xml.XmlReaderRequest; import org.apache.maven.internal.impl.resolver.DefaultModelCache; diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelInterpolator.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelInterpolator.java index 04fc7f8a93..53262e4b8a 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelInterpolator.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelInterpolator.java @@ -39,7 +39,10 @@ import org.apache.maven.api.services.BuilderProblem; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblem; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelInterpolator; +import org.apache.maven.api.services.model.PathTranslator; +import org.apache.maven.api.services.model.RootLocator; +import org.apache.maven.api.services.model.UrlNormalizer; import org.apache.maven.model.v4.MavenTransformer; import org.codehaus.plexus.interpolation.AbstractDelegatingValueSource; import org.codehaus.plexus.interpolation.AbstractValueSource; diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelNormalizer.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelNormalizer.java index 714e56e392..ea5c2cfb60 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelNormalizer.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelNormalizer.java @@ -33,7 +33,7 @@ import org.apache.maven.api.model.Model; import org.apache.maven.api.model.Plugin; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelNormalizer; /** * Handles normalization of a model. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelPathTranslator.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelPathTranslator.java index 1d733c5de9..cbf3263b7a 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelPathTranslator.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelPathTranslator.java @@ -32,7 +32,8 @@ import org.apache.maven.api.model.Model; import org.apache.maven.api.model.Reporting; import org.apache.maven.api.model.Resource; import org.apache.maven.api.services.ModelBuilderRequest; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelPathTranslator; +import org.apache.maven.api.services.model.PathTranslator; /** * Resolves relative paths within a model against a specific base directory. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelProcessor.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelProcessor.java index 626c3a903e..784b6931cf 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelProcessor.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelProcessor.java @@ -32,7 +32,7 @@ import org.apache.maven.api.di.Inject; import org.apache.maven.api.di.Named; import org.apache.maven.api.di.Singleton; import org.apache.maven.api.model.Model; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelProcessor; import org.apache.maven.api.services.xml.ModelXmlFactory; import org.apache.maven.api.services.xml.XmlReaderRequest; import org.apache.maven.api.spi.ModelParser; diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelTransformerContext.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelTransformerContext.java index 69415b3483..28c61d962a 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelTransformerContext.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelTransformerContext.java @@ -26,7 +26,7 @@ import java.util.function.Supplier; import org.apache.maven.api.model.Model; import org.apache.maven.api.services.ModelTransformerContext; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelProcessor; /** * diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelValidator.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelValidator.java index 63d356d006..30dab0bd7c 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelValidator.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelValidator.java @@ -68,7 +68,8 @@ import org.apache.maven.api.services.BuilderProblem.Severity; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblem.Version; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelValidator; +import org.apache.maven.api.services.model.ModelVersionProcessor; import org.apache.maven.model.v4.MavenModelVersion; import org.apache.maven.model.v4.MavenTransformer; @@ -294,6 +295,7 @@ public class DefaultModelValidator implements ModelValidator { } @Override + @SuppressWarnings("checkstyle:MethodLength") public void validateFileModel(Model m, ModelBuilderRequest request, ModelProblemCollector problems) { Parent parent = m.getParent(); @@ -632,6 +634,7 @@ public class DefaultModelValidator implements ModelValidator { } @Override + @SuppressWarnings("checkstyle:MethodLength") public void validateEffectiveModel(Model m, ModelBuilderRequest request, ModelProblemCollector problems) { validateStringNotEmpty("modelVersion", problems, Severity.ERROR, Version.BASE, m.getModelVersion(), m); diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelVersionProcessor.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelVersionProcessor.java index 315bd3682c..592d5d1d0b 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelVersionProcessor.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultModelVersionProcessor.java @@ -24,7 +24,7 @@ import java.util.Properties; import org.apache.maven.api.di.Named; import org.apache.maven.api.di.Singleton; import org.apache.maven.api.services.ModelBuilderRequest; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ModelVersionProcessor; /** * Maven default implementation of the {@link ModelVersionProcessor} to support diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultPathTranslator.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultPathTranslator.java index 9991f24336..a10b8c68df 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultPathTranslator.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultPathTranslator.java @@ -23,7 +23,7 @@ import java.nio.file.Path; import org.apache.maven.api.di.Named; import org.apache.maven.api.di.Singleton; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.PathTranslator; /** * Resolves relative paths against a specific base directory. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileActivationContext.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileActivationContext.java index 0482775161..29fda5f401 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileActivationContext.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileActivationContext.java @@ -25,7 +25,7 @@ import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ProfileActivationContext; /** * Describes the environmental context used to determine the activation status of profiles. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileInjector.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileInjector.java index d32ba2b6e4..28ca4384a2 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileInjector.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileInjector.java @@ -41,7 +41,7 @@ import org.apache.maven.api.model.ReportSet; import org.apache.maven.api.model.Reporting; import org.apache.maven.api.services.ModelBuilderRequest; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ProfileInjector; /** * Handles profile injection into the model. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileSelector.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileSelector.java index c15513e1ec..36dc4a9fcd 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileSelector.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultProfileSelector.java @@ -31,7 +31,9 @@ import org.apache.maven.api.model.Profile; import org.apache.maven.api.services.BuilderProblem.Severity; import org.apache.maven.api.services.ModelProblem.Version; import org.apache.maven.api.services.ModelProblemCollector; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ProfileActivationContext; +import org.apache.maven.api.services.model.ProfileActivator; +import org.apache.maven.api.services.model.ProfileSelector; /** * Calculates the active profiles among a given collection of profiles. diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultRootLocator.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultRootLocator.java index c0a28436c2..e50db13f24 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultRootLocator.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/model/DefaultRootLocator.java @@ -28,7 +28,7 @@ import java.nio.file.Files; import java.nio.file.Path; import org.apache.maven.api.di.Named; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.RootLocator; @Named public class DefaultRootLocator implements RootLocator { diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/PluginsMetadataGeneratorFactory.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/PluginsMetadataGeneratorFactory.java index 05bd3bc4c6..dcd0c9dac8 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/PluginsMetadataGeneratorFactory.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/PluginsMetadataGeneratorFactory.java @@ -44,7 +44,6 @@ public class PluginsMetadataGeneratorFactory implements MetadataGeneratorFactory return new PluginsMetadataGenerator(session, request); } - @SuppressWarnings("checkstyle:magicnumber") @Override public float getPriority() { return 10; // G level MD should be deployed as 3rd MD diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/SnapshotMetadataGeneratorFactory.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/SnapshotMetadataGeneratorFactory.java index 5a86824361..3ae1ad5f6a 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/SnapshotMetadataGeneratorFactory.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/SnapshotMetadataGeneratorFactory.java @@ -44,7 +44,6 @@ public class SnapshotMetadataGeneratorFactory implements MetadataGeneratorFactor return new RemoteSnapshotMetadataGenerator(session, request); } - @SuppressWarnings("checkstyle:magicnumber") @Override public float getPriority() { return 30; // GAV level metadata should be deployed 1st MD diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/VersionsMetadataGeneratorFactory.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/VersionsMetadataGeneratorFactory.java index 716113df10..202f2c2e68 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/VersionsMetadataGeneratorFactory.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/VersionsMetadataGeneratorFactory.java @@ -44,7 +44,6 @@ public class VersionsMetadataGeneratorFactory implements MetadataGeneratorFactor return new VersionsMetadataGenerator(session, request); } - @SuppressWarnings("checkstyle:magicnumber") @Override public float getPriority() { return 20; // GA level metadata should be deployed 2nd MD diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/DistributionManagementArtifactRelocationSource.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/DistributionManagementArtifactRelocationSource.java index 419a677718..41e89877dd 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/DistributionManagementArtifactRelocationSource.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/DistributionManagementArtifactRelocationSource.java @@ -43,7 +43,6 @@ import org.slf4j.LoggerFactory; @Singleton @Named(DistributionManagementArtifactRelocationSource.NAME) @Priority(5) -@SuppressWarnings("checkstyle:MagicNumber") public final class DistributionManagementArtifactRelocationSource implements MavenArtifactRelocationSource { public static final String NAME = "distributionManagement"; private static final Logger LOGGER = LoggerFactory.getLogger(DistributionManagementArtifactRelocationSource.class); diff --git a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/UserPropertiesArtifactRelocationSource.java b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/UserPropertiesArtifactRelocationSource.java index ce3700d501..4493ecc5d6 100644 --- a/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/UserPropertiesArtifactRelocationSource.java +++ b/maven-api-impl/src/main/java/org/apache/maven/internal/impl/resolver/relocation/UserPropertiesArtifactRelocationSource.java @@ -47,7 +47,6 @@ import org.slf4j.LoggerFactory; @Singleton @Named(UserPropertiesArtifactRelocationSource.NAME) @Priority(50) -@SuppressWarnings("checkstyle:MagicNumber") public final class UserPropertiesArtifactRelocationSource implements MavenArtifactRelocationSource { public static final String NAME = "userProperties"; private static final Logger LOGGER = LoggerFactory.getLogger(UserPropertiesArtifactRelocationSource.class); diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/ApiRunner.java b/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/ApiRunner.java index 750aa9c084..1899df2f3b 100644 --- a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/ApiRunner.java +++ b/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/ApiRunner.java @@ -50,15 +50,57 @@ import org.apache.maven.api.services.PackagingRegistry; import org.apache.maven.api.services.RepositoryFactory; import org.apache.maven.api.services.SettingsBuilder; import org.apache.maven.api.services.TypeRegistry; -import org.apache.maven.api.services.model.*; +import org.apache.maven.api.services.model.ProfileActivator; import org.apache.maven.api.settings.Settings; import org.apache.maven.api.spi.ModelParser; import org.apache.maven.api.spi.TypeProvider; import org.apache.maven.di.Injector; import org.apache.maven.di.Key; import org.apache.maven.di.impl.DIException; -import org.apache.maven.internal.impl.*; -import org.apache.maven.internal.impl.model.*; +import org.apache.maven.internal.impl.AbstractSession; +import org.apache.maven.internal.impl.DefaultArtifactCoordinateFactory; +import org.apache.maven.internal.impl.DefaultArtifactDeployer; +import org.apache.maven.internal.impl.DefaultArtifactFactory; +import org.apache.maven.internal.impl.DefaultArtifactInstaller; +import org.apache.maven.internal.impl.DefaultArtifactResolver; +import org.apache.maven.internal.impl.DefaultChecksumAlgorithmService; +import org.apache.maven.internal.impl.DefaultDependencyCoordinateFactory; +import org.apache.maven.internal.impl.DefaultDependencyResolver; +import org.apache.maven.internal.impl.DefaultLocalRepositoryManager; +import org.apache.maven.internal.impl.DefaultMessageBuilderFactory; +import org.apache.maven.internal.impl.DefaultModelUrlNormalizer; +import org.apache.maven.internal.impl.DefaultModelVersionParser; +import org.apache.maven.internal.impl.DefaultModelXmlFactory; +import org.apache.maven.internal.impl.DefaultPluginConfigurationExpander; +import org.apache.maven.internal.impl.DefaultRepositoryFactory; +import org.apache.maven.internal.impl.DefaultSettingsBuilder; +import org.apache.maven.internal.impl.DefaultSettingsXmlFactory; +import org.apache.maven.internal.impl.DefaultSuperPomProvider; +import org.apache.maven.internal.impl.DefaultToolchainsBuilder; +import org.apache.maven.internal.impl.DefaultToolchainsXmlFactory; +import org.apache.maven.internal.impl.DefaultTransportProvider; +import org.apache.maven.internal.impl.DefaultUrlNormalizer; +import org.apache.maven.internal.impl.DefaultVersionParser; +import org.apache.maven.internal.impl.ExtensibleEnumRegistries; +import org.apache.maven.internal.impl.InternalSession; +import org.apache.maven.internal.impl.model.BuildModelTransformer; +import org.apache.maven.internal.impl.model.DefaultDependencyManagementImporter; +import org.apache.maven.internal.impl.model.DefaultDependencyManagementInjector; +import org.apache.maven.internal.impl.model.DefaultInheritanceAssembler; +import org.apache.maven.internal.impl.model.DefaultLifecycleBindingsInjector; +import org.apache.maven.internal.impl.model.DefaultModelBuilder; +import org.apache.maven.internal.impl.model.DefaultModelInterpolator; +import org.apache.maven.internal.impl.model.DefaultModelNormalizer; +import org.apache.maven.internal.impl.model.DefaultModelPathTranslator; +import org.apache.maven.internal.impl.model.DefaultModelProcessor; +import org.apache.maven.internal.impl.model.DefaultModelValidator; +import org.apache.maven.internal.impl.model.DefaultModelVersionProcessor; +import org.apache.maven.internal.impl.model.DefaultPathTranslator; +import org.apache.maven.internal.impl.model.DefaultPluginManagementInjector; +import org.apache.maven.internal.impl.model.DefaultProfileInjector; +import org.apache.maven.internal.impl.model.DefaultProfileSelector; +import org.apache.maven.internal.impl.model.DefaultRootLocator; +import org.apache.maven.internal.impl.model.ProfileActivationFilePathInterpolator; import org.apache.maven.internal.impl.resolver.DefaultVersionRangeResolver; import org.apache.maven.internal.impl.resolver.DefaultVersionResolver; import org.apache.maven.internal.impl.resolver.MavenVersionScheme; diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java b/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java index e556174b8a..e49924faeb 100644 --- a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java +++ b/maven-api-impl/src/test/java/org/apache/maven/internal/impl/standalone/RepositorySystemSupplier.java @@ -79,8 +79,34 @@ import org.eclipse.aether.impl.UpdateCheckManager; import org.eclipse.aether.impl.UpdatePolicyAnalyzer; import org.eclipse.aether.impl.VersionRangeResolver; import org.eclipse.aether.impl.VersionResolver; -import org.eclipse.aether.internal.impl.*; +import org.eclipse.aether.internal.impl.DefaultArtifactPredicateFactory; import org.eclipse.aether.internal.impl.DefaultArtifactResolver; +import org.eclipse.aether.internal.impl.DefaultChecksumPolicyProvider; +import org.eclipse.aether.internal.impl.DefaultChecksumProcessor; +import org.eclipse.aether.internal.impl.DefaultDeployer; +import org.eclipse.aether.internal.impl.DefaultInstaller; +import org.eclipse.aether.internal.impl.DefaultLocalPathComposer; +import org.eclipse.aether.internal.impl.DefaultLocalPathPrefixComposerFactory; +import org.eclipse.aether.internal.impl.DefaultLocalRepositoryProvider; +import org.eclipse.aether.internal.impl.DefaultMetadataResolver; +import org.eclipse.aether.internal.impl.DefaultOfflineController; +import org.eclipse.aether.internal.impl.DefaultPathProcessor; +import org.eclipse.aether.internal.impl.DefaultRemoteRepositoryManager; +import org.eclipse.aether.internal.impl.DefaultRepositoryConnectorProvider; +import org.eclipse.aether.internal.impl.DefaultRepositoryEventDispatcher; +import org.eclipse.aether.internal.impl.DefaultRepositoryLayoutProvider; +import org.eclipse.aether.internal.impl.DefaultRepositorySystem; +import org.eclipse.aether.internal.impl.DefaultRepositorySystemLifecycle; +import org.eclipse.aether.internal.impl.DefaultTrackingFileManager; +import org.eclipse.aether.internal.impl.DefaultTransporterProvider; +import org.eclipse.aether.internal.impl.DefaultUpdateCheckManager; +import org.eclipse.aether.internal.impl.DefaultUpdatePolicyAnalyzer; +import org.eclipse.aether.internal.impl.EnhancedLocalRepositoryManagerFactory; +import org.eclipse.aether.internal.impl.LocalPathComposer; +import org.eclipse.aether.internal.impl.LocalPathPrefixComposerFactory; +import org.eclipse.aether.internal.impl.Maven2RepositoryLayoutFactory; +import org.eclipse.aether.internal.impl.SimpleLocalRepositoryManagerFactory; +import org.eclipse.aether.internal.impl.TrackingFileManager; import org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector; import org.eclipse.aether.internal.impl.checksum.Md5ChecksumAlgorithmFactory; import org.eclipse.aether.internal.impl.checksum.Sha1ChecksumAlgorithmFactory; diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java index 44f2615790..09d5227dd6 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/DefaultArtifact.java @@ -19,7 +19,12 @@ package org.apache.maven.artifact; import java.io.File; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; import org.apache.maven.artifact.handler.ArtifactHandler; import org.apache.maven.artifact.metadata.ArtifactMetadata; @@ -90,6 +95,7 @@ public class DefaultArtifact implements Artifact { false); } + @SuppressWarnings("checkstyle:ParameterNumber") public DefaultArtifact( String groupId, String artifactId, diff --git a/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java index 75d9b8a59e..8ab3ddca7b 100644 --- a/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java +++ b/maven-artifact/src/main/java/org/apache/maven/artifact/repository/ArtifactRepositoryPolicy.java @@ -167,7 +167,6 @@ public class ArtifactRepositoryPolicy { } } - @SuppressWarnings("checkstyle:magicnumber") private int ordinalOfUpdatePolicy(String policy) { if (ArtifactRepositoryPolicy.UPDATE_POLICY_DAILY.equals(policy)) { return 1440; diff --git a/maven-bom/pom.xml b/maven-bom/pom.xml index e3941069b6..d89dfa15d6 100644 --- a/maven-bom/pom.xml +++ b/maven-bom/pom.xml @@ -22,7 +22,7 @@ under the License. org.apache apache - 32 + 33 diff --git a/maven-core/src/main/java/org/apache/maven/ReactorReader.java b/maven-core/src/main/java/org/apache/maven/ReactorReader.java index 2c7995bdcf..7cf300263d 100644 --- a/maven-core/src/main/java/org/apache/maven/ReactorReader.java +++ b/maven-core/src/main/java/org/apache/maven/ReactorReader.java @@ -29,7 +29,16 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.nio.file.StandardCopyOption; -import java.util.*; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.concurrent.ConcurrentHashMap; import java.util.stream.Collectors; import java.util.stream.Stream; @@ -515,7 +524,6 @@ class ReactorReader implements MavenWorkspaceReader { public void init(Context context) throws Exception {} @Override - @SuppressWarnings("checkstyle:MissingSwitchDefault") public void onEvent(Object event) throws Exception { if (event instanceof ExecutionEvent) { ReactorReader reactorReader = lookup.lookup(ReactorReader.class); diff --git a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java index a10b03bde1..5d118ff7dd 100644 --- a/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java +++ b/maven-core/src/main/java/org/apache/maven/execution/MavenSession.java @@ -87,7 +87,6 @@ public class MavenSession implements Cloneable { * ({@link PluginDescriptor#getPluginLookupKey()}). Plugin contexts itself are mappings of {@link String} keys to * {@link Object} values. */ - @SuppressWarnings("checkstyle:linelength") private final ConcurrentMap>> pluginContextsByProjectAndPluginKey = new ConcurrentHashMap<>(); diff --git a/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java b/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java index 8b9f1bcbeb..05d1d02bfe 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java +++ b/maven-core/src/main/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactory.java @@ -51,14 +51,21 @@ import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest; import org.apache.maven.settings.crypto.SettingsDecrypter; import org.apache.maven.settings.crypto.SettingsDecryptionResult; import org.codehaus.plexus.configuration.PlexusConfiguration; -import org.eclipse.aether.*; +import org.eclipse.aether.ConfigurationProperties; +import org.eclipse.aether.RepositoryListener; +import org.eclipse.aether.RepositorySystem; +import org.eclipse.aether.RepositorySystemSession; import org.eclipse.aether.RepositorySystemSession.SessionBuilder; import org.eclipse.aether.artifact.Artifact; import org.eclipse.aether.artifact.DefaultArtifact; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.repository.RepositoryPolicy; import org.eclipse.aether.resolution.ResolutionErrorPolicy; -import org.eclipse.aether.util.graph.version.*; +import org.eclipse.aether.util.graph.version.ChainedVersionFilter; +import org.eclipse.aether.util.graph.version.ContextualSnapshotVersionFilter; +import org.eclipse.aether.util.graph.version.HighestVersionFilter; +import org.eclipse.aether.util.graph.version.LowestVersionFilter; +import org.eclipse.aether.util.graph.version.PredicateVersionFilter; import org.eclipse.aether.util.listener.ChainedRepositoryListener; import org.eclipse.aether.util.repository.AuthenticationBuilder; import org.eclipse.aether.util.repository.ChainedLocalRepositoryManager; diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultPluginXmlFactory.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultPluginXmlFactory.java index 71c59cc3a1..ad45224e4c 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultPluginXmlFactory.java +++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultPluginXmlFactory.java @@ -31,7 +31,11 @@ import java.nio.file.Path; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.plugin.descriptor.PluginDescriptor; -import org.apache.maven.api.services.xml.*; +import org.apache.maven.api.services.xml.PluginXmlFactory; +import org.apache.maven.api.services.xml.XmlReaderException; +import org.apache.maven.api.services.xml.XmlReaderRequest; +import org.apache.maven.api.services.xml.XmlWriterException; +import org.apache.maven.api.services.xml.XmlWriterRequest; import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxReader; import org.apache.maven.plugin.descriptor.io.PluginDescriptorStaxWriter; diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java index b3281c8033..7e019f8527 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java +++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProject.java @@ -19,10 +19,21 @@ package org.apache.maven.internal.impl; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Optional; import org.apache.maven.RepositoryUtils; -import org.apache.maven.api.*; +import org.apache.maven.api.Artifact; +import org.apache.maven.api.DependencyCoordinate; +import org.apache.maven.api.DependencyScope; +import org.apache.maven.api.Exclusion; +import org.apache.maven.api.Packaging; +import org.apache.maven.api.Project; +import org.apache.maven.api.Type; +import org.apache.maven.api.VersionConstraint; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.annotations.Nullable; import org.apache.maven.api.model.DependencyManagement; diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java index 79b1fbceea..dcbc347897 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java +++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultProjectManager.java @@ -23,15 +23,25 @@ import javax.inject.Named; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Properties; import java.util.stream.Collectors; import org.apache.maven.RepositoryUtils; -import org.apache.maven.api.*; +import org.apache.maven.api.Artifact; +import org.apache.maven.api.Project; +import org.apache.maven.api.ProjectScope; +import org.apache.maven.api.RemoteRepository; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.di.SessionScoped; import org.apache.maven.api.model.Resource; -import org.apache.maven.api.services.*; +import org.apache.maven.api.services.ArtifactManager; +import org.apache.maven.api.services.ProjectManager; import org.apache.maven.project.MavenProject; import org.eclipse.sisu.Typed; diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java index 1a923a9fe6..cd83f7c449 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java +++ b/maven-core/src/main/java/org/apache/maven/internal/impl/DefaultSession.java @@ -20,11 +20,17 @@ package org.apache.maven.internal.impl; import java.nio.file.Path; import java.time.Instant; -import java.util.*; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import org.apache.maven.RepositoryUtils; -import org.apache.maven.api.*; +import org.apache.maven.api.Project; +import org.apache.maven.api.RemoteRepository; +import org.apache.maven.api.Session; +import org.apache.maven.api.Version; import org.apache.maven.api.annotations.Nonnull; import org.apache.maven.api.annotations.Nullable; import org.apache.maven.api.services.Lookup; diff --git a/maven-core/src/main/java/org/apache/maven/internal/impl/Graph.java b/maven-core/src/main/java/org/apache/maven/internal/impl/Graph.java index 6bbdb51ab8..1f6cef3f0b 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/impl/Graph.java +++ b/maven-core/src/main/java/org/apache/maven/internal/impl/Graph.java @@ -18,9 +18,14 @@ */ package org.apache.maven.internal.impl; -import java.util.*; - -import org.apache.maven.project.CycleDetectedException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; class Graph { private enum DfsState { diff --git a/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/TransformedArtifact.java b/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/TransformedArtifact.java index 78f45c0b46..07e3806d29 100644 --- a/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/TransformedArtifact.java +++ b/maven-core/src/main/java/org/apache/maven/internal/transformation/impl/TransformedArtifact.java @@ -52,6 +52,7 @@ class TransformedArtifact extends DefaultArtifact { private final RepositorySystemSession session; private final AtomicReference sourceState; + @SuppressWarnings("checkstyle:ParameterNumber") TransformedArtifact( DefaultConsumerPomArtifactTransformer defaultConsumerPomArtifactTransformer, MavenProject project, diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java b/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java index a88307459c..d953d9f669 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/Lifecycle.java @@ -18,7 +18,10 @@ */ package org.apache.maven.lifecycle; -import java.util.*; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; import java.util.stream.Collectors; import org.apache.maven.lifecycle.mapping.LifecyclePhase; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java index da62421e1c..e74bbf37f0 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DefaultLifecycleExecutionPlanCalculator.java @@ -24,7 +24,15 @@ import javax.inject.Singleton; import javax.xml.stream.XMLStreamException; import java.io.IOException; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; import org.apache.maven.api.plugin.descriptor.lifecycle.Execution; import org.apache.maven.api.plugin.descriptor.lifecycle.Phase; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java index b467df6bb7..8edda3ea30 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/internal/DependencyContext.java @@ -18,7 +18,9 @@ */ package org.apache.maven.lifecycle.internal; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.TreeSet; import org.apache.maven.project.MavenProject; diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/BomLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/BomLifecycleMappingProvider.java index 3c0e23c7ab..f0af3177fb 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/BomLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/BomLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class BomLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: bom - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "install", "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install", "deploy", "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy" diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java index feef89aac4..c9c559c40d 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EarLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class EarLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: ear - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "generate-resources", "org.apache.maven.plugins:maven-ear-plugin:" + EAR_PLUGIN_VERSION + ":generate-application-xml", diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java index 272d2ad086..4d59bdc03d 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/EjbLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class EjbLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: ejb - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "process-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources", diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java index 455d9b77f8..fb03442129 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/JarLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class JarLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: jar - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "process-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources", diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java index cacbefd182..9315c50793 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/MavenPluginLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class MavenPluginLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: maven-plugin - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "process-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources", diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java index 1f05e9dd21..b29218c6a7 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/PomLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class PomLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: pom - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "install", "org.apache.maven.plugins:maven-install-plugin:" + INSTALL_PLUGIN_VERSION + ":install", "deploy", "org.apache.maven.plugins:maven-deploy-plugin:" + DEPLOY_PLUGIN_VERSION + ":deploy" diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java index 1bcffdebdd..6c2aa18d4e 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/RarLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class RarLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: rar - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "process-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources", diff --git a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java index 976570154b..8d877fe485 100644 --- a/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java +++ b/maven-core/src/main/java/org/apache/maven/lifecycle/providers/packaging/WarLifecycleMappingProvider.java @@ -29,7 +29,6 @@ import javax.inject.Singleton; @Singleton public final class WarLifecycleMappingProvider extends AbstractLifecycleMappingProvider { // START SNIPPET: war - @SuppressWarnings("checkstyle:linelength") private static final String[] BINDINGS = { "process-resources", "org.apache.maven.plugins:maven-resources-plugin:" + RESOURCES_PLUGIN_VERSION + ":resources", diff --git a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java index 44864cea23..908f608cd0 100644 --- a/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java +++ b/maven-core/src/main/java/org/apache/maven/plugin/internal/DefaultMavenPluginManager.java @@ -22,14 +22,23 @@ import javax.inject.Inject; import javax.inject.Named; import javax.inject.Singleton; -import java.io.*; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.IOException; +import java.io.PrintStream; import java.lang.annotation.Annotation; import java.lang.reflect.Field; import java.lang.reflect.ParameterizedType; import java.lang.reflect.Type; import java.nio.file.Files; import java.nio.file.Path; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; import java.util.jar.JarFile; import java.util.stream.Collectors; import java.util.zip.ZipEntry; @@ -749,7 +758,6 @@ public class DefaultMavenPluginManager implements MavenPluginManager { pomConfiguration = XmlPlexusConfiguration.toPlexusConfiguration(dom); } - InternalMavenSession sessionV4 = InternalMavenSession.from(session.getSession()); ExpressionEvaluator expressionEvaluator = new PluginParameterExpressionEvaluator(session, mojoExecution); for (MavenPluginConfigurationValidator validator : configurationValidators) { @@ -1033,7 +1041,6 @@ public class DefaultMavenPluginManager implements MavenPluginManager { return this.value; } - @SuppressWarnings("checkstyle:MagicNumber") public int hashCode() { return 127 * "value".hashCode() ^ this.value.hashCode(); } diff --git a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java index f2f043ee7f..ddd26688bc 100644 --- a/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java +++ b/maven-core/src/main/java/org/apache/maven/project/DefaultProjectBuilder.java @@ -28,8 +28,26 @@ import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.nio.file.Path; -import java.util.*; -import java.util.concurrent.*; +import java.util.AbstractMap; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Properties; +import java.util.Set; +import java.util.concurrent.Callable; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.ExecutionException; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Future; +import java.util.concurrent.LinkedBlockingQueue; +import java.util.concurrent.ThreadPoolExecutor; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; import java.util.concurrent.atomic.AtomicReference; import java.util.function.Consumer; @@ -42,7 +60,16 @@ import org.apache.maven.RepositoryUtils; import org.apache.maven.api.Session; import org.apache.maven.api.SessionData; import org.apache.maven.api.feature.Features; -import org.apache.maven.api.model.*; +import org.apache.maven.api.model.Build; +import org.apache.maven.api.model.Dependency; +import org.apache.maven.api.model.DependencyManagement; +import org.apache.maven.api.model.DeploymentRepository; +import org.apache.maven.api.model.Extension; +import org.apache.maven.api.model.Model; +import org.apache.maven.api.model.Parent; +import org.apache.maven.api.model.Plugin; +import org.apache.maven.api.model.Profile; +import org.apache.maven.api.model.ReportPlugin; import org.apache.maven.api.services.ModelBuilder; import org.apache.maven.api.services.ModelBuilderException; import org.apache.maven.api.services.ModelBuilderRequest; diff --git a/maven-core/src/main/java/org/apache/maven/project/Graph.java b/maven-core/src/main/java/org/apache/maven/project/Graph.java index a0c75cb1b2..6baae1e00c 100644 --- a/maven-core/src/main/java/org/apache/maven/project/Graph.java +++ b/maven-core/src/main/java/org/apache/maven/project/Graph.java @@ -18,7 +18,14 @@ */ package org.apache.maven.project; -import java.util.*; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; class Graph { private enum DfsState { diff --git a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java index 69156e0e60..756d80b7f1 100644 --- a/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java +++ b/maven-core/src/main/java/org/apache/maven/project/ProjectModelResolver.java @@ -88,6 +88,7 @@ public class ProjectModelResolver implements ModelResolver { private final Map> parentCache; + @SuppressWarnings("checkstyle:ParameterNumber") public ProjectModelResolver( RepositorySystemSession session, RequestTrace trace, diff --git a/maven-core/src/main/java/org/apache/maven/resolver/MavenChainedWorkspaceReader.java b/maven-core/src/main/java/org/apache/maven/resolver/MavenChainedWorkspaceReader.java index db384a4b95..73c1dc2726 100644 --- a/maven-core/src/main/java/org/apache/maven/resolver/MavenChainedWorkspaceReader.java +++ b/maven-core/src/main/java/org/apache/maven/resolver/MavenChainedWorkspaceReader.java @@ -19,7 +19,13 @@ package org.apache.maven.resolver; import java.io.File; -import java.util.*; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collection; +import java.util.Collections; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Objects; import java.util.stream.Collectors; import org.apache.maven.api.model.Model; diff --git a/maven-core/src/test/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactoryTest.java b/maven-core/src/test/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactoryTest.java index 0f33b38722..afccfcabec 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactoryTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/aether/DefaultRepositorySystemSessionFactoryTest.java @@ -43,12 +43,20 @@ import org.codehaus.plexus.util.xml.Xpp3Dom; import org.eclipse.aether.ConfigurationProperties; import org.eclipse.aether.collection.VersionFilter; import org.eclipse.aether.repository.RepositoryPolicy; -import org.eclipse.aether.util.graph.version.*; +import org.eclipse.aether.util.graph.version.ChainedVersionFilter; +import org.eclipse.aether.util.graph.version.ContextualSnapshotVersionFilter; +import org.eclipse.aether.util.graph.version.HighestVersionFilter; +import org.eclipse.aether.util.graph.version.LowestVersionFilter; +import org.eclipse.aether.util.graph.version.PredicateVersionFilter; import org.eclipse.aether.version.VersionScheme; import org.junit.jupiter.api.Test; import static org.codehaus.plexus.testing.PlexusExtension.getBasedir; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertThrowsExactly; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * UT for {@link DefaultRepositorySystemSessionFactory}. diff --git a/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java b/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java index 8c4f4c2315..a4530c6226 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java +++ b/maven-core/src/test/java/org/apache/maven/internal/impl/DefaultChecksumAlgorithmServiceTest.java @@ -28,11 +28,16 @@ import java.util.HashMap; import java.util.Map; import org.apache.maven.api.services.ChecksumAlgorithmService; -import org.eclipse.aether.internal.impl.checksum.*; +import org.eclipse.aether.internal.impl.checksum.DefaultChecksumAlgorithmFactorySelector; +import org.eclipse.aether.internal.impl.checksum.Md5ChecksumAlgorithmFactory; +import org.eclipse.aether.internal.impl.checksum.Sha1ChecksumAlgorithmFactory; +import org.eclipse.aether.internal.impl.checksum.Sha256ChecksumAlgorithmFactory; +import org.eclipse.aether.internal.impl.checksum.Sha512ChecksumAlgorithmFactory; import org.eclipse.aether.spi.connector.checksum.ChecksumAlgorithmFactory; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; public class DefaultChecksumAlgorithmServiceTest { private static Map getChecksumAlgorithmFactories() { diff --git a/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java b/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java index cd71428fdb..e2c2fc7709 100644 --- a/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java +++ b/maven-core/src/test/java/org/apache/maven/internal/impl/TestApi.java @@ -31,7 +31,16 @@ import java.util.Objects; import java.util.Optional; import java.util.stream.Collectors; -import org.apache.maven.api.*; +import org.apache.maven.api.Artifact; +import org.apache.maven.api.ArtifactCoordinate; +import org.apache.maven.api.Dependency; +import org.apache.maven.api.DependencyCoordinate; +import org.apache.maven.api.JavaPathType; +import org.apache.maven.api.Node; +import org.apache.maven.api.PathScope; +import org.apache.maven.api.PathType; +import org.apache.maven.api.Project; +import org.apache.maven.api.Session; import org.apache.maven.api.services.DependencyResolver; import org.apache.maven.api.services.DependencyResolverResult; import org.apache.maven.api.services.ProjectBuilder; diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java index 65c0b65570..d7e384211d 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/DefaultLifecyclesStub.java @@ -31,7 +31,22 @@ import org.apache.maven.lifecycle.Lifecycle; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.repository.exception.ComponentLookupException; -import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.*; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.CLEAN; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.COMPILE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.INITIALIZE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.INSTALL; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PACKAGE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.POST_CLEAN; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.POST_SITE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PRE_CLEAN; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PRE_SITE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PROCESS_RESOURCES; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.PROCESS_TEST_RESOURCES; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.SITE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.SITE_DEPLOY; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.TEST; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.VALIDATE; +import static org.apache.maven.lifecycle.internal.stub.LifecycleExecutionPlanCalculatorStub.WRAPPER; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; diff --git a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java index 2c1c0eb244..cc1f88bfc3 100644 --- a/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java +++ b/maven-core/src/test/java/org/apache/maven/lifecycle/internal/stub/LifecycleExecutionPlanCalculatorStub.java @@ -30,7 +30,12 @@ import org.apache.maven.lifecycle.DefaultLifecycles; import org.apache.maven.lifecycle.LifecycleNotFoundException; import org.apache.maven.lifecycle.LifecyclePhaseNotFoundException; import org.apache.maven.lifecycle.MavenExecutionPlan; -import org.apache.maven.lifecycle.internal.*; +import org.apache.maven.lifecycle.internal.DefaultLifecyclePluginAnalyzer; +import org.apache.maven.lifecycle.internal.ExecutionPlanItem; +import org.apache.maven.lifecycle.internal.LifecycleExecutionPlanCalculator; +import org.apache.maven.lifecycle.internal.ProjectBuildList; +import org.apache.maven.lifecycle.internal.ProjectSegment; +import org.apache.maven.lifecycle.internal.Task; import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputSource; import org.apache.maven.model.Plugin; diff --git a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java index d1d62161e1..8deaaa1ae1 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/PluginParameterExpressionEvaluatorV4Test.java @@ -43,7 +43,11 @@ import org.apache.maven.execution.DefaultMavenExecutionRequest; import org.apache.maven.execution.DefaultMavenExecutionResult; import org.apache.maven.execution.MavenExecutionRequest; import org.apache.maven.execution.MavenSession; -import org.apache.maven.internal.impl.*; +import org.apache.maven.internal.impl.DefaultLookup; +import org.apache.maven.internal.impl.DefaultMojoExecution; +import org.apache.maven.internal.impl.DefaultProject; +import org.apache.maven.internal.impl.DefaultSession; +import org.apache.maven.internal.impl.InternalMavenSession; import org.apache.maven.model.Build; import org.apache.maven.model.Model; import org.apache.maven.model.building.DefaultModelBuildingRequest; diff --git a/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java b/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java index 2c68ebbf2d..59bd4dccae 100644 --- a/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java +++ b/maven-core/src/test/java/org/apache/maven/plugin/internal/MavenPluginJavaPrerequisiteCheckerTest.java @@ -21,7 +21,9 @@ package org.apache.maven.plugin.internal; import org.eclipse.aether.util.version.GenericVersionScheme; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; class MavenPluginJavaPrerequisiteCheckerTest { diff --git a/maven-di/src/main/java/org/apache/maven/di/impl/Binding.java b/maven-di/src/main/java/org/apache/maven/di/impl/Binding.java index 1e18932cfe..97e650a4c0 100644 --- a/maven-di/src/main/java/org/apache/maven/di/impl/Binding.java +++ b/maven-di/src/main/java/org/apache/maven/di/impl/Binding.java @@ -19,7 +19,10 @@ package org.apache.maven.di.impl; import java.lang.annotation.Annotation; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.Set; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; diff --git a/maven-di/src/main/java/org/apache/maven/di/impl/BindingInitializer.java b/maven-di/src/main/java/org/apache/maven/di/impl/BindingInitializer.java index 8561db9883..a123f30cbc 100644 --- a/maven-di/src/main/java/org/apache/maven/di/impl/BindingInitializer.java +++ b/maven-di/src/main/java/org/apache/maven/di/impl/BindingInitializer.java @@ -18,7 +18,9 @@ */ package org.apache.maven.di.impl; -import java.util.*; +import java.util.Collection; +import java.util.List; +import java.util.Set; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; diff --git a/maven-di/src/main/java/org/apache/maven/di/impl/InjectorImpl.java b/maven-di/src/main/java/org/apache/maven/di/impl/InjectorImpl.java index a92a5765d3..2edd74f9ca 100644 --- a/maven-di/src/main/java/org/apache/maven/di/impl/InjectorImpl.java +++ b/maven-di/src/main/java/org/apache/maven/di/impl/InjectorImpl.java @@ -26,7 +26,21 @@ import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.lang.reflect.Type; import java.net.URL; -import java.util.*; +import java.util.AbstractList; +import java.util.AbstractMap; +import java.util.AbstractSet; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.Enumeration; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; import java.util.function.Supplier; diff --git a/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java b/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java index 93ec8767dc..4389138e39 100644 --- a/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java +++ b/maven-di/src/main/java/org/apache/maven/di/impl/ReflectionUtils.java @@ -19,8 +19,21 @@ package org.apache.maven.di.impl; import java.lang.annotation.Annotation; -import java.lang.reflect.*; -import java.util.*; +import java.lang.reflect.AnnotatedElement; +import java.lang.reflect.Constructor; +import java.lang.reflect.Executable; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Member; +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; +import java.lang.reflect.Parameter; +import java.lang.reflect.Type; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; import java.util.function.Consumer; import java.util.function.Function; import java.util.function.Supplier; @@ -28,7 +41,10 @@ import java.util.regex.Pattern; import java.util.stream.Stream; import org.apache.maven.api.annotations.Nullable; -import org.apache.maven.api.di.*; +import org.apache.maven.api.di.Inject; +import org.apache.maven.api.di.Named; +import org.apache.maven.api.di.Priority; +import org.apache.maven.api.di.Qualifier; import org.apache.maven.di.Key; import static java.util.stream.Collectors.toList; diff --git a/maven-di/src/main/java/org/apache/maven/di/impl/Types.java b/maven-di/src/main/java/org/apache/maven/di/impl/Types.java index dbe7c4a491..735057b1ca 100644 --- a/maven-di/src/main/java/org/apache/maven/di/impl/Types.java +++ b/maven-di/src/main/java/org/apache/maven/di/impl/Types.java @@ -18,8 +18,20 @@ */ package org.apache.maven.di.impl; -import java.lang.reflect.*; -import java.util.*; +import java.lang.reflect.GenericArrayType; +import java.lang.reflect.ParameterizedType; +import java.lang.reflect.Type; +import java.lang.reflect.TypeVariable; +import java.lang.reflect.WildcardType; +import java.util.ArrayDeque; +import java.util.Arrays; +import java.util.Collections; +import java.util.Deque; +import java.util.HashMap; +import java.util.HashSet; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.function.Function; diff --git a/maven-di/src/test/java/org/apache/maven/di/impl/InjectorImplTest.java b/maven-di/src/test/java/org/apache/maven/di/impl/InjectorImplTest.java index 4611154065..b732fe8f5d 100644 --- a/maven-di/src/test/java/org/apache/maven/di/impl/InjectorImplTest.java +++ b/maven-di/src/test/java/org/apache/maven/di/impl/InjectorImplTest.java @@ -25,13 +25,23 @@ import java.util.List; import java.util.Map; import java.util.concurrent.atomic.AtomicInteger; -import org.apache.maven.api.di.*; +import org.apache.maven.api.di.Inject; +import org.apache.maven.api.di.Named; +import org.apache.maven.api.di.Priority; +import org.apache.maven.api.di.Provides; +import org.apache.maven.api.di.Qualifier; +import org.apache.maven.api.di.Singleton; +import org.apache.maven.api.di.Typed; import org.apache.maven.di.Injector; import org.apache.maven.di.Key; import org.junit.jupiter.api.Test; import static java.lang.annotation.RetentionPolicy.RUNTIME; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertInstanceOf; +import static org.junit.jupiter.api.Assertions.assertNotEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotSame; @SuppressWarnings("unused") public class InjectorImplTest { diff --git a/maven-di/src/test/java/org/apache/maven/di/impl/TypeUtilsTest.java b/maven-di/src/test/java/org/apache/maven/di/impl/TypeUtilsTest.java index d326d41fd7..974b0c4d07 100644 --- a/maven-di/src/test/java/org/apache/maven/di/impl/TypeUtilsTest.java +++ b/maven-di/src/test/java/org/apache/maven/di/impl/TypeUtilsTest.java @@ -19,7 +19,10 @@ package org.apache.maven.di.impl; import java.lang.reflect.Type; -import java.util.*; +import java.util.Arrays; +import java.util.List; +import java.util.Set; +import java.util.TreeSet; import java.util.stream.Collectors; import org.apache.maven.di.Key; diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java index e1fc54ba5f..81ff7000b6 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/CLIManager.java @@ -130,7 +130,7 @@ public class CLIManager { protected Options options; - @SuppressWarnings("checkstyle:linelength") + @SuppressWarnings("checkstyle:MethodLength") public CLIManager() { options = new Options(); options.addOption(Option.builder(Character.toString(HELP)) diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java index 1d1c85e1fd..02974d2d90 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/MavenCli.java @@ -31,8 +31,17 @@ import java.nio.charset.Charset; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.*; +import java.util.ArrayList; +import java.util.Collections; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; import java.util.Map.Entry; +import java.util.Properties; +import java.util.ServiceLoader; +import java.util.Set; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -62,7 +71,10 @@ 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.transfer.*; +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.eventspy.internal.EventSpyDispatcher; import org.apache.maven.exception.DefaultExceptionHandler; import org.apache.maven.exception.ExceptionHandler; diff --git a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/FileSizeFormat.java b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/FileSizeFormat.java index aef6f995c9..29ff04af58 100644 --- a/maven-embedder/src/main/java/org/apache/maven/cli/transfer/FileSizeFormat.java +++ b/maven-embedder/src/main/java/org/apache/maven/cli/transfer/FileSizeFormat.java @@ -121,7 +121,6 @@ public class FileSizeFormat { format(builder, size, unit, false); } - @SuppressWarnings("checkstyle:magicnumber") private void format(StringBuilder builder, long size, ScaleUnit unit, boolean omitSymbol) { if (size < 0L) { throw new IllegalArgumentException("file size cannot be negative: " + size); @@ -153,7 +152,6 @@ public class FileSizeFormat { format(builder, size, unit, false); } - @SuppressWarnings("checkstyle:magicnumber") private void format(MessageBuilder builder, long size, ScaleUnit unit, boolean omitSymbol) { if (size < 0L) { throw new IllegalArgumentException("file size cannot be negative: " + size); diff --git a/maven-embedder/src/main/java/org/fusesource/jansi/Ansi.java b/maven-embedder/src/main/java/org/fusesource/jansi/Ansi.java index c0a9f811fb..d41e251621 100644 --- a/maven-embedder/src/main/java/org/fusesource/jansi/Ansi.java +++ b/maven-embedder/src/main/java/org/fusesource/jansi/Ansi.java @@ -28,7 +28,7 @@ import java.util.ArrayList; * with maven-shared-utils, while Maven has migrated to JLine (into which Jansi has been merged * since JLine 3.25.0). */ -@SuppressWarnings({"checkstyle:MagicNumber", "unused"}) +@SuppressWarnings("unused") public class Ansi implements Appendable { private static final char FIRST_ESC_CHAR = 27; diff --git a/maven-model-builder/pom.xml b/maven-model-builder/pom.xml index 5fc329ecad..d68ba3d725 100644 --- a/maven-model-builder/pom.xml +++ b/maven-model-builder/pom.xml @@ -31,6 +31,11 @@ under the License. Maven Model Builder The effective model builder, with inheritance, profile activation, interpolation, ... + + + FileLength + + org.apache.maven diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/Graph.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/Graph.java index 14656a7e07..69b791a421 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/building/Graph.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/Graph.java @@ -18,7 +18,15 @@ */ package org.apache.maven.model.building; -import java.util.*; +import java.util.Collection; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; +import java.util.LinkedHashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.Map; +import java.util.Set; class Graph { diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java b/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java index 9a102987c7..eee2772287 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/composition/DefaultDependencyManagementImporter.java @@ -21,7 +21,14 @@ package org.apache.maven.model.composition; import javax.inject.Named; import javax.inject.Singleton; -import java.util.*; +import java.util.Collection; +import java.util.HashSet; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.Set; import org.apache.maven.api.model.Dependency; import org.apache.maven.api.model.DependencyManagement; diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileActivationContext.java b/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileActivationContext.java index eeadb3a5cb..06710ef4fe 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileActivationContext.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/profile/DefaultProfileActivationContext.java @@ -25,8 +25,6 @@ import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; -import static java.util.stream.Collectors.toMap; - /** * Describes the environmental context used to determine the activation status of profiles. * diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java index b51bbc22c7..f11407e271 100644 --- a/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java +++ b/maven-model-builder/src/main/java/org/apache/maven/model/validation/DefaultModelValidator.java @@ -297,6 +297,7 @@ public class DefaultModelValidator implements ModelValidator { } @Override + @SuppressWarnings("checkstyle:MethodLength") public void validateFileModel(Model ma, ModelBuildingRequest request, ModelProblemCollector problems) { org.apache.maven.api.model.Model m = ma.getDelegate(); @@ -623,6 +624,7 @@ public class DefaultModelValidator implements ModelValidator { } @Override + @SuppressWarnings("checkstyle:MethodLength") public void validateEffectiveModel(Model ma, ModelBuildingRequest request, ModelProblemCollector problems) { org.apache.maven.api.model.Model m = ma.getDelegate(); diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java index 4c98d88b50..dbcc9dd57b 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/building/DefaultModelBuilderTest.java @@ -30,7 +30,10 @@ import org.apache.maven.model.resolution.ModelResolver; import org.apache.maven.model.resolution.UnresolvableModelException; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; /** */ diff --git a/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivatorTest.java b/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivatorTest.java index 5d982478dd..111cc49a96 100644 --- a/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivatorTest.java +++ b/maven-model-builder/src/test/java/org/apache/maven/model/profile/activation/JdkVersionProfileActivatorTest.java @@ -27,7 +27,9 @@ import org.apache.maven.model.profile.ProfileActivationContext; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Tests {@link JdkVersionProfileActivator}. diff --git a/maven-model/src/test/java/org/apache/maven/model/v4/Xpp3DomPerfTest.java b/maven-model/src/test/java/org/apache/maven/model/v4/Xpp3DomPerfTest.java index e591122d4f..090292cffa 100644 --- a/maven-model/src/test/java/org/apache/maven/model/v4/Xpp3DomPerfTest.java +++ b/maven-model/src/test/java/org/apache/maven/model/v4/Xpp3DomPerfTest.java @@ -30,7 +30,16 @@ import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; import org.apache.maven.api.model.InputSource; -import org.openjdk.jmh.annotations.*; +import org.openjdk.jmh.annotations.Benchmark; +import org.openjdk.jmh.annotations.BenchmarkMode; +import org.openjdk.jmh.annotations.Level; +import org.openjdk.jmh.annotations.Measurement; +import org.openjdk.jmh.annotations.Mode; +import org.openjdk.jmh.annotations.OutputTimeUnit; +import org.openjdk.jmh.annotations.Scope; +import org.openjdk.jmh.annotations.Setup; +import org.openjdk.jmh.annotations.State; +import org.openjdk.jmh.annotations.Warmup; import org.openjdk.jmh.runner.Runner; import org.openjdk.jmh.runner.RunnerException; import org.openjdk.jmh.runner.options.Options; diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java index 004b440c98..ac8478b465 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/DefaultArtifactDescriptorReader.java @@ -79,6 +79,7 @@ public class DefaultArtifactDescriptorReader implements ArtifactDescriptorReader private final ArtifactDescriptorReaderDelegate delegate; @Inject + @SuppressWarnings("checkstyle:ParameterNumber") public DefaultArtifactDescriptorReader( RemoteRepositoryManager remoteRepositoryManager, VersionResolver versionResolver, diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataGeneratorFactory.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataGeneratorFactory.java index d6ccce5921..7c1ebffb34 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataGeneratorFactory.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/PluginsMetadataGeneratorFactory.java @@ -45,7 +45,6 @@ public class PluginsMetadataGeneratorFactory implements MetadataGeneratorFactory return new PluginsMetadataGenerator(session, request); } - @SuppressWarnings("checkstyle:magicnumber") @Override public float getPriority() { return 10; // G level MD should be deployed as 3rd MD diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java index d25fc2da20..c72bdcc60c 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/SnapshotMetadataGeneratorFactory.java @@ -45,7 +45,6 @@ public class SnapshotMetadataGeneratorFactory implements MetadataGeneratorFactor return new RemoteSnapshotMetadataGenerator(session, request); } - @SuppressWarnings("checkstyle:magicnumber") @Override public float getPriority() { return 30; // GAV level metadata should be deployed 1st MD diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java index 77baab2231..53458c75d5 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/VersionsMetadataGeneratorFactory.java @@ -45,7 +45,6 @@ public class VersionsMetadataGeneratorFactory implements MetadataGeneratorFactor return new VersionsMetadataGenerator(session, request); } - @SuppressWarnings("checkstyle:magicnumber") @Override public float getPriority() { return 20; // GA level metadata should be deployed 2nd MD diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/DistributionManagementArtifactRelocationSource.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/DistributionManagementArtifactRelocationSource.java index 80a8a0ad62..fed7cf2301 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/DistributionManagementArtifactRelocationSource.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/DistributionManagementArtifactRelocationSource.java @@ -44,7 +44,6 @@ import org.slf4j.LoggerFactory; @Singleton @Named(DistributionManagementArtifactRelocationSource.NAME) @Priority(5) -@SuppressWarnings("checkstyle:MagicNumber") public final class DistributionManagementArtifactRelocationSource implements MavenArtifactRelocationSource { public static final String NAME = "distributionManagement"; private static final Logger LOGGER = LoggerFactory.getLogger(DistributionManagementArtifactRelocationSource.class); diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/UserPropertiesArtifactRelocationSource.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/UserPropertiesArtifactRelocationSource.java index 70ae05c7db..53afe3703b 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/UserPropertiesArtifactRelocationSource.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/relocation/UserPropertiesArtifactRelocationSource.java @@ -48,7 +48,6 @@ import org.slf4j.LoggerFactory; @Singleton @Named(UserPropertiesArtifactRelocationSource.NAME) @Priority(50) -@SuppressWarnings("checkstyle:MagicNumber") public final class UserPropertiesArtifactRelocationSource implements MavenArtifactRelocationSource { public static final String NAME = "userProperties"; private static final Logger LOGGER = LoggerFactory.getLogger(UserPropertiesArtifactRelocationSource.class); diff --git a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/type/DefaultType.java b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/type/DefaultType.java index 6096267ea1..34cf94020a 100644 --- a/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/type/DefaultType.java +++ b/maven-resolver-provider/src/main/java/org/apache/maven/repository/internal/type/DefaultType.java @@ -18,8 +18,12 @@ */ package org.apache.maven.repository.internal.type; -import java.util.*; +import java.util.Arrays; +import java.util.Collections; +import java.util.HashMap; +import java.util.HashSet; import java.util.Map; +import java.util.Set; import org.apache.maven.api.JavaPathType; import org.apache.maven.api.Language; diff --git a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/AbstractVersionTest.java b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/AbstractVersionTest.java index 78b6b54bfe..a7a568f7d1 100644 --- a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/AbstractVersionTest.java +++ b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/AbstractVersionTest.java @@ -20,7 +20,8 @@ package org.apache.maven.repository.internal; import org.apache.maven.api.Version; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotEquals; /** */ diff --git a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/ModelVersionParserTest.java b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/ModelVersionParserTest.java index ed1e0d1000..86a9e0ba72 100644 --- a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/ModelVersionParserTest.java +++ b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/ModelVersionParserTest.java @@ -24,7 +24,10 @@ import org.apache.maven.api.services.model.ModelVersionParser; import org.eclipse.aether.util.version.GenericVersionScheme; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNull; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; /** */ diff --git a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionRangeTest.java b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionRangeTest.java index 981e6f3af7..bab5e38f2e 100644 --- a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionRangeTest.java +++ b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionRangeTest.java @@ -25,7 +25,10 @@ import org.apache.maven.api.services.model.ModelVersionParser; import org.eclipse.aether.util.version.GenericVersionScheme; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; public class VersionRangeTest { diff --git a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionTest.java b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionTest.java index 273cc339be..58404f5a28 100644 --- a/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionTest.java +++ b/maven-resolver-provider/src/test/java/org/apache/maven/repository/internal/VersionTest.java @@ -31,7 +31,7 @@ import org.eclipse.aether.util.version.GenericVersionScheme; import org.junit.jupiter.api.Test; import static java.util.stream.Collectors.toList; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.fail; /** */ diff --git a/maven-xml-impl/src/main/java/org/apache/maven/internal/xml/ImmutableCollections.java b/maven-xml-impl/src/main/java/org/apache/maven/internal/xml/ImmutableCollections.java index 506424874b..4daeeb51c6 100644 --- a/maven-xml-impl/src/main/java/org/apache/maven/internal/xml/ImmutableCollections.java +++ b/maven-xml-impl/src/main/java/org/apache/maven/internal/xml/ImmutableCollections.java @@ -19,7 +19,19 @@ package org.apache.maven.internal.xml; import java.io.Serializable; -import java.util.*; +import java.util.AbstractList; +import java.util.AbstractMap; +import java.util.AbstractSet; +import java.util.Collection; +import java.util.Comparator; +import java.util.Iterator; +import java.util.List; +import java.util.ListIterator; +import java.util.Map; +import java.util.NoSuchElementException; +import java.util.Properties; +import java.util.RandomAccess; +import java.util.Set; import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; diff --git a/pom.xml b/pom.xml index 2a5b2c8b16..972554010d 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ under the License. org.apache.maven maven-parent - 42 + 43 @@ -663,8 +663,6 @@ under the License. org.codehaus.modello modello-maven-plugin - - 2.4.0 Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file