From 56a2298c8f7bbb925533412cc8ab9fa03f7e4199 Mon Sep 17 00:00:00 2001 From: Christopher Tubbs Date: Mon, 22 Jan 2024 13:30:16 -0500 Subject: [PATCH] Use parent POM --- .github/dependabot.yml | 18 + .github/workflows/maven.yaml | 25 +- pom.xml | 496 +----------------- .../java/net/revelc/code/impsort/Group.java | 4 +- .../java/net/revelc/code/impsort/Grouper.java | 4 +- .../java/net/revelc/code/impsort/ImpSort.java | 38 +- .../java/net/revelc/code/impsort/Import.java | 2 +- .../net/revelc/code/impsort/LineEnding.java | 3 +- .../java/net/revelc/code/impsort/Result.java | 2 +- .../code/impsort/ex/ImpSortException.java | 2 +- .../maven/plugin/AbstractImpSortMojo.java | 17 +- .../code/impsort/maven/plugin/CheckMojo.java | 6 +- .../code/impsort/maven/plugin/SortMojo.java | 6 +- .../m2e/lifecycle-mapping-metadata.xml | 2 +- .../META-INF/revelc/revelc-maven-plugin | 14 + src/site/markdown/index.md.vm | 20 +- src/site/site.xml | 20 +- .../net/revelc/code/impsort/ImpSortTest.java | 12 +- .../code/impsort/LineEndingEdgeCasesTest.java | 9 +- .../revelc/code/impsort/LineEndingTest.java | 3 +- .../maven/plugin/AbstractImpSortMojoTest.java | 6 +- src/test/resources/BasicPluginTests.java | 2 +- src/test/resources/EmptyJavadoc.java | 4 +- src/test/resources/FirstImportComment.java | 2 +- src/test/resources/Iso8859File.java | 2 +- src/test/resources/Java14Preview.java | 2 +- src/test/resources/UnusedImports.java | 2 +- src/tools/modified-google-style.xml | 20 +- 28 files changed, 149 insertions(+), 594 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 src/main/resources/META-INF/revelc/revelc-maven-plugin diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..77f8dbe --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,18 @@ +version: 2 +updates: +- package-ecosystem: maven + directory: "/" + schedule: + interval: weekly + groups: + maven: + patterns: + - "*" +- package-ecosystem: github-actions + directory: "/" + schedule: + interval: weekly + groups: + github-actions: + patterns: + - "*" diff --git a/.github/workflows/maven.yaml b/.github/workflows/maven.yaml index 98f8fd9..61d9994 100644 --- a/.github/workflows/maven.yaml +++ b/.github/workflows/maven.yaml @@ -1,15 +1,3 @@ -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - # This workflow will build a Java project with Maven # For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven @@ -26,23 +14,24 @@ jobs: strategy: matrix: os: [ubuntu-latest, windows-latest, macOS-latest] + java: [17] fail-fast: false runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v2 - - name: Set up JDK 11 - uses: actions/setup-java@v2 + - uses: actions/checkout@v3 + - name: Set up JDK + uses: actions/setup-java@v3 with: - java-version: 11 + java-version: ${{ matrix.java }} distribution: zulu - name: Cache local maven repository - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ~/.m2 key: ${{ matrix.os }}-m2-${{ hashFiles('**/pom.xml') }} restore-keys: ${{ matrix.os }}-m2 - name: Build with Maven - run: mvn -B -V -e "-Dstyle.color=always" verify + run: mvn -B -V -e "-Dstyle.color=always" verify -DskipFormat -DverifyFormat env: MAVEN_OPTS: -Djansi.force=true diff --git a/pom.xml b/pom.xml index c0011ca..aea6c2a 100644 --- a/pom.xml +++ b/pom.xml @@ -1,26 +1,27 @@ - + 4.0.0 - org.apache - apache - 29 + net.revelc.code + revelc + 5 - net.revelc.code impsort-maven-plugin 1.10.0-SNAPSHOT maven-plugin @@ -28,75 +29,22 @@ Sort your imps! A Maven plugin to sort the import statements in your Java source files. http://code.revelc.net/impsort-maven-plugin 2017 - - Revelc - https://github.com/revelc - - - - Apache-2.0 - http://www.apache.org/licenses/LICENSE-2.0 - - Christopher Tubbs - - - - 3.5.0 + 3.6.3 - scm:git:https://github.com/revelc/impsort-maven-plugin.git - scm:git:git@github.com:revelc/impsort-maven-plugin.git HEAD - https://github.com/revelc/impsort-maven-plugin - - GitHub - https://github.com/revelc/impsort-maven-plugin/issues - - - GitHub - https://github.com/revelc/impsort-maven-plugin/actions - - - - - sonatype-nexus-staging - Sonatype Release Distribution Staging Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - sonatype-nexus-snapshots - Sonatype Snapshot Distribution Repository - https://oss.sonatype.org/content/repositories/snapshots - - - 2.0.0-M7 - src/tools/modified-google-style.xml - impsort-maven-plugin - revelc + src/tools/modified-google-style.xml 3.25.5 - 11 - 11 - 11 - - true - 3.9.5 - 3.9.0 - 11 - 3.5.0 + 17 2023-05-10T00:07:12Z - UTF-8 - UTF-8 - 3.4.3 - source-release-tar - 3.1.2 @@ -110,21 +58,6 @@ guava 32.1.3-jre - - org.apache.maven - maven-core - ${maven.tools-version} - - - org.apache.maven - maven-plugin-api - ${maven.tools-version} - - - org.apache.maven.plugin-tools - maven-plugin-annotations - ${mavenPluginToolsVersion} - org.codehaus.plexus plexus-utils @@ -135,11 +68,6 @@ plexus-xml 3.0.0 - - org.junit.jupiter - junit-jupiter - 5.10.0 - @@ -155,142 +83,13 @@ org.codehaus.plexus plexus-utils - - org.apache.maven - maven-core - provided - - - org.apache.maven - maven-plugin-api - provided - - - org.apache.maven.plugin-tools - maven-plugin-annotations - provided - - - org.junit.jupiter - junit-jupiter - test - - - - org.codehaus.mojo - versions-maven-plugin - 2.16.0 - - - org.gaul - modernizer-maven-plugin - 2.7.0 - - ${maven.compiler.target} - - - - com.github.github - site-maven-plugin - 0.12 - - - com.github.ekryd.sortpom - sortpom-maven-plugin - 3.3.0 - - false - false - \n - 2 - recommended_2008_06 - scope,groupId,artifactId - true - true - - - - org.apache.maven.plugins - maven-site-plugin - 4.0.0-M10 - - - - org.apache.maven.skins - maven-fluido-skin - ${fluido.skin.version} - - - - - org.apache.maven.plugins - maven-compiler-plugin - 3.11.0 - - true - true - - -Xlint:all - -Xlint:-processing - -Xmaxwarns - 5 - - - - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.1 - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.6.0 - - true - all,-missing - - - - org.apache.maven.plugins - maven-release-plugin - 3.0.1 - - false - false - true - - - - net.revelc.code.formatter - formatter-maven-plugin - 2.23.0 - - LF - true - true - true - true - true - ${formatterConfigFile} - - - - net.revelc.code - impsort-maven-plugin - 1.9.0 - - java.,javax.,org.,com. - - org.apache.maven.plugins maven-checkstyle-plugin - 3.3.0 com.puppycrawl.tools @@ -299,80 +98,9 @@ - - com.github.spotbugs - spotbugs-maven-plugin - 4.7.3.6 - - true - Max - true - true - 20 - - - - org.apache.maven.plugins - maven-plugin-plugin - ${mavenPluginToolsVersion} - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${projectInfoReportsVersion} - - - net.revelc.code.formatter - formatter-maven-plugin - - - format-java-source - - format - - - - - - net.revelc.code - impsort-maven-plugin - - - sort-imports - - sort - - - - - - com.github.ekryd.sortpom - sortpom-maven-plugin - - - sort-pom - - sort - - validate - - - - - org.gaul - modernizer-maven-plugin - - - modernizer - - modernizer - - - - org.apache.maven.plugins maven-checkstyle-plugin @@ -400,194 +128,6 @@ - - org.apache.rat - apache-rat-plugin - - - check-licenses - - check - - - - - - com.github.github - site-maven-plugin - - - create-github-pages - - site - - site-deploy - - github - Creating site for ${project.version} - true - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - -Djava.io.tmpdir="${project.build.directory}" - - - - org.apache.maven.plugins - maven-plugin-plugin - - - default-descriptor - - descriptor - - - - help-goal - - helpmojo - - - - - - - - org.apache.maven.plugins - maven-plugin-report-plugin - ${mavenPluginToolsVersion} - - - org.apache.maven.plugins - maven-project-info-reports-plugin - ${projectInfoReportsVersion} - - - - - - eclipse - - - m2e.version - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - com.github.ekryd.sortpom - sortpom-maven-plugin - [0,) - - sort - - - - - - - - - org.gaul - modernizer-maven-plugin - [0,) - - modernizer - - - - - - - - - org.apache.maven.plugins - maven-enforcer-plugin - [0,) - - enforce - - - - - - - - - org.apache.maven.plugins - maven-remote-resources-plugin - [0,) - - process - - - - - - - - - org.apache.rat - apache-rat-plugin - [0,) - - check - - - - - - - - - org.apache.maven.plugins - maven-checkstyle-plugin - [0,) - - check - - - - - - - - - org.apache.maven.plugins - maven-plugin-plugin - [0,) - - descriptor - - - - - - - - - - - - - - - diff --git a/src/main/java/net/revelc/code/impsort/Group.java b/src/main/java/net/revelc/code/impsort/Group.java index 2506cb6..8ded2bb 100644 --- a/src/main/java/net/revelc/code/impsort/Group.java +++ b/src/main/java/net/revelc/code/impsort/Group.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -16,7 +16,7 @@ import java.util.Objects; -class Group { +final class Group { private final String groupPrefix; private final int order; diff --git a/src/main/java/net/revelc/code/impsort/Grouper.java b/src/main/java/net/revelc/code/impsort/Grouper.java index a6b9823..5735251 100644 --- a/src/main/java/net/revelc/code/impsort/Grouper.java +++ b/src/main/java/net/revelc/code/impsort/Grouper.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -28,7 +28,7 @@ import java.util.function.Predicate; import java.util.regex.Pattern; -public class Grouper { +public final class Grouper { private final List groups; private final List staticGroups; diff --git a/src/main/java/net/revelc/code/impsort/ImpSort.java b/src/main/java/net/revelc/code/impsort/ImpSort.java index f2fa244..9f3c1be 100644 --- a/src/main/java/net/revelc/code/impsort/ImpSort.java +++ b/src/main/java/net/revelc/code/impsort/ImpSort.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -17,24 +17,6 @@ import static com.github.javaparser.javadoc.JavadocBlockTag.Type.EXCEPTION; import static com.github.javaparser.javadoc.JavadocBlockTag.Type.THROWS; -import java.io.IOException; -import java.nio.charset.Charset; -import java.nio.file.Files; -import java.nio.file.Path; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.EnumSet; -import java.util.Iterator; -import java.util.LinkedHashSet; -import java.util.List; -import java.util.Optional; -import java.util.Scanner; -import java.util.Set; -import java.util.stream.Collectors; -import java.util.stream.Stream; -import java.util.stream.StreamSupport; - import com.github.javaparser.JavaParser; import com.github.javaparser.JavaToken; import com.github.javaparser.ParseResult; @@ -54,7 +36,23 @@ import com.github.javaparser.javadoc.description.JavadocDescription; import com.github.javaparser.javadoc.description.JavadocInlineTag; import com.github.javaparser.javadoc.description.JavadocSnippet; - +import java.io.IOException; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Path; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Comparator; +import java.util.EnumSet; +import java.util.Iterator; +import java.util.LinkedHashSet; +import java.util.List; +import java.util.Optional; +import java.util.Scanner; +import java.util.Set; +import java.util.stream.Collectors; +import java.util.stream.Stream; +import java.util.stream.StreamSupport; import net.revelc.code.impsort.ex.ImpSortException; import net.revelc.code.impsort.ex.ImpSortException.Reason; diff --git a/src/main/java/net/revelc/code/impsort/Import.java b/src/main/java/net/revelc/code/impsort/Import.java index 3f04e8d..e0bb2c4 100644 --- a/src/main/java/net/revelc/code/impsort/Import.java +++ b/src/main/java/net/revelc/code/impsort/Import.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/net/revelc/code/impsort/LineEnding.java b/src/main/java/net/revelc/code/impsort/LineEnding.java index 11d5a45..6fb8e2b 100644 --- a/src/main/java/net/revelc/code/impsort/LineEnding.java +++ b/src/main/java/net/revelc/code/impsort/LineEnding.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -11,6 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package net.revelc.code.impsort; /** diff --git a/src/main/java/net/revelc/code/impsort/Result.java b/src/main/java/net/revelc/code/impsort/Result.java index 6459898..1eec14e 100644 --- a/src/main/java/net/revelc/code/impsort/Result.java +++ b/src/main/java/net/revelc/code/impsort/Result.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/net/revelc/code/impsort/ex/ImpSortException.java b/src/main/java/net/revelc/code/impsort/ex/ImpSortException.java index d2f95a7..5e542e5 100644 --- a/src/main/java/net/revelc/code/impsort/ex/ImpSortException.java +++ b/src/main/java/net/revelc/code/impsort/ex/ImpSortException.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojo.java b/src/main/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojo.java index 88bda35..233882e 100644 --- a/src/main/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojo.java +++ b/src/main/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojo.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -14,6 +14,8 @@ package net.revelc.code.impsort.maven.plugin; +import com.github.javaparser.ParserConfiguration.LanguageLevel; +import com.google.common.hash.Hashing; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; @@ -32,7 +34,10 @@ import java.util.function.Function; import java.util.function.Predicate; import java.util.stream.Stream; - +import net.revelc.code.impsort.Grouper; +import net.revelc.code.impsort.ImpSort; +import net.revelc.code.impsort.LineEnding; +import net.revelc.code.impsort.Result; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; @@ -42,14 +47,6 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.DirectoryScanner; -import com.github.javaparser.ParserConfiguration.LanguageLevel; -import com.google.common.hash.Hashing; - -import net.revelc.code.impsort.Grouper; -import net.revelc.code.impsort.ImpSort; -import net.revelc.code.impsort.LineEnding; -import net.revelc.code.impsort.Result; - abstract class AbstractImpSortMojo extends AbstractMojo { private static final String[] DEFAULT_INCLUDES = new String[] {"**/*.java"}; diff --git a/src/main/java/net/revelc/code/impsort/maven/plugin/CheckMojo.java b/src/main/java/net/revelc/code/impsort/maven/plugin/CheckMojo.java index 101d067..cfce446 100644 --- a/src/main/java/net/revelc/code/impsort/maven/plugin/CheckMojo.java +++ b/src/main/java/net/revelc/code/impsort/maven/plugin/CheckMojo.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -15,14 +15,12 @@ package net.revelc.code.impsort.maven.plugin; import java.nio.file.Path; - +import net.revelc.code.impsort.Result; 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.ResolutionScope; -import net.revelc.code.impsort.Result; - @Mojo(name = "check", defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true, requiresDependencyResolution = ResolutionScope.NONE) public class CheckMojo extends AbstractImpSortMojo { diff --git a/src/main/java/net/revelc/code/impsort/maven/plugin/SortMojo.java b/src/main/java/net/revelc/code/impsort/maven/plugin/SortMojo.java index f1fcc3f..9a6c452 100644 --- a/src/main/java/net/revelc/code/impsort/maven/plugin/SortMojo.java +++ b/src/main/java/net/revelc/code/impsort/maven/plugin/SortMojo.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -16,14 +16,12 @@ import java.io.IOException; import java.nio.file.Path; - +import net.revelc.code.impsort.Result; 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.ResolutionScope; -import net.revelc.code.impsort.Result; - @Mojo(name = "sort", defaultPhase = LifecyclePhase.PROCESS_SOURCES, threadSafe = true, requiresDependencyResolution = ResolutionScope.NONE) public class SortMojo extends AbstractImpSortMojo { diff --git a/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml b/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml index 0170d60..608998d 100644 --- a/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml +++ b/src/main/resources/META-INF/m2e/lifecycle-mapping-metadata.xml @@ -5,7 +5,7 @@ you may not use this file except in compliance with the License. You may obtain a copy of the License at - http://www.apache.org/licenses/LICENSE-2.0 + https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/main/resources/META-INF/revelc/revelc-maven-plugin b/src/main/resources/META-INF/revelc/revelc-maven-plugin new file mode 100644 index 0000000..f919243 --- /dev/null +++ b/src/main/resources/META-INF/revelc/revelc-maven-plugin @@ -0,0 +1,14 @@ +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + diff --git a/src/site/markdown/index.md.vm b/src/site/markdown/index.md.vm index c9ed131..6797cb9 100644 --- a/src/site/markdown/index.md.vm +++ b/src/site/markdown/index.md.vm @@ -1,15 +1,17 @@ #set ($d = "$") diff --git a/src/site/site.xml b/src/site/site.xml index 9bf6cdd..5f5a590 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,16 +1,18 @@ diff --git a/src/test/java/net/revelc/code/impsort/ImpSortTest.java b/src/test/java/net/revelc/code/impsort/ImpSortTest.java index 4bbc4da..636709d 100644 --- a/src/test/java/net/revelc/code/impsort/ImpSortTest.java +++ b/src/test/java/net/revelc/code/impsort/ImpSortTest.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -19,6 +19,10 @@ import static org.junit.jupiter.api.Assertions.assertFalse; import static org.junit.jupiter.api.Assertions.assertTrue; +import com.github.javaparser.ParserConfiguration.LanguageLevel; +import com.github.javaparser.ast.PackageDeclaration; +import com.github.javaparser.ast.expr.Name; +import com.google.common.primitives.Bytes; import java.io.File; import java.io.IOException; import java.nio.charset.StandardCharsets; @@ -34,14 +38,8 @@ import java.util.TreeSet; import java.util.stream.Collectors; import java.util.stream.Stream; - import org.junit.jupiter.api.Test; -import com.github.javaparser.ParserConfiguration.LanguageLevel; -import com.github.javaparser.ast.PackageDeclaration; -import com.github.javaparser.ast.expr.Name; -import com.google.common.primitives.Bytes; - public class ImpSortTest { private static Grouper eclipseDefaults = diff --git a/src/test/java/net/revelc/code/impsort/LineEndingEdgeCasesTest.java b/src/test/java/net/revelc/code/impsort/LineEndingEdgeCasesTest.java index 4fc198c..04c10b9 100644 --- a/src/test/java/net/revelc/code/impsort/LineEndingEdgeCasesTest.java +++ b/src/test/java/net/revelc/code/impsort/LineEndingEdgeCasesTest.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -11,6 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package net.revelc.code.impsort; import static java.nio.charset.StandardCharsets.UTF_8; @@ -24,12 +25,10 @@ import java.nio.file.Files; import java.nio.file.NoSuchFileException; import java.nio.file.Path; - -import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.io.TempDir; - import net.revelc.code.impsort.ex.ImpSortException; import net.revelc.code.impsort.ex.ImpSortException.Reason; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.io.TempDir; /** * Test class for special file cases. diff --git a/src/test/java/net/revelc/code/impsort/LineEndingTest.java b/src/test/java/net/revelc/code/impsort/LineEndingTest.java index 21fae55..153be38 100644 --- a/src/test/java/net/revelc/code/impsort/LineEndingTest.java +++ b/src/test/java/net/revelc/code/impsort/LineEndingTest.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -11,6 +11,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ + package net.revelc.code.impsort; import static org.junit.jupiter.api.Assertions.assertEquals; diff --git a/src/test/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojoTest.java b/src/test/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojoTest.java index 7d0a3ed..3e15caf 100644 --- a/src/test/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojoTest.java +++ b/src/test/java/net/revelc/code/impsort/maven/plugin/AbstractImpSortMojoTest.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -19,14 +19,12 @@ import static org.junit.jupiter.api.Assertions.assertThrows; import static org.junit.jupiter.api.Assertions.assertTrue; +import com.github.javaparser.ParserConfiguration.LanguageLevel; import java.util.Arrays; import java.util.Set; import java.util.TreeSet; - import org.junit.jupiter.api.Test; -import com.github.javaparser.ParserConfiguration.LanguageLevel; - public class AbstractImpSortMojoTest { @Test diff --git a/src/test/resources/BasicPluginTests.java b/src/test/resources/BasicPluginTests.java index 66bad60..323e2b7 100644 --- a/src/test/resources/BasicPluginTests.java +++ b/src/test/resources/BasicPluginTests.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/test/resources/EmptyJavadoc.java b/src/test/resources/EmptyJavadoc.java index aaa2a96..4a44326 100644 --- a/src/test/resources/EmptyJavadoc.java +++ b/src/test/resources/EmptyJavadoc.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, @@ -20,4 +20,4 @@ */ public class SomeClass { List something = new ArrayList(); -} \ No newline at end of file +} diff --git a/src/test/resources/FirstImportComment.java b/src/test/resources/FirstImportComment.java index 4ca1705..d9708d3 100644 --- a/src/test/resources/FirstImportComment.java +++ b/src/test/resources/FirstImportComment.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/test/resources/Iso8859File.java b/src/test/resources/Iso8859File.java index d7570fe..f4cc306 100644 --- a/src/test/resources/Iso8859File.java +++ b/src/test/resources/Iso8859File.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/test/resources/Java14Preview.java b/src/test/resources/Java14Preview.java index 2ae281d..4d4ba6e 100644 --- a/src/test/resources/Java14Preview.java +++ b/src/test/resources/Java14Preview.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/test/resources/UnusedImports.java b/src/test/resources/UnusedImports.java index dafb502..5d5fb17 100644 --- a/src/test/resources/UnusedImports.java +++ b/src/test/resources/UnusedImports.java @@ -3,7 +3,7 @@ * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * https://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, diff --git a/src/tools/modified-google-style.xml b/src/tools/modified-google-style.xml index b854e3e..3934155 100644 --- a/src/tools/modified-google-style.xml +++ b/src/tools/modified-google-style.xml @@ -1,16 +1,18 @@