From 10eaa068c614d6dcd351e4d847a94862a2897138 Mon Sep 17 00:00:00 2001 From: Jeremy Landis Date: Sun, 27 Mar 2022 20:39:13 -0400 Subject: [PATCH] [import] Sort the imports to resolve checkstyle warnings --- .../license/git/CopyrightAuthorProvider.java | 1 - .../license/git/CopyrightRangeProvider.java | 1 - .../maven/plugin/license/git/GitLookup.java | 15 +++--- .../license/git/GitPropertiesProvider.java | 3 +- .../git/CopyrightAuthorProviderTest.java | 2 - .../git/CopyrightRangeProviderTest.java | 2 - .../plugin/license/git/GitLookupTest.java | 11 ++--- .../license/svn/SVNPropertiesProvider.java | 13 +++-- .../plugin/license/AbstractLicenseMojo.java | 49 +++++++++---------- .../plugin/license/LicenseCheckMojo.java | 13 +++-- .../plugin/license/LicenseFormatMojo.java | 5 +- .../plugin/license/LicenseRemoveMojo.java | 3 +- .../maven/plugin/license/LicenseSet.java | 3 +- .../mycila/maven/plugin/license/Multi.java | 3 +- .../plugin/license/PropertiesProvider.java | 1 - .../mycila/maven/plugin/license/Report.java | 7 ++- .../AggregateLicensePolicyEnforcer.java | 7 ++- .../ArtifactLicensePolicyEnforcer.java | 5 +- .../license/dependencies/LicenseMap.java | 7 ++- .../license/dependencies/LicensePolicy.java | 5 +- .../dependencies/MavenProjectLicenses.java | 19 ++++--- .../plugin/license/document/Document.java | 7 ++- .../license/document/DocumentFactory.java | 3 +- .../plugin/license/document/DocumentType.java | 1 - .../header/AdditionalHeaderDefinition.java | 1 - .../maven/plugin/license/header/Header.java | 7 ++- .../plugin/license/header/HeaderSource.java | 7 ++- .../plugin/license/util/FileContent.java | 4 +- .../maven/plugin/license/util/FileUtils.java | 7 ++- .../maven/plugin/license/util/Selection.java | 13 +++-- .../license/util/resource/ResourceFinder.java | 3 +- .../src/test/java/MyPropertiesProvider.java | 1 - .../license/AbstractLicenseMojoTest.java | 2 - .../license/AdditionalHeaderMojoTest.java | 7 ++- .../plugin/license/AggregateMojoTest.java | 9 ++-- .../maven/plugin/license/CheckTest.java | 5 +- .../plugin/license/CompleteMojoTest.java | 26 +++++----- .../maven/plugin/license/DefaultTest.java | 9 ++-- .../plugin/license/ExcludesMojoTest.java | 5 +- .../plugin/license/FailIfMissingMojoTest.java | 5 +- .../maven/plugin/license/HeaderMojoTest.java | 3 +- .../plugin/license/IncludesMojoTest.java | 5 +- .../maven/plugin/license/LicenseSetTest.java | 3 +- .../maven/plugin/license/MappingMojoTest.java | 7 ++- .../maven/plugin/license/MockedLog.java | 5 +- .../maven/plugin/license/QuietMojoTest.java | 5 +- .../maven/plugin/license/RemoveMojoTest.java | 13 +++-- .../maven/plugin/license/ReportTest.java | 17 +++---- .../maven/plugin/license/StrictTest.java | 3 +- .../maven/plugin/license/UpdateMojoTest.java | 17 +++---- .../license/UseDefaultExcludesMojoTest.java | 5 +- .../license/UseDefaultMappingMojoTest.java | 5 +- .../plugin/license/ValidHeaderMojoTest.java | 5 +- .../AggregateLicensePolicyEnforcerTest.java | 9 ++-- ...ArtifactLicensePolicyEnforcerTestBase.java | 11 ++--- .../LicenseURLLicensePolicyEnforcerTest.java | 7 ++- .../dependencies/MavenProjectLicensesIT.java | 14 +++--- .../plugin/license/document/DocumentTest.java | 3 -- .../AdditionalHeaderDefinitionTest.java | 2 - .../header/DefaultHeaderDefinitionTest.java | 7 ++- .../license/header/HeaderParserTest.java | 2 - .../license/header/HeaderSourceTest.java | 6 +-- .../plugin/license/header/HeaderTest.java | 2 - .../plugin/license/util/FileContentTest.java | 1 - .../plugin/license/util/FileUtilsTest.java | 1 - .../plugin/license/util/SelectionTest.java | 15 +++--- .../util/resource/ResourceFinderTest.java | 9 ++-- 67 files changed, 202 insertions(+), 277 deletions(-) diff --git a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProvider.java b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProvider.java index 0c469d0db..6d6f4c7be 100644 --- a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProvider.java +++ b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProvider.java @@ -18,7 +18,6 @@ import com.mycila.maven.plugin.license.AbstractLicenseMojo; import com.mycila.maven.plugin.license.PropertiesProvider; import com.mycila.maven.plugin.license.document.Document; - import java.util.Collections; import java.util.HashMap; import java.util.Map; diff --git a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightRangeProvider.java b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightRangeProvider.java index 0890e4e07..1223b8909 100644 --- a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightRangeProvider.java +++ b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/CopyrightRangeProvider.java @@ -18,7 +18,6 @@ import com.mycila.maven.plugin.license.AbstractLicenseMojo; import com.mycila.maven.plugin.license.PropertiesProvider; import com.mycila.maven.plugin.license.document.Document; - import java.util.Collections; import java.util.HashMap; import java.util.Map; diff --git a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitLookup.java b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitLookup.java index e4707a88f..7c05097d6 100644 --- a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitLookup.java +++ b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitLookup.java @@ -15,6 +15,13 @@ */ package com.mycila.maven.plugin.license.git; +import java.io.File; +import java.io.IOException; +import java.util.Arrays; +import java.util.Calendar; +import java.util.Date; +import java.util.Iterator; +import java.util.TimeZone; import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.Status; import org.eclipse.jgit.api.errors.GitAPIException; @@ -32,14 +39,6 @@ import org.eclipse.jgit.treewalk.filter.PathFilter; import org.eclipse.jgit.treewalk.filter.TreeFilter; -import java.io.File; -import java.io.IOException; -import java.util.Arrays; -import java.util.Calendar; -import java.util.Date; -import java.util.Iterator; -import java.util.TimeZone; - /** * A jGit library wrapper to query the date of the last commit. * diff --git a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitPropertiesProvider.java b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitPropertiesProvider.java index 4250d37ac..18a201125 100644 --- a/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitPropertiesProvider.java +++ b/license-maven-plugin-git/src/main/java/com/mycila/maven/plugin/license/git/GitPropertiesProvider.java @@ -15,14 +15,13 @@ */ package com.mycila.maven.plugin.license.git; +import com.mycila.maven.plugin.license.AbstractLicenseMojo; import java.io.File; import java.io.IOException; import java.util.Locale; import java.util.Properties; import java.util.TimeZone; -import com.mycila.maven.plugin.license.AbstractLicenseMojo; - /** * @author Peter Palaga */ diff --git a/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProviderTest.java b/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProviderTest.java index 5ab011580..5c7811100 100644 --- a/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProviderTest.java +++ b/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightAuthorProviderTest.java @@ -17,7 +17,6 @@ import com.mycila.maven.plugin.license.LicenseCheckMojo; import com.mycila.maven.plugin.license.document.Document; - import java.io.File; import java.io.IOException; import java.net.URL; @@ -26,7 +25,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightRangeProviderTest.java b/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightRangeProviderTest.java index ad9b7340d..f8bad6e0c 100644 --- a/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightRangeProviderTest.java +++ b/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/CopyrightRangeProviderTest.java @@ -17,7 +17,6 @@ import com.mycila.maven.plugin.license.LicenseCheckMojo; import com.mycila.maven.plugin.license.document.Document; - import java.io.File; import java.io.IOException; import java.net.URL; @@ -26,7 +25,6 @@ import java.util.HashMap; import java.util.Map; import java.util.Properties; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/GitLookupTest.java b/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/GitLookupTest.java index baf847ad1..58403207f 100644 --- a/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/GitLookupTest.java +++ b/license-maven-plugin-git/src/test/java/com/mycila/maven/plugin/license/git/GitLookupTest.java @@ -16,12 +16,6 @@ package com.mycila.maven.plugin.license.git; import com.mycila.maven.plugin.license.git.GitLookup.DateSource; -import org.eclipse.jgit.api.errors.GitAPIException; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.File; @@ -35,6 +29,11 @@ import java.util.TimeZone; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; +import org.eclipse.jgit.api.errors.GitAPIException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * @author Peter Palaga diff --git a/license-maven-plugin-svn/src/main/java/com/mycila/maven/plugin/license/svn/SVNPropertiesProvider.java b/license-maven-plugin-svn/src/main/java/com/mycila/maven/plugin/license/svn/SVNPropertiesProvider.java index 32ba13dcd..87b9d600e 100755 --- a/license-maven-plugin-svn/src/main/java/com/mycila/maven/plugin/license/svn/SVNPropertiesProvider.java +++ b/license-maven-plugin-svn/src/main/java/com/mycila/maven/plugin/license/svn/SVNPropertiesProvider.java @@ -19,6 +19,12 @@ import com.mycila.maven.plugin.license.Credentials; import com.mycila.maven.plugin.license.PropertiesProvider; import com.mycila.maven.plugin.license.document.Document; +import java.io.File; +import java.text.SimpleDateFormat; +import java.util.GregorianCalendar; +import java.util.HashMap; +import java.util.Map; +import java.util.Properties; import org.tmatesoft.svn.core.ISVNLogEntryHandler; import org.tmatesoft.svn.core.SVNDepth; import org.tmatesoft.svn.core.SVNException; @@ -28,13 +34,6 @@ import org.tmatesoft.svn.core.wc.SVNInfo; import org.tmatesoft.svn.core.wc.SVNRevision; -import java.io.File; -import java.text.SimpleDateFormat; -import java.util.GregorianCalendar; -import java.util.HashMap; -import java.util.Map; -import java.util.Properties; - /** * An implementation of {@link PropertiesProvider} that uses SVN to retrieve * year information of last modification of files. diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/AbstractLicenseMojo.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/AbstractLicenseMojo.java index 70b5ddf61..0009d5b4c 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/AbstractLicenseMojo.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/AbstractLicenseMojo.java @@ -15,6 +15,12 @@ */ package com.mycila.maven.plugin.license; +import static com.mycila.maven.plugin.license.document.DocumentType.defaultMapping; +import static com.mycila.maven.plugin.license.util.FileUtils.asPath; +import static java.lang.String.format; +import static java.util.Arrays.asList; +import static java.util.Arrays.deepToString; + import com.mycila.maven.plugin.license.dependencies.LicenseMessage; import com.mycila.maven.plugin.license.dependencies.LicensePolicy; import com.mycila.maven.plugin.license.document.Document; @@ -29,25 +35,6 @@ import com.mycila.maven.plugin.license.util.Selection; import com.mycila.maven.plugin.license.util.resource.ResourceFinder; import com.mycila.xmltool.XMLDoc; -import org.apache.maven.artifact.DependencyResolutionRequiredException; -import org.apache.maven.execution.MavenSession; -import org.apache.maven.model.Organization; -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.Component; -import org.apache.maven.plugins.annotations.Parameter; -import org.apache.maven.project.MavenProject; -import org.apache.maven.project.ProjectBuilder; -import org.apache.maven.settings.Server; -import org.apache.maven.settings.Settings; -import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest; -import org.apache.maven.settings.crypto.SettingsDecrypter; -import org.apache.maven.settings.crypto.SettingsDecryptionRequest; -import org.apache.maven.settings.crypto.SettingsDecryptionResult; -import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; -import org.xml.sax.InputSource; - import java.io.File; import java.io.IOException; import java.time.Clock; @@ -68,12 +55,24 @@ import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; - -import static com.mycila.maven.plugin.license.document.DocumentType.defaultMapping; -import static com.mycila.maven.plugin.license.util.FileUtils.asPath; -import static java.lang.String.format; -import static java.util.Arrays.asList; -import static java.util.Arrays.deepToString; +import org.apache.maven.artifact.DependencyResolutionRequiredException; +import org.apache.maven.execution.MavenSession; +import org.apache.maven.model.Organization; +import org.apache.maven.plugin.AbstractMojo; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuilder; +import org.apache.maven.settings.Server; +import org.apache.maven.settings.Settings; +import org.apache.maven.settings.crypto.DefaultSettingsDecryptionRequest; +import org.apache.maven.settings.crypto.SettingsDecrypter; +import org.apache.maven.settings.crypto.SettingsDecryptionRequest; +import org.apache.maven.settings.crypto.SettingsDecryptionResult; +import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder; +import org.xml.sax.InputSource; /** * Date: 18-Feb-2008
Author: Mathieu Carbou diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseCheckMojo.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseCheckMojo.java index bdf84504e..25ab379d8 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseCheckMojo.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseCheckMojo.java @@ -22,19 +22,18 @@ import com.mycila.maven.plugin.license.dependencies.MavenProjectLicenses; import com.mycila.maven.plugin.license.document.Document; import com.mycila.maven.plugin.license.header.Header; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.MojoFailureException; -import org.apache.maven.plugins.annotations.LifecyclePhase; -import org.apache.maven.plugins.annotations.Mojo; -import org.apache.maven.plugins.annotations.Parameter; - import java.io.File; import java.util.Collection; import java.util.Map; import java.util.Set; import java.util.concurrent.ConcurrentLinkedQueue; import java.util.stream.Collectors; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.MojoFailureException; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; /** * Check if the source files of the project have a valid license header diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseFormatMojo.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseFormatMojo.java index 080f602a6..1f7f79cd7 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseFormatMojo.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseFormatMojo.java @@ -17,12 +17,11 @@ import com.mycila.maven.plugin.license.document.Document; import com.mycila.maven.plugin.license.header.Header; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Mojo; -import java.io.File; - /** * Reformat files with a missing header to add it * @@ -78,4 +77,4 @@ public void onExistingHeader(Document document, Header header) { callback.checkUnknown(); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseRemoveMojo.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseRemoveMojo.java index 3f4256867..c74c5b1a2 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseRemoveMojo.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseRemoveMojo.java @@ -17,12 +17,11 @@ import com.mycila.maven.plugin.license.document.Document; import com.mycila.maven.plugin.license.header.Header; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugins.annotations.Mojo; -import java.io.File; - /** * Remove the specified header from source files * diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseSet.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseSet.java index 68dfd05f7..b6344b191 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseSet.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/LicenseSet.java @@ -15,11 +15,10 @@ */ package com.mycila.maven.plugin.license; -import org.apache.maven.plugins.annotations.Parameter; - import java.io.File; import java.util.HashMap; import java.util.Map; +import org.apache.maven.plugins.annotations.Parameter; public class LicenseSet { diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Multi.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Multi.java index fbb056f9e..cc651e5d5 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Multi.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Multi.java @@ -15,9 +15,8 @@ */ package com.mycila.maven.plugin.license; -import org.apache.maven.plugins.annotations.Parameter; - import java.util.Arrays; +import org.apache.maven.plugins.annotations.Parameter; public class Multi { diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/PropertiesProvider.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/PropertiesProvider.java index 6d4753845..ae81f54fd 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/PropertiesProvider.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/PropertiesProvider.java @@ -16,7 +16,6 @@ package com.mycila.maven.plugin.license; import com.mycila.maven.plugin.license.document.Document; - import java.util.Map; import java.util.Properties; diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Report.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Report.java index f7b52bfb1..20f0b9cf9 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Report.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/Report.java @@ -15,6 +15,8 @@ */ package com.mycila.maven.plugin.license; +import static java.nio.charset.StandardCharsets.UTF_8; + import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonArray; @@ -22,8 +24,6 @@ import com.google.gson.JsonPrimitive; import com.mycila.xmltool.XMLDoc; import com.mycila.xmltool.XMLTag; -import org.apache.maven.project.MavenProject; - import java.io.File; import java.io.IOException; import java.io.UncheckedIOException; @@ -33,8 +33,7 @@ import java.util.Locale; import java.util.Map; import java.util.concurrent.ConcurrentHashMap; - -import static java.nio.charset.StandardCharsets.UTF_8; +import org.apache.maven.project.MavenProject; /** * @author Mathieu Carbou diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcer.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcer.java index 5c85f5f4f..de8362f50 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcer.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcer.java @@ -15,14 +15,13 @@ */ package com.mycila.maven.plugin.license.dependencies; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.model.License; - import java.util.HashMap; import java.util.Map; import java.util.Map.Entry; import java.util.Set; import java.util.stream.Collectors; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.License; /** * Aggregate license policy enforcement with default enforcer bindings based on {@link LicensePolicy.Type}. @@ -188,4 +187,4 @@ public LicensePolicyEnforcer getDefaultPolicy() { public void setDefaultPolicy(final LicensePolicyEnforcer defaultPolicy) { this.defaultPolicy = defaultPolicy; } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcer.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcer.java index 7bc89543d..2f5348b3c 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcer.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcer.java @@ -15,12 +15,11 @@ */ package com.mycila.maven.plugin.license.dependencies; +import java.util.Collections; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.shared.artifact.filter.StrictPatternIncludesArtifactFilter; -import java.util.Collections; - /** * Make policy decisions on a {@link Artifact} based on an {@link ArtifactFilter}. * @@ -49,4 +48,4 @@ public boolean apply(final Artifact target) { public Class getType() { return Artifact.class; } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicenseMap.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicenseMap.java index 1472b73cf..702b4d645 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicenseMap.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicenseMap.java @@ -15,11 +15,10 @@ */ package com.mycila.maven.plugin.license.dependencies; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.model.License; - import java.util.Map; import java.util.Set; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.model.License; /** * To be implemented by different project/build-framework scanners presenting @@ -30,4 +29,4 @@ public interface LicenseMap { Map> getLicenseMap(); -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java index f1c03e6fa..6ecc6ca65 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/LicensePolicy.java @@ -15,9 +15,8 @@ */ package com.mycila.maven.plugin.license.dependencies; -import org.apache.maven.plugins.annotations.Parameter; - import java.util.Optional; +import org.apache.maven.plugins.annotations.Parameter; /** * A policy decision based on some matcher/value and type. Different policy @@ -130,4 +129,4 @@ private void setValue(String value) { public String toString() { return String.format("%s:%s:%s", getType(), getRule(), getValue()); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicenses.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicenses.java index c05ee9f85..76ebb01fa 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicenses.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicenses.java @@ -15,6 +15,14 @@ */ package com.mycila.maven.plugin.license.dependencies; +import java.util.Collections; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; import org.apache.maven.artifact.Artifact; import org.apache.maven.artifact.resolver.filter.ArtifactFilter; import org.apache.maven.artifact.resolver.filter.CumulativeScopeArtifactFilter; @@ -32,15 +40,6 @@ import org.apache.maven.shared.dependency.graph.DependencyNode; import org.apache.maven.shared.dependency.graph.internal.Maven31DependencyGraphBuilder; -import java.util.Collections; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Optional; -import java.util.Set; -import java.util.concurrent.ConcurrentHashMap; -import java.util.concurrent.ConcurrentMap; - /** * Helper class for building Artifact/License mappings from a maven project * (multi module or single). @@ -223,4 +222,4 @@ private ProjectBuildingRequest getBuildingRequest() { protected void setBuildingRequest(final ProjectBuildingRequest buildingRequest) { this.buildingRequest = Optional.ofNullable(buildingRequest).orElse(new DefaultProjectBuildingRequest()); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/Document.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/Document.java index cfb718efa..676591ce3 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/Document.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/Document.java @@ -15,19 +15,18 @@ */ package com.mycila.maven.plugin.license.document; +import static com.mycila.maven.plugin.license.util.FileUtils.readFirstLines; +import static com.mycila.maven.plugin.license.util.FileUtils.remove; + import com.mycila.maven.plugin.license.header.Header; import com.mycila.maven.plugin.license.header.HeaderDefinition; import com.mycila.maven.plugin.license.header.HeaderParser; import com.mycila.maven.plugin.license.header.HeaderType; import com.mycila.maven.plugin.license.util.FileContent; import com.mycila.maven.plugin.license.util.FileUtils; - import java.io.File; import java.io.IOException; -import static com.mycila.maven.plugin.license.util.FileUtils.readFirstLines; -import static com.mycila.maven.plugin.license.util.FileUtils.remove; - /** * Date: 16-Feb-2008
Author: Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentFactory.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentFactory.java index f31005f9b..aec062623 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentFactory.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentFactory.java @@ -16,10 +16,9 @@ package com.mycila.maven.plugin.license.document; import com.mycila.maven.plugin.license.header.HeaderDefinition; -import org.codehaus.plexus.util.FileUtils; - import java.io.File; import java.util.Map; +import org.codehaus.plexus.util.FileUtils; /** * Date: 14-Feb-2008
diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentType.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentType.java index cc10781ba..29db2275d 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentType.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/document/DocumentType.java @@ -16,7 +16,6 @@ package com.mycila.maven.plugin.license.document; import com.mycila.maven.plugin.license.header.HeaderType; - import java.util.Collections; import java.util.LinkedHashMap; import java.util.Map; diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinition.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinition.java index 1abe11dad..fb62be99c 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinition.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinition.java @@ -17,7 +17,6 @@ import com.mycila.xmltool.CallBack; import com.mycila.xmltool.XMLTag; - import java.util.HashMap; import java.util.Map; diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/Header.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/Header.java index 48f6a9d53..d017a1087 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/Header.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/Header.java @@ -15,10 +15,12 @@ */ package com.mycila.maven.plugin.license.header; +import static com.mycila.maven.plugin.license.util.FileUtils.readFirstLines; +import static com.mycila.maven.plugin.license.util.FileUtils.remove; + import com.mycila.maven.plugin.license.HeaderSection; import com.mycila.maven.plugin.license.document.Document; import com.mycila.maven.plugin.license.util.StringUtils; - import java.io.IOException; import java.util.ArrayList; import java.util.List; @@ -26,9 +28,6 @@ import java.util.SortedMap; import java.util.TreeMap; -import static com.mycila.maven.plugin.license.util.FileUtils.readFirstLines; -import static com.mycila.maven.plugin.license.util.FileUtils.remove; - /** * The Header class wraps the license template file, the one which have to be outputted inside the other * files. diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderSource.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderSource.java index ee4baff15..47f8d4015 100644 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderSource.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/header/HeaderSource.java @@ -15,15 +15,14 @@ */ package com.mycila.maven.plugin.license.header; +import static com.mycila.maven.plugin.license.Multi.DEFAULT_SEPARATOR; + import com.mycila.maven.plugin.license.Multi; import com.mycila.maven.plugin.license.util.FileUtils; import com.mycila.maven.plugin.license.util.resource.ResourceFinder; -import org.apache.maven.plugin.MojoFailureException; - import java.io.IOException; import java.net.URL; - -import static com.mycila.maven.plugin.license.Multi.DEFAULT_SEPARATOR; +import org.apache.maven.plugin.MojoFailureException; /** * Provides an access to the license template text. diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileContent.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileContent.java index f5d93723b..45571756e 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileContent.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileContent.java @@ -15,11 +15,11 @@ */ package com.mycila.maven.plugin.license.util; +import static com.mycila.maven.plugin.license.util.FileUtils.read; + import java.io.File; import java.io.IOException; -import static com.mycila.maven.plugin.license.util.FileUtils.read; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileUtils.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileUtils.java index 4b12cd12e..d1919c61e 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileUtils.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/FileUtils.java @@ -15,8 +15,7 @@ */ package com.mycila.maven.plugin.license.util; -import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.InterpolationFilterReader; +import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; import java.io.BufferedReader; import java.io.ByteArrayOutputStream; @@ -35,8 +34,8 @@ import java.nio.file.Path; import java.util.Map; import java.util.stream.Stream; - -import static java.nio.file.StandardCopyOption.REPLACE_EXISTING; +import org.codehaus.plexus.util.IOUtil; +import org.codehaus.plexus.util.InterpolationFilterReader; /** * Date: 16-Feb-2008
diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java index 963d9227d..fdf19ec0e 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/Selection.java @@ -15,18 +15,17 @@ */ package com.mycila.maven.plugin.license.util; -import com.mycila.maven.plugin.license.Default; -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.shared.utils.io.DirectoryScanner; -import org.apache.maven.shared.utils.io.MatchPatterns; -import org.apache.maven.shared.utils.io.ScanConductor; +import static java.util.Arrays.asList; +import com.mycila.maven.plugin.license.Default; import java.io.File; import java.util.ArrayList; import java.util.Collections; import java.util.List; - -import static java.util.Arrays.asList; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.shared.utils.io.DirectoryScanner; +import org.apache.maven.shared.utils.io.MatchPatterns; +import org.apache.maven.shared.utils.io.ScanConductor; /** * Date: 16-Feb-2008
diff --git a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/resource/ResourceFinder.java b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/resource/ResourceFinder.java index f11641536..90da5ec72 100755 --- a/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/resource/ResourceFinder.java +++ b/license-maven-plugin/src/main/java/com/mycila/maven/plugin/license/util/resource/ResourceFinder.java @@ -15,8 +15,6 @@ */ package com.mycila.maven.plugin.license.util.resource; -import org.apache.maven.plugin.MojoFailureException; - import java.net.MalformedURLException; import java.net.URL; import java.nio.file.Files; @@ -24,6 +22,7 @@ import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import org.apache.maven.plugin.MojoFailureException; /** * Date: 26-Feb-2008
diff --git a/license-maven-plugin/src/test/java/MyPropertiesProvider.java b/license-maven-plugin/src/test/java/MyPropertiesProvider.java index 8ca28ce62..0cd8ca2ef 100755 --- a/license-maven-plugin/src/test/java/MyPropertiesProvider.java +++ b/license-maven-plugin/src/test/java/MyPropertiesProvider.java @@ -1,7 +1,6 @@ import com.mycila.maven.plugin.license.AbstractLicenseMojo; import com.mycila.maven.plugin.license.PropertiesProvider; import com.mycila.maven.plugin.license.document.Document; - import java.util.HashMap; import java.util.Map; import java.util.Properties; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AbstractLicenseMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AbstractLicenseMojoTest.java index b387dc1ed..d8632377c 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AbstractLicenseMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AbstractLicenseMojoTest.java @@ -1,9 +1,7 @@ package com.mycila.maven.plugin.license; import com.google.common.base.Strings; - import java.util.UUID; - import org.assertj.core.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java index 07a71f298..e7e5ee54e 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AdditionalHeaderMojoTest.java @@ -16,14 +16,13 @@ package com.mycila.maven.plugin.license; import com.mycila.maven.plugin.license.util.DebugLog; +import java.io.File; +import java.util.Collections; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; -import java.util.Collections; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -78,4 +77,4 @@ void test_inline() throws Exception { check.setLog(new DebugLog()); check.execute(); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AggregateMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AggregateMojoTest.java index 346669808..a0083a6fc 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AggregateMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/AggregateMojoTest.java @@ -15,15 +15,14 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; +import java.util.Arrays; +import java.util.List; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; -import java.util.Arrays; -import java.util.List; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -65,4 +64,4 @@ public List getModules() { Assertions.assertEquals("Some files do not have the expected license header", e.getMessage()); } } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CheckTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CheckTest.java index 263f54740..2415909ee 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CheckTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CheckTest.java @@ -16,13 +16,12 @@ package com.mycila.maven.plugin.license; import com.mycila.maven.plugin.license.util.FileUtils; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -79,4 +78,4 @@ void test_line_wrapping() throws Exception { } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CompleteMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CompleteMojoTest.java index 7bfcaa5d3..028d22057 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CompleteMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/CompleteMojoTest.java @@ -15,19 +15,6 @@ */ package com.mycila.maven.plugin.license; -import com.mycila.maven.plugin.license.header.HeaderType; -import com.mycila.maven.plugin.license.util.FileUtils; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.params.ParameterizedTest; -import org.junit.jupiter.params.provider.MethodSource; -import java.io.File; -import java.util.Collections; -import java.util.EnumSet; -import java.util.List; -import java.util.stream.Stream; - import static com.mycila.maven.plugin.license.header.HeaderType.APOSTROPHE_STYLE; import static com.mycila.maven.plugin.license.header.HeaderType.ASCIIDOC_STYLE; import static com.mycila.maven.plugin.license.header.HeaderType.ASP; @@ -70,6 +57,19 @@ import static org.hamcrest.CoreMatchers.is; import static org.hamcrest.MatcherAssert.assertThat; +import com.mycila.maven.plugin.license.header.HeaderType; +import com.mycila.maven.plugin.license.util.FileUtils; +import java.io.File; +import java.util.Collections; +import java.util.EnumSet; +import java.util.List; +import java.util.stream.Stream; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.testing.stubs.MavenProjectStub; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.params.ParameterizedTest; +import org.junit.jupiter.params.provider.MethodSource; + /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/DefaultTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/DefaultTest.java index 6ab266b48..3bfff9055 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/DefaultTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/DefaultTest.java @@ -1,14 +1,13 @@ package com.mycila.maven.plugin.license; -import org.hamcrest.CoreMatchers; -import org.junit.jupiter.api.Test; - -import java.util.Arrays; - import static org.hamcrest.CoreMatchers.containsString; import static org.hamcrest.CoreMatchers.not; import static org.hamcrest.MatcherAssert.assertThat; +import java.util.Arrays; +import org.hamcrest.CoreMatchers; +import org.junit.jupiter.api.Test; + class DefaultTest { @Test void test_Jenkinsfile_is_not_a_default_exclude() { diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ExcludesMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ExcludesMojoTest.java index 113a64afd..2bf4db15e 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ExcludesMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ExcludesMojoTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -51,4 +50,4 @@ void test_exclusions() throws Exception { check.execute(); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/FailIfMissingMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/FailIfMissingMojoTest.java index 9205af6fc..a716e3285 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/FailIfMissingMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/FailIfMissingMojoTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -50,4 +49,4 @@ void test_not_fail() throws Exception { check.execute(); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/HeaderMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/HeaderMojoTest.java index 08bb62abb..8fb508a41 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/HeaderMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/HeaderMojoTest.java @@ -16,11 +16,10 @@ package com.mycila.maven.plugin.license; import com.mycila.maven.plugin.license.util.FileUtils; +import java.io.File; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/IncludesMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/IncludesMojoTest.java index 434c67c82..4ca08702d 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/IncludesMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/IncludesMojoTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -63,4 +62,4 @@ void test_include_overrides_default_exclusion() throws Exception { }); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/LicenseSetTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/LicenseSetTest.java index 2ab069c89..4eea417d2 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/LicenseSetTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/LicenseSetTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.monitor.logging.DefaultLog; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - class LicenseSetTest { @Test diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MappingMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MappingMojoTest.java index dc89585a9..c1b76a329 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MappingMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MappingMojoTest.java @@ -15,6 +15,9 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; +import java.util.HashMap; +import java.util.LinkedHashMap; import org.apache.maven.monitor.logging.DefaultLog; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.logging.SystemStreamLog; @@ -22,10 +25,6 @@ import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; -import java.util.HashMap; -import java.util.LinkedHashMap; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MockedLog.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MockedLog.java index 9ebd57c55..af4f26b9e 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MockedLog.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/MockedLog.java @@ -15,11 +15,10 @@ */ package com.mycila.maven.plugin.license; -import org.codehaus.plexus.logging.AbstractLogger; -import org.codehaus.plexus.logging.Logger; - import java.io.PrintWriter; import java.io.StringWriter; +import org.codehaus.plexus.logging.AbstractLogger; +import org.codehaus.plexus.logging.Logger; /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/QuietMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/QuietMojoTest.java index 30559b162..411db2c21 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/QuietMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/QuietMojoTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.monitor.logging.DefaultLog; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -49,4 +48,4 @@ void test_load_header_from_relative_file() throws Exception { check.execute(); Assertions.assertEquals(2, logger.getLogEntries()); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/RemoveMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/RemoveMojoTest.java index 2e293423b..fa365bec4 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/RemoveMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/RemoveMojoTest.java @@ -15,17 +15,16 @@ */ package com.mycila.maven.plugin.license; +import static org.hamcrest.CoreMatchers.is; + import com.google.common.io.Files; import com.mycila.maven.plugin.license.util.FileUtils; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import java.io.File; import java.nio.charset.Charset; import java.util.List; - -import static org.hamcrest.CoreMatchers.is; +import org.apache.maven.plugin.testing.stubs.MavenProjectStub; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) @@ -191,4 +190,4 @@ void test_issue41_cannotRemoveEmptyHeader() throws Exception { List linesAfterRemove = Files.readLines(destFile, Charset.forName("UTF-8")); org.assertj.core.api.Assertions.assertThat(linesAfterRemove.size()).isEqualTo(2); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ReportTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ReportTest.java index ede897114..699404399 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ReportTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ReportTest.java @@ -15,7 +15,15 @@ */ package com.mycila.maven.plugin.license; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + import com.mycila.maven.plugin.license.util.FileUtils; +import java.io.File; +import java.time.Clock; +import java.time.Instant; +import java.time.ZoneId; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.testing.stubs.ArtifactStub; @@ -24,15 +32,6 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.io.File; -import java.time.Clock; -import java.time.Instant; -import java.time.ZoneId; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/StrictTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/StrictTest.java index a42e2d523..25dbef299 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/StrictTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/StrictTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UpdateMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UpdateMojoTest.java index a3298ff1a..68132acf7 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UpdateMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UpdateMojoTest.java @@ -15,22 +15,21 @@ */ package com.mycila.maven.plugin.license; +import static org.hamcrest.CoreMatchers.equalTo; +import static org.hamcrest.CoreMatchers.is; +import static org.hamcrest.MatcherAssert.assertThat; + import com.google.common.collect.ImmutableMap; import com.google.common.io.Files; import com.mycila.maven.plugin.license.util.FileUtils; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugin.testing.stubs.MavenProjectStub; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - import java.io.File; import java.nio.charset.Charset; import java.util.LinkedHashMap; import java.util.List; - -import static org.hamcrest.CoreMatchers.equalTo; -import static org.hamcrest.CoreMatchers.is; -import static org.hamcrest.MatcherAssert.assertThat; +import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugin.testing.stubs.MavenProjectStub; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultExcludesMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultExcludesMojoTest.java index 5e9c51d3a..39862ea78 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultExcludesMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultExcludesMojoTest.java @@ -15,12 +15,11 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -67,4 +66,4 @@ void check_withoutDefaultExcludes_Netbeans_Configuration_Is_Reported() { Assertions.assertEquals("Some files do not have the expected license header", e.getMessage()); } } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultMappingMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultMappingMojoTest.java index e31381f01..42e17ee0a 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultMappingMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/UseDefaultMappingMojoTest.java @@ -15,14 +15,13 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.monitor.logging.DefaultLog; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -64,4 +63,4 @@ void test_useDefaultMapping() throws Exception { Assertions.assertEquals("Some files do not have the expected license header", e.getMessage()); } } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ValidHeaderMojoTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ValidHeaderMojoTest.java index b4a69b17b..069c72406 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ValidHeaderMojoTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/ValidHeaderMojoTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license; +import java.io.File; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.testing.stubs.MavenProjectStub; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ @@ -49,4 +48,4 @@ void test_validHeader() throws Exception { check.legacyConfigValidHeaders = new String[]{"src/test/resources/check/header2.txt"}; check.execute(); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcerTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcerTest.java index 0ecb067f9..45f14da64 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcerTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/AggregateLicensePolicyEnforcerTest.java @@ -15,15 +15,14 @@ */ package com.mycila.maven.plugin.license.dependencies; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; import org.apache.maven.artifact.Artifact; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import java.util.HashSet; -import java.util.Map; -import java.util.Set; - class AggregateLicensePolicyEnforcerTest extends ArtifactLicensePolicyEnforcerTestBase { LicenseMapData data; Set policies; @@ -142,4 +141,4 @@ void test_denyOverride() { Assertions.assertEquals(data.getExpected(), enforcer.apply(data.getLicenseMap()), description); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcerTestBase.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcerTestBase.java index d2ba14dcf..a1c92926a 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcerTestBase.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/ArtifactLicensePolicyEnforcerTestBase.java @@ -15,17 +15,16 @@ */ package com.mycila.maven.plugin.license.dependencies; -import org.apache.maven.artifact.Artifact; -import org.apache.maven.artifact.DefaultArtifact; -import org.apache.maven.artifact.handler.DefaultArtifactHandler; -import org.apache.maven.model.License; - import java.net.URL; import java.util.HashMap; import java.util.HashSet; import java.util.Map; import java.util.Optional; import java.util.Set; +import org.apache.maven.artifact.Artifact; +import org.apache.maven.artifact.DefaultArtifact; +import org.apache.maven.artifact.handler.DefaultArtifactHandler; +import org.apache.maven.model.License; /** * Utility class for test setup methods related to this package. @@ -107,4 +106,4 @@ public Map> getLicenseMap() { } } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/LicenseURLLicensePolicyEnforcerTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/LicenseURLLicensePolicyEnforcerTest.java index 90a51e3a1..700507b68 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/LicenseURLLicensePolicyEnforcerTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/LicenseURLLicensePolicyEnforcerTest.java @@ -15,13 +15,12 @@ */ package com.mycila.maven.plugin.license.dependencies; +import java.net.MalformedURLException; +import java.net.URL; import org.apache.maven.model.License; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.net.MalformedURLException; -import java.net.URL; - class LicenseURLLicensePolicyEnforcerTest extends ArtifactLicensePolicyEnforcerTestBase { License license; LicensePolicy policy; @@ -72,4 +71,4 @@ void test_explicitLicenseUnmatchedAllowed() throws MalformedURLException { Assertions.assertFalse(enforcer.apply(license), description); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicensesIT.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicensesIT.java index 4a43f5b46..fbb22de56 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicensesIT.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/dependencies/MavenProjectLicensesIT.java @@ -16,6 +16,11 @@ package com.mycila.maven.plugin.license.dependencies; import com.google.common.io.Files; +import java.io.File; +import java.io.IOException; +import java.util.Collections; +import java.util.Map; +import java.util.Optional; import org.apache.maven.it.VerificationException; import org.apache.maven.it.Verifier; import org.junit.jupiter.api.Assertions; @@ -23,13 +28,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.io.TempDir; -import java.io.File; -import java.io.IOException; -import java.util.Collections; -import java.util.Map; -import java.util.Optional; - - /** * We use {@link Verifier} here for mvn executions, mainly so: * a) we can verify a few cases that the invoker method make really difficult (I'd like to step-through with my IDE) @@ -120,4 +118,4 @@ void test_approved() throws IOException { Assertions.assertTrue(hasLogLine(LicenseMessage.INFO_DEPS_DISCOVERED + ": 1"), description); } -} \ No newline at end of file +} diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/document/DocumentTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/document/DocumentTest.java index 7a92b37a9..44e9d2a97 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/document/DocumentTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/document/DocumentTest.java @@ -18,16 +18,13 @@ import com.mycila.maven.plugin.license.header.Header; import com.mycila.maven.plugin.license.header.HeaderSource.UrlHeaderSource; import com.mycila.maven.plugin.license.util.FileUtils; - import java.io.File; import java.io.IOException; import java.util.Properties; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.BeforeAll; import org.junit.jupiter.api.Test; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java index 95b725591..e9549c48b 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/AdditionalHeaderDefinitionTest.java @@ -19,9 +19,7 @@ import com.mycila.maven.plugin.license.util.FileUtils; import com.mycila.xmltool.XMLDoc; import com.mycila.xmltool.XMLTag; - import java.io.File; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/DefaultHeaderDefinitionTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/DefaultHeaderDefinitionTest.java index 22b41b6bf..e61d075f3 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/DefaultHeaderDefinitionTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/DefaultHeaderDefinitionTest.java @@ -15,15 +15,14 @@ */ package com.mycila.maven.plugin.license.header; +import static java.lang.String.format; + import com.mycila.maven.plugin.license.header.HeaderSource.UrlHeaderSource; import com.mycila.maven.plugin.license.util.FileUtils; +import java.io.File; import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import java.io.File; - -import static java.lang.String.format; - /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) */ diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderParserTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderParserTest.java index 207456e40..050d5cc17 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderParserTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderParserTest.java @@ -16,9 +16,7 @@ package com.mycila.maven.plugin.license.header; import com.mycila.maven.plugin.license.util.FileContent; - import java.io.File; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderSourceTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderSourceTest.java index bfeb57d18..053b43c66 100644 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderSourceTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderSourceTest.java @@ -1,15 +1,13 @@ package com.mycila.maven.plugin.license.header; +import static com.mycila.maven.plugin.license.Multi.DEFAULT_SEPARATOR; + import com.mycila.maven.plugin.license.Multi; import com.mycila.maven.plugin.license.util.resource.ResourceFinder; - import java.nio.file.Paths; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; -import static com.mycila.maven.plugin.license.Multi.DEFAULT_SEPARATOR; - class HeaderSourceTest { private ResourceFinder finder = new ResourceFinder(Paths.get("src", "test", "resources")); diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderTest.java index 2ee88c3f2..fed275378 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/header/HeaderTest.java @@ -18,10 +18,8 @@ import com.mycila.maven.plugin.license.HeaderSection; import com.mycila.maven.plugin.license.header.HeaderSource.UrlHeaderSource; import com.mycila.maven.plugin.license.util.FileUtils; - import java.io.File; import java.io.IOException; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileContentTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileContentTest.java index 689fb3c69..073c24529 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileContentTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileContentTest.java @@ -16,7 +16,6 @@ package com.mycila.maven.plugin.license.util; import java.io.File; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileUtilsTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileUtilsTest.java index b8e347f1b..b9918ce18 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileUtilsTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/FileUtilsTest.java @@ -16,7 +16,6 @@ package com.mycila.maven.plugin.license.util; import java.io.File; - import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java index a8ed5ca89..eb4f208b8 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/SelectionTest.java @@ -15,13 +15,9 @@ */ package com.mycila.maven.plugin.license.util; -import com.mycila.maven.plugin.license.Default; -import org.apache.maven.plugin.logging.Log; -import org.apache.maven.plugin.logging.SystemStreamLog; -import org.apache.maven.shared.utils.io.DirectoryScanner; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; +import static java.util.Arrays.asList; +import com.mycila.maven.plugin.license.Default; import java.io.File; import java.io.FileWriter; import java.io.IOException; @@ -31,8 +27,11 @@ import java.util.Collections; import java.util.List; import java.util.UUID; - -import static java.util.Arrays.asList; +import org.apache.maven.plugin.logging.Log; +import org.apache.maven.plugin.logging.SystemStreamLog; +import org.apache.maven.shared.utils.io.DirectoryScanner; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; /** * @author Mathieu Carbou (mathieu.carbou@gmail.com) diff --git a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/resource/ResourceFinderTest.java b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/resource/ResourceFinderTest.java index 717e598e3..b676104d3 100755 --- a/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/resource/ResourceFinderTest.java +++ b/license-maven-plugin/src/test/java/com/mycila/maven/plugin/license/util/resource/ResourceFinderTest.java @@ -15,16 +15,15 @@ */ package com.mycila.maven.plugin.license.util.resource; -import org.apache.maven.plugin.MojoFailureException; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.BeforeAll; -import org.junit.jupiter.api.Test; - import java.net.URL; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.Arrays; +import org.apache.maven.plugin.MojoFailureException; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.Test; /** * @author Mathieu Carbou (mathieu.carbou@gmail.com)