From 95c6d291b92a60912e35d5e0f203744ab06b9550 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20=C5=A0irok=C3=BD?= Date: Mon, 26 Dec 2022 19:15:32 +0100 Subject: [PATCH] [MENFORCER-448] Reformat code after upgrade to maven-parent:39 --- .../maven/enforcer/rule/api/EnforcerRuleHelper.java | 4 +++- .../plugins/enforcer/AbstractBanDependencies.java | 1 + .../maven/plugins/enforcer/AbstractRequireFiles.java | 1 + .../enforcer/BanDependencyManagementScope.java | 1 + .../enforcer/BanDuplicatePomDependencyVersions.java | 1 + .../maven/plugins/enforcer/BanDynamicVersions.java | 1 + .../plugins/enforcer/BanTransitiveDependencies.java | 7 ++++--- .../plugins/enforcer/BannedDependenciesBase.java | 3 ++- .../maven/plugins/enforcer/BannedRepositories.java | 1 + .../enforcer/DefaultEnforcementRuleHelper.java | 1 + .../maven/plugins/enforcer/DependencyConvergence.java | 7 ++++--- .../apache/maven/plugins/enforcer/ExternalRules.java | 1 + .../plugins/enforcer/ReactorModuleConvergence.java | 1 + .../maven/plugins/enforcer/RequireActiveProfile.java | 1 + .../enforcer/RequireExplicitDependencyScope.java | 1 + .../maven/plugins/enforcer/RequireFileChecksum.java | 1 + .../maven/plugins/enforcer/RequireFilesSize.java | 1 + .../maven/plugins/enforcer/RequireJavaVendor.java | 1 + .../maven/plugins/enforcer/RequireJavaVersion.java | 1 + .../maven/plugins/enforcer/RequireNoRepositories.java | 1 + .../org/apache/maven/plugins/enforcer/RequireOS.java | 1 + .../maven/plugins/enforcer/RequirePluginVersions.java | 1 + .../maven/plugins/enforcer/RequirePrerequisite.java | 1 + .../plugins/enforcer/RequireProfileIdsExist.java | 1 + .../maven/plugins/enforcer/RequireReleaseDeps.java | 5 +++-- .../maven/plugins/enforcer/RequireSameVersions.java | 1 + .../plugins/enforcer/RequireTextFileChecksum.java | 1 + .../maven/plugins/enforcer/RequireUpperBoundDeps.java | 1 + .../maven/plugins/enforcer/utils/ArtifactMatcher.java | 5 +++-- .../maven/plugins/enforcer/utils/ArtifactUtils.java | 5 +++-- .../plugins/enforcer/utils/DependencyVersionMap.java | 1 + .../plugins/enforcer/utils/EnforcerRuleUtils.java | 1 + .../maven/plugins/enforcer/utils/ParentsVisitor.java | 1 + .../maven/plugins/enforcer/utils/PluginWrapper.java | 1 + .../enforcer/BanDependencyManagementScopeTest.java | 1 + .../enforcer/BanDistributionManagementTest.java | 8 ++++---- .../plugins/enforcer/BannedDependenciesTestSetup.java | 1 + .../maven/plugins/enforcer/EnforcerTestUtils.java | 11 ++++++----- .../apache/maven/plugins/enforcer/MockProject.java | 1 + .../enforcer/ReactorModuleConvergenceTest.java | 9 +++++---- .../plugins/enforcer/RequireActiveProfileTest.java | 9 +++++---- .../plugins/enforcer/RequirePrerequisiteTest.java | 11 ++++++----- .../plugins/enforcer/RequireUpperBoundDepsTest.java | 9 +++++---- .../plugins/enforcer/TestAbstractVersionEnforcer.java | 4 ++-- .../apache/maven/plugins/enforcer/TestAlwaysFail.java | 6 +++--- .../plugins/enforcer/TestBannedDependencies.java | 5 +++-- .../plugins/enforcer/TestBannedRepositories.java | 5 +++-- .../maven/plugins/enforcer/TestEvaluateBeanshell.java | 9 +++++---- .../maven/plugins/enforcer/TestExternalRules.java | 4 ++-- .../maven/plugins/enforcer/TestMavenVersion.java | 5 +++-- .../enforcer/TestRequireEnvironmentVariable.java | 4 ++-- .../plugins/enforcer/TestRequireFileChecksum.java | 7 ++++--- .../plugins/enforcer/TestRequireFilesDontExist.java | 5 +++-- .../maven/plugins/enforcer/TestRequireFilesExist.java | 5 +++-- .../maven/plugins/enforcer/TestRequireFilesSize.java | 5 +++-- .../maven/plugins/enforcer/TestRequireJavaVendor.java | 9 +++++---- .../plugins/enforcer/TestRequireJavaVersion.java | 7 ++++--- .../plugins/enforcer/TestRequireNoRepositories.java | 9 +++++---- .../apache/maven/plugins/enforcer/TestRequireOS.java | 9 +++++---- .../plugins/enforcer/TestRequirePluginVersions.java | 5 +++-- .../maven/plugins/enforcer/TestRequireProperty.java | 4 ++-- .../plugins/enforcer/TestRequireReleaseDeps.java | 5 +++-- .../plugins/enforcer/TestRequireReleaseVersion.java | 7 ++++--- .../plugins/enforcer/TestRequireSnapshotVersion.java | 1 + .../plugins/enforcer/TestRequireTextFileChecksum.java | 1 + .../enforcer/utils/EnforcerRuleUtilsHelper.java | 4 ++-- .../plugins/enforcer/utils/TestArtifactMatcher.java | 7 ++++--- .../utils/TestMockEnforcerExpressionEvaluator.java | 6 +++--- .../utils/TestNormalizeLineSeparatorReader.java | 5 +++-- maven-enforcer-extension/pom.xml | 2 +- .../maven/extensions/enforcer/EnforceExtension.java | 4 +++- maven-enforcer-plugin/pom.xml | 2 +- .../apache/maven/plugins/enforcer/EnforceMojo.java | 1 + .../enforcer/TestDefaultEnforcementRuleHelper.java | 4 ++-- .../maven/plugins/enforcer/TestEnforceMojo.java | 4 ++-- pom.xml | 2 +- 76 files changed, 175 insertions(+), 110 deletions(-) diff --git a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java index af99471b..e931c73b 100644 --- a/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java +++ b/enforcer-api/src/main/java/org/apache/maven/enforcer/rule/api/EnforcerRuleHelper.java @@ -18,10 +18,12 @@ */ package org.apache.maven.enforcer.rule.api; +import javax.annotation.Nonnull; + import java.util.List; import java.util.Map; import java.util.function.Supplier; -import javax.annotation.Nonnull; + import org.apache.maven.plugin.logging.Log; import org.codehaus.plexus.PlexusContainer; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluator; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java index 9701a11d..5e5461f6 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractBanDependencies.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.util.Set; + import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java index 43e04294..2bf704db 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/AbstractRequireFiles.java @@ -21,6 +21,7 @@ import java.io.File; import java.util.ArrayList; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java index bdfb0812..89a7b332 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScope.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; + import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.enforcer.rule.api.EnforcerRule2; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java index 129eb651..3eeaac1a 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDuplicatePomDependencyVersions.java @@ -25,6 +25,7 @@ import java.util.List; import java.util.Map; import java.util.Set; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Dependency; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java index 4c467814..2212fb6e 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanDynamicVersions.java @@ -28,6 +28,7 @@ import java.util.Objects; import java.util.function.Predicate; import java.util.stream.Collectors; + import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java index 799fb6f9..3bc5de0a 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BanTransitiveDependencies.java @@ -18,12 +18,11 @@ */ package org.apache.maven.plugins.enforcer; -import static java.util.Optional.ofNullable; - -import com.google.common.base.Strings; import java.util.List; import java.util.Set; import java.util.stream.Collectors; + +import com.google.common.base.Strings; import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.enforcer.rule.api.EnforcerRule; @@ -37,6 +36,8 @@ import org.eclipse.aether.graph.Dependency; import org.eclipse.aether.graph.DependencyNode; +import static java.util.Optional.ofNullable; + /** * This rule bans all transitive dependencies. There is a configuration option to exclude certain artifacts from being * checked. diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java index 32402f7c..3bd87608 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedDependenciesBase.java @@ -18,8 +18,9 @@ */ package org.apache.maven.plugins.enforcer; -import com.google.common.base.Strings; import java.util.List; + +import com.google.common.base.Strings; import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java index a9a1dbe0..bb5b50c8 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/BannedRepositories.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; + import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java index 8306be15..a9f79f12 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DefaultEnforcementRuleHelper.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.function.Supplier; + import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.logging.Log; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java index 1cd29a61..12149302 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/DependencyConvergence.java @@ -18,12 +18,10 @@ */ package org.apache.maven.plugins.enforcer; -import static org.apache.maven.artifact.Artifact.SCOPE_PROVIDED; -import static org.apache.maven.artifact.Artifact.SCOPE_TEST; - import java.util.ArrayList; import java.util.Collections; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; @@ -36,6 +34,9 @@ import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.util.graph.selector.ExclusionDependencySelector; +import static org.apache.maven.artifact.Artifact.SCOPE_PROVIDED; +import static org.apache.maven.artifact.Artifact.SCOPE_TEST; + /** * @author Rex Hoffman */ diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java index 280d1055..b6e39e43 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ExternalRules.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; + import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java index 6a939406..e1e20824 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergence.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.Map; import java.util.Map.Entry; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java index 69d55b58..b804d584 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireActiveProfile.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Map; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.project.MavenProject; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java index 7a72b048..e3cea880 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireExplicitDependencyScope.java @@ -20,6 +20,7 @@ import java.text.ChoiceFormat; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerLevel; import org.apache.maven.enforcer.rule.api.EnforcerRule2; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java index b1b0f97d..c2a9379c 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFileChecksum.java @@ -22,6 +22,7 @@ import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; + import org.apache.commons.codec.digest.DigestUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java index 25a8ca18..72679c15 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireFilesSize.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.io.File; + import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java index f771dd49..022f7fb6 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVendor.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.util.List; + import org.apache.commons.lang3.SystemUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java index c682cc67..dc8799ce 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireJavaVersion.java @@ -23,6 +23,7 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; + import org.apache.commons.lang3.SystemUtils; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java index 3d22d79c..8e58777e 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireNoRepositories.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.Collections; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java index a8d8bb34..7f620db9 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireOS.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.util.Iterator; + import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java index c3b82200..2b76b9ab 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePluginVersions.java @@ -27,6 +27,7 @@ import java.util.List; import java.util.Map; import java.util.Set; + import org.apache.maven.BuildFailureException; import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java index fd5d9c1f..255bf28c 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequirePrerequisite.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.util.List; + import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.artifact.versioning.VersionRange; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java index 3ac1679c..d58e6387 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireProfileIdsExist.java @@ -20,6 +20,7 @@ import java.util.ArrayList; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java index abbb0d0c..71305da4 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireReleaseDeps.java @@ -18,10 +18,9 @@ */ package org.apache.maven.plugins.enforcer; -import static java.util.Optional.ofNullable; - import java.util.HashSet; import java.util.Set; + import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; @@ -29,6 +28,8 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; +import static java.util.Optional.ofNullable; + /** * This rule checks that no snapshots are included. * diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java index 251010d0..c3c8a3d5 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireSameVersions.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Set; import java.util.regex.Pattern; + import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireTextFileChecksum.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireTextFileChecksum.java index 15613983..7d3a31ee 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireTextFileChecksum.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireTextFileChecksum.java @@ -23,6 +23,7 @@ import java.io.Reader; import java.nio.charset.Charset; import java.nio.file.Files; + import org.apache.commons.io.input.ReaderInputStream; import org.apache.commons.lang3.StringUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java index dfc5e2c5..9369743a 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDeps.java @@ -23,6 +23,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java index ba96fc97..cbc9d640 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactMatcher.java @@ -18,12 +18,11 @@ */ package org.apache.maven.plugins.enforcer.utils; -import static java.util.Optional.ofNullable; - import java.util.Collection; import java.util.HashSet; import java.util.Objects; import java.util.function.Function; + import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; @@ -32,6 +31,8 @@ import org.apache.maven.plugins.enforcer.AbstractVersionEnforcer; import org.codehaus.plexus.util.StringUtils; +import static java.util.Optional.ofNullable; + /** * This class is used for matching Artifacts against a list of patterns. * diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactUtils.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactUtils.java index 7ab90d29..c5c09bd6 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactUtils.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ArtifactUtils.java @@ -18,12 +18,11 @@ */ package org.apache.maven.plugins.enforcer.utils; -import static java.util.Optional.ofNullable; - import java.util.Collection; import java.util.HashSet; import java.util.Set; import java.util.stream.Collectors; + import org.apache.commons.lang3.StringUtils; import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.Artifact; @@ -47,6 +46,8 @@ import org.eclipse.aether.util.graph.selector.AndDependencySelector; import org.eclipse.aether.util.graph.transformer.ConflictResolver; +import static java.util.Optional.ofNullable; + /** * * @author Robert Scholte diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java index 959b4878..858d390a 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/DependencyVersionMap.java @@ -22,6 +22,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; + import org.apache.commons.lang3.StringUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.logging.Log; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java index f8b854c0..22839245 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtils.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer.utils; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Plugin; import org.apache.maven.model.ReportPlugin; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ParentsVisitor.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ParentsVisitor.java index 98e10f06..0e9bd9ea 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ParentsVisitor.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/ParentsVisitor.java @@ -21,6 +21,7 @@ import java.util.HashMap; import java.util.Map; import java.util.Stack; + import org.eclipse.aether.graph.DependencyNode; import org.eclipse.aether.graph.DependencyVisitor; diff --git a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java index d5a0320f..e1d8e51a 100644 --- a/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java +++ b/enforcer-rules/src/main/java/org/apache/maven/plugins/enforcer/utils/PluginWrapper.java @@ -21,6 +21,7 @@ import java.util.ArrayList; import java.util.List; import java.util.Optional; + import org.apache.maven.model.InputLocation; import org.apache.maven.model.InputLocationTracker; import org.apache.maven.model.Plugin; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScopeTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScopeTest.java index f33d0ec9..7b08d69f 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScopeTest.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDependencyManagementScopeTest.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.util.Collections; + import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.model.Dependency; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java index 56da6f24..d17a0712 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BanDistributionManagementTest.java @@ -18,10 +18,6 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.DeploymentRepository; @@ -33,6 +29,10 @@ import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * This class is intended to test the {@link BanDistributionManagement} rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BannedDependenciesTestSetup.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BannedDependenciesTestSetup.java index 7d218620..55d40be0 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BannedDependenciesTestSetup.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/BannedDependenciesTestSetup.java @@ -21,6 +21,7 @@ import java.io.IOException; import java.util.ArrayList; import java.util.List; + import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/EnforcerTestUtils.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/EnforcerTestUtils.java index c8876472..14f5e1cd 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/EnforcerTestUtils.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/EnforcerTestUtils.java @@ -18,12 +18,8 @@ */ package org.apache.maven.plugins.enforcer; -import static java.util.Arrays.asList; -import static org.mockito.Mockito.any; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.Properties; + import org.apache.maven.RepositoryUtils; import org.apache.maven.artifact.handler.DefaultArtifactHandler; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; @@ -53,6 +49,11 @@ import org.eclipse.aether.graph.DefaultDependencyNode; import org.eclipse.aether.graph.DependencyNode; +import static java.util.Arrays.asList; +import static org.mockito.Mockito.any; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * The Class EnforcerTestUtils. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockProject.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockProject.java index 7952f5fb..475ffa7a 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockProject.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/MockProject.java @@ -26,6 +26,7 @@ import java.util.Map; import java.util.Properties; import java.util.Set; + import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.artifact.factory.ArtifactFactory; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergenceTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergenceTest.java index 7c64270e..365661e8 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergenceTest.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/ReactorModuleConvergenceTest.java @@ -18,13 +18,10 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.Arrays; import java.util.Collections; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; @@ -36,6 +33,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * Check reactorModuleConvergence rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireActiveProfileTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireActiveProfileTest.java index 940c2b2f..6046f908 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireActiveProfileTest.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireActiveProfileTest.java @@ -18,14 +18,11 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Map; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.project.MavenProject; @@ -33,6 +30,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * Check the profile rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java index 4d2b2b89..da1dcc4c 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequirePrerequisiteTest.java @@ -18,12 +18,8 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.verify; -import static org.mockito.Mockito.when; - import java.util.Collections; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Prerequisites; @@ -33,6 +29,11 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; +import static org.mockito.Mockito.when; + public class RequirePrerequisiteTest { private MavenProject project; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDepsTest.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDepsTest.java index 004ae5c1..4963aac7 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDepsTest.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/RequireUpperBoundDepsTest.java @@ -18,16 +18,17 @@ */ package org.apache.maven.plugins.enforcer; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.containsString; -import static org.junit.jupiter.api.Assertions.fail; - import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.containsString; +import static org.junit.jupiter.api.Assertions.fail; + public class RequireUpperBoundDepsTest { @Test diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAbstractVersionEnforcer.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAbstractVersionEnforcer.java index 90e5d947..f6aba622 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAbstractVersionEnforcer.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAbstractVersionEnforcer.java @@ -18,8 +18,6 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; - import org.apache.maven.artifact.versioning.ArtifactVersion; import org.apache.maven.artifact.versioning.DefaultArtifactVersion; import org.apache.maven.artifact.versioning.InvalidVersionSpecificationException; @@ -29,6 +27,8 @@ import org.apache.maven.plugin.logging.SystemStreamLog; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + /** * The Class TestAbstractVersionEnforcer. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysFail.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysFail.java index d7b92ddb..f458dc32 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysFail.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestAlwaysFail.java @@ -18,12 +18,12 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertNotNull; -import static org.junit.jupiter.api.Assertions.fail; - import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.fail; + /** * Test AlwaysFail rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedDependencies.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedDependencies.java index 49f5df26..6fd89ec3 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedDependencies.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedDependencies.java @@ -18,13 +18,14 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; - import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertThrows; + /** * The Class TestBannedDependencies. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedRepositories.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedRepositories.java index fa3b2da7..4b8bb0ca 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedRepositories.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestBannedRepositories.java @@ -18,10 +18,9 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.fail; - import java.util.ArrayList; import java.util.List; + import org.apache.maven.artifact.repository.ArtifactRepository; import org.apache.maven.artifact.repository.MavenArtifactRepository; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; @@ -29,6 +28,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; + /** * Test the "banned repositories" rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java index 5ba1a754..214201eb 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestEvaluateBeanshell.java @@ -18,10 +18,6 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.ArrayList; import java.util.Collections; import java.util.List; @@ -29,6 +25,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.TimeUnit; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; @@ -36,6 +33,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * The Class TestEvaluateBeanshell. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestExternalRules.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestExternalRules.java index e07b735e..fae828dd 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestExternalRules.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestExternalRules.java @@ -18,12 +18,12 @@ */ package org.apache.maven.plugins.enforcer; -import static org.assertj.core.api.Assertions.assertThatExceptionOfType; - import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThatExceptionOfType; + public class TestExternalRules { @Test void shouldFailIfNoLocationIsSet() { diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestMavenVersion.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestMavenVersion.java index 127954c3..6d97aac9 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestMavenVersion.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestMavenVersion.java @@ -18,15 +18,16 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.fail; - import java.util.Properties; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; + /** * The Class TestMavenVersion. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireEnvironmentVariable.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireEnvironmentVariable.java index 59dc5858..a962392c 100755 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireEnvironmentVariable.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireEnvironmentVariable.java @@ -18,12 +18,12 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.fail; - import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; + /** * Unit test for {@link RequireEnvironmentVariable}} * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFileChecksum.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFileChecksum.java index 1ce14937..aa0504e1 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFileChecksum.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFileChecksum.java @@ -18,16 +18,17 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.junit.jupiter.api.Assertions.assertTrue; - import java.io.File; import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.codehaus.plexus.util.FileUtils; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.junit.jupiter.api.Assertions.assertTrue; + /** * Test the "RequireFileChecksum" rule * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java index 7ffee553..33839edd 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesDontExist.java @@ -18,14 +18,15 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; - import java.io.File; import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import static org.junit.jupiter.api.Assertions.*; + /** * Test the "require files don't exist" rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java index 9fecf108..34cc1bb0 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesExist.java @@ -18,14 +18,15 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; - import java.io.File; import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import static org.junit.jupiter.api.Assertions.*; + /** * Test the "require files exist" rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java index 94fa612e..8dbbd3eb 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireFilesSize.java @@ -18,18 +18,19 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; - import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; + import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; +import static org.junit.jupiter.api.Assertions.*; + /** * Test the "require files exist" rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVendor.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVendor.java index e29c58c1..5050ef6a 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVendor.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVendor.java @@ -18,18 +18,19 @@ */ package org.apache.maven.plugins.enforcer; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; -import static org.junit.jupiter.api.Assertions.assertThrows; - import java.util.Arrays; import java.util.Collections; + import org.apache.commons.lang3.SystemUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; +import static org.junit.jupiter.api.Assertions.assertThrows; + /** * The Class TestRequireJavaVendor. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVersion.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVersion.java index d32441ef..9daa091b 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVersion.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireJavaVersion.java @@ -18,10 +18,8 @@ */ package org.apache.maven.plugins.enforcer; -import static org.assertj.core.api.Assertions.assertThat; -import static org.junit.jupiter.api.Assertions.assertThrows; - import java.util.stream.Stream; + import org.apache.commons.lang3.SystemUtils; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; @@ -31,6 +29,9 @@ import org.junit.jupiter.params.provider.Arguments; import org.junit.jupiter.params.provider.MethodSource; +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertThrows; + /** * The Class TestRequireJavaVersion. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireNoRepositories.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireNoRepositories.java index d403ee88..260e6918 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireNoRepositories.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireNoRepositories.java @@ -18,13 +18,10 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockito.Mockito.mock; -import static org.mockito.Mockito.when; - import java.util.ArrayList; import java.util.Collections; import java.util.List; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.execution.MavenSession; @@ -38,6 +35,10 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertThrows; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; + /** * Test the "require no repositories" rule. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireOS.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireOS.java index 28570b9a..e2ef7f09 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireOS.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireOS.java @@ -18,11 +18,8 @@ */ package org.apache.maven.plugins.enforcer; -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.startsWith; -import static org.junit.jupiter.api.Assertions.*; - import java.util.Iterator; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.profile.activation.OperatingSystemProfileActivator; @@ -31,6 +28,10 @@ import org.codehaus.plexus.util.Os; import org.junit.jupiter.api.Test; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.startsWith; +import static org.junit.jupiter.api.Assertions.*; + /** * Exhaustively check the OS mojo. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePluginVersions.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePluginVersions.java index 94f1baad..4fa906f9 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePluginVersions.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequirePluginVersions.java @@ -18,19 +18,20 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; - import java.util.ArrayList; import java.util.Collection; import java.util.HashSet; import java.util.List; import java.util.Set; + import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.model.Plugin; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugins.enforcer.utils.PluginWrapper; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.*; + /** * The Class TestRequirePluginVersions. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireProperty.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireProperty.java index 3886fdd8..68aba546 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireProperty.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireProperty.java @@ -18,12 +18,12 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.fail; - import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.fail; + /** * The Class TestRequireProperty. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java index f83819ba..10a0fd57 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseDeps.java @@ -18,10 +18,9 @@ */ package org.apache.maven.plugins.enforcer; -import static org.assertj.core.api.Assertions.assertThat; - import java.io.IOException; import java.util.Collections; + import org.apache.maven.artifact.Artifact; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; @@ -30,6 +29,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; +import static org.assertj.core.api.Assertions.assertThat; + /** * The Class TestRequireReleaseDeps. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseVersion.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseVersion.java index cda2d7f3..e6e31177 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseVersion.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireReleaseVersion.java @@ -18,16 +18,17 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertFalse; - import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtilsHelper; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; + /** * The Class TestRequireReleaseVersion. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireSnapshotVersion.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireSnapshotVersion.java index 811c1b44..f780a5f3 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireSnapshotVersion.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireSnapshotVersion.java @@ -19,6 +19,7 @@ package org.apache.maven.plugins.enforcer; import java.io.IOException; + import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; import org.apache.maven.plugin.testing.ArtifactStubFactory; import org.apache.maven.plugins.enforcer.utils.EnforcerRuleUtilsHelper; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireTextFileChecksum.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireTextFileChecksum.java index cfa96210..b1031bdd 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireTextFileChecksum.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/TestRequireTextFileChecksum.java @@ -22,6 +22,7 @@ import java.io.IOException; import java.nio.charset.Charset; import java.nio.charset.StandardCharsets; + import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.plugins.enforcer.utils.NormalizeLineSeparatorReader.LineSeparator; import org.codehaus.plexus.util.FileUtils; diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtilsHelper.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtilsHelper.java index 440fd177..a856e2e4 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtilsHelper.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/EnforcerRuleUtilsHelper.java @@ -18,12 +18,12 @@ */ package org.apache.maven.plugins.enforcer.utils; -import static org.junit.jupiter.api.Assertions.fail; - import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; +import static org.junit.jupiter.api.Assertions.fail; + /** * The Class TestEnforcerRuleUtils. * diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestArtifactMatcher.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestArtifactMatcher.java index e2f890de..66ebb984 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestArtifactMatcher.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestArtifactMatcher.java @@ -18,11 +18,9 @@ */ package org.apache.maven.plugins.enforcer.utils; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - import java.util.ArrayList; import java.util.Collection; + import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.DefaultArtifact; import org.apache.maven.artifact.handler.ArtifactHandler; @@ -32,6 +30,9 @@ import org.apache.maven.plugins.enforcer.utils.ArtifactMatcher.Pattern; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + public class TestArtifactMatcher { Collection patterns = new ArrayList<>(); diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestMockEnforcerExpressionEvaluator.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestMockEnforcerExpressionEvaluator.java index eccac901..fc6c84c6 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestMockEnforcerExpressionEvaluator.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestMockEnforcerExpressionEvaluator.java @@ -18,15 +18,15 @@ */ package org.apache.maven.plugins.enforcer.utils; -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.fail; - import org.apache.maven.execution.MavenSession; import org.apache.maven.plugins.enforcer.EnforcerExpressionEvaluator; import org.apache.maven.plugins.enforcer.EnforcerTestUtils; import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.fail; + /** * The Class TestMockEnforcerExpressionEvaluator. */ diff --git a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestNormalizeLineSeparatorReader.java b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestNormalizeLineSeparatorReader.java index 1422d67e..30e462ce 100644 --- a/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestNormalizeLineSeparatorReader.java +++ b/enforcer-rules/src/test/java/org/apache/maven/plugins/enforcer/utils/TestNormalizeLineSeparatorReader.java @@ -18,15 +18,16 @@ */ package org.apache.maven.plugins.enforcer.utils; -import static org.junit.jupiter.api.Assertions.assertEquals; - import java.io.IOException; import java.io.Reader; import java.io.StringReader; + import org.apache.commons.io.IOUtils; import org.apache.maven.plugins.enforcer.utils.NormalizeLineSeparatorReader.LineSeparator; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertEquals; + public class TestNormalizeLineSeparatorReader { private static final String UNIX_MULTILINE_STRING = "line1\nline2\n\n"; diff --git a/maven-enforcer-extension/pom.xml b/maven-enforcer-extension/pom.xml index bb8fb435..a1566a87 100644 --- a/maven-enforcer-extension/pom.xml +++ b/maven-enforcer-extension/pom.xml @@ -103,7 +103,7 @@ ${project.build.directory}/local-repo - + diff --git a/maven-enforcer-extension/src/main/java/org/apache/maven/extensions/enforcer/EnforceExtension.java b/maven-enforcer-extension/src/main/java/org/apache/maven/extensions/enforcer/EnforceExtension.java index 418b42af..3fe963d0 100644 --- a/maven-enforcer-extension/src/main/java/org/apache/maven/extensions/enforcer/EnforceExtension.java +++ b/maven-enforcer-extension/src/main/java/org/apache/maven/extensions/enforcer/EnforceExtension.java @@ -18,6 +18,8 @@ */ package org.apache.maven.extensions.enforcer; +import javax.inject.Named; + import java.io.IOException; import java.io.InputStream; import java.io.Reader; @@ -29,7 +31,7 @@ import java.util.Collections; import java.util.List; import java.util.Properties; -import javax.inject.Named; + import org.apache.maven.AbstractMavenLifecycleParticipant; import org.apache.maven.MavenExecutionException; import org.apache.maven.execution.MavenSession; diff --git a/maven-enforcer-plugin/pom.xml b/maven-enforcer-plugin/pom.xml index 1d178992..7413091b 100644 --- a/maven-enforcer-plugin/pom.xml +++ b/maven-enforcer-plugin/pom.xml @@ -195,7 +195,7 @@ ${project.build.directory}/local-repo - + diff --git a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java index 8d278a78..a62738a2 100644 --- a/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java +++ b/maven-enforcer-plugin/src/main/java/org/apache/maven/plugins/enforcer/EnforceMojo.java @@ -21,6 +21,7 @@ import java.util.Hashtable; import java.util.LinkedHashMap; import java.util.Map; + import org.apache.maven.enforcer.rule.api.EnforcerLevel; import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRule2; diff --git a/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestDefaultEnforcementRuleHelper.java b/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestDefaultEnforcementRuleHelper.java index b91097a4..a0ade167 100644 --- a/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestDefaultEnforcementRuleHelper.java +++ b/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestDefaultEnforcementRuleHelper.java @@ -18,11 +18,11 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.assertNotNull; - import org.codehaus.plexus.component.configurator.expression.ExpressionEvaluationException; import org.junit.jupiter.api.Test; +import static org.junit.jupiter.api.Assertions.assertNotNull; + /** * @author Brian Fox */ diff --git a/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestEnforceMojo.java b/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestEnforceMojo.java index 4b774576..23c826cd 100644 --- a/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestEnforceMojo.java +++ b/maven-enforcer-plugin/src/test/java/org/apache/maven/plugins/enforcer/TestEnforceMojo.java @@ -18,8 +18,6 @@ */ package org.apache.maven.plugins.enforcer; -import static org.junit.jupiter.api.Assertions.*; - import org.apache.maven.enforcer.rule.api.EnforcerRule; import org.apache.maven.enforcer.rule.api.EnforcerRuleException; import org.apache.maven.enforcer.rule.api.EnforcerRuleHelper; @@ -33,6 +31,8 @@ import org.mockito.junit.jupiter.MockitoSettings; import org.mockito.quality.Strictness; +import static org.junit.jupiter.api.Assertions.*; + /** * Exhaustively check the enforcer mojo. * diff --git a/pom.xml b/pom.xml index b4d334f0..491b7f5b 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ org.apache.maven maven-parent 39 - + org.apache.maven.enforcer enforcer