From b660af50c56fbf5f64a6b2cb77c8b137b6fb8cba Mon Sep 17 00:00:00 2001 From: Christopher Tubbs Date: Mon, 22 Jan 2024 14:00:59 -0500 Subject: [PATCH] Use parent POM --- .github/dependabot.yml | 18 + .github/workflows/maven.yaml | 26 +- contrib/eclipse-java-style.xml | 15 + pom.xml | 458 +----------------- src/it/accumulo/invoker.properties | 4 +- src/it/accumulo/pom.xml | 20 +- src/it/accumulo/postbuild.groovy | 2 +- src/it/basic/invoker.properties | 4 +- src/it/basic/pom.xml | 20 +- src/it/basic/postbuild.groovy | 2 +- .../net/revelc/code/apilyzer/it/Noop.java | 2 +- src/it/guava/invoker.properties | 4 +- src/it/guava/pom.xml | 20 +- src/it/guava/postbuild.groovy | 2 +- src/it/hadoop/invoker.properties | 4 +- src/it/hadoop/pom.xml | 20 +- src/it/hadoop/postbuild.groovy | 2 +- src/it/hbase/invoker.properties | 4 +- src/it/hbase/pom.xml | 20 +- src/it/hbase/postbuild.groovy | 2 +- src/it/settings.xml | 20 +- .../apilyzer/maven/plugin/AnalyzeMojo.java | 2 +- .../apilyzer/maven/plugin/PatternSet.java | 2 +- .../META-INF/revelc/revelc-maven-plugin | 14 + src/site/markdown/index.md.vm | 35 +- src/site/site.xml | 37 +- 26 files changed, 197 insertions(+), 562 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 d456a91..5e45454 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,22 +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@v1 + - uses: actions/checkout@v4 + - name: Set up JDK + uses: actions/setup-java@v4 with: - java-version: 11 + java-version: ${{ matrix.java }} + distribution: zulu - name: Cache local maven repository - uses: actions/cache@v2 + uses: actions/cache@v4 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/contrib/eclipse-java-style.xml b/contrib/eclipse-java-style.xml index 9f6222d..234d144 100644 --- a/contrib/eclipse-java-style.xml +++ b/contrib/eclipse-java-style.xml @@ -1,4 +1,19 @@ + diff --git a/pom.xml b/pom.xml index 6e1e889..0548329 100644 --- a/pom.xml +++ b/pom.xml @@ -1,42 +1,32 @@ 4.0.0 - org.apache - apache - 29 + net.revelc.code + revelc + 5 - net.revelc.code apilyzer-maven-plugin 1.3.1-SNAPSHOT maven-plugin APILyzer Maven Plugin A Maven plugin for analyzing types used by a declared public API https://code.revelc.net/apilyzer-maven-plugin - - Revelc - https://github.com/revelc - - - - Apache License, Version 2.0 - https://www.apache.org/licenses/LICENSE-2.0 - repo - - Christopher Tubbs @@ -45,90 +35,23 @@ Keith Turner - - - - 3.6.0 + 3.6.3 - scm:git:https://github.com/revelc/apilyzer-maven-plugin.git - scm:git:git@github.com:revelc/apilyzer-maven-plugin.git HEAD - https://github.com/revelc/apilyzer-maven-plugin - - GitHub - https://github.com/revelc/apilyzer-maven-plugin/issues - - - GitHub - https://github.com/revelc/apilyzer-maven-plugin/actions - - - - - oss.releases.https - Sonatype Release Distribution Staging Repository - https://oss.sonatype.org/service/local/staging/deploy/maven2 - - - oss.snapshots.https - Sonatype Snapshot Distribution Repository - https://oss.sonatype.org/content/repositories/snapshots - - - 2.0.0-M6 - contrib/eclipse-java-style.xml - true - true - true - true - true + contrib/eclipse-java-style.xml true 8 - 1.8 - 1.8 - true - - true - 3.9.2 - 3.9.0 - - 11 - - 3.6.0 - UTF-8 - UTF-8 - 3.1.0 com.google.guava guava - 32.0.0-jre - - - junit - junit - 4.13.2 - - - 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} + 33.0.0-jre @@ -137,215 +60,9 @@ com.google.guava guava - - org.apache.maven.plugin-tools - maven-plugin-annotations - - - org.apache.maven - maven-core - provided - - - org.apache.maven - maven-plugin-api - provided - - - junit - junit - test - - - - - com.github.github - site-maven-plugin - 0.12 - - - net.revelc.code - impsort-maven-plugin - 1.9.0 - - - net.revelc.code.formatter - formatter-maven-plugin - 2.22.0 - - - org.apache.maven.plugins - maven-checkstyle-plugin - 3.3.0 - - - com.puppycrawl.tools - checkstyle - 10.11.0 - - - - - com.github.ekryd.sortpom - sortpom-maven-plugin - 3.2.1 - - false - false - \n - 2 - recommended_2008_06 - scope,groupId,artifactId - true - true - Stop - - - - 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.3.0 - - - org.apache.maven.plugins - maven-javadoc-plugin - 3.5.0 - - - org.apache.maven.plugins - maven-plugin-plugin - ${mavenPluginToolsVersion} - - - org.apache.maven.plugins - maven-release-plugin - 3.0.0 - - false - false - true - - - - org.apache.maven.plugins - maven-remote-resources-plugin - 3.1.0 - - - org.apache.maven.plugins - maven-resources-plugin - 3.3.1 - - - org.apache.maven.plugins - maven-scm-plugin - 2.0.1 - - - org.apache.maven.plugins - maven-site-plugin - 4.0.0-M8 - - - - org.apache.maven.skins - maven-fluido-skin - ${fluido.skin.version} - - - - - - - org.apache.rat - apache-rat-plugin - - - check-licenses - - check - - - - ${formatter.config} - - - - - - - com.github.ekryd.sortpom - sortpom-maven-plugin - - - sort-and-verify-pom - - sort - verify - - validate - - - - - org.apache.maven.plugins - maven-failsafe-plugin - - - run-integration-tests - - integration-test - verify - - - - - - net.revelc.code.formatter - formatter-maven-plugin - - - format-source - - format - - - ${project.basedir}/${formatter.config} - LF - - - - - - net.revelc.code - impsort-maven-plugin - - - sort-imports - - sort - - - - org.apache.maven.plugins maven-checkstyle-plugin @@ -353,7 +70,15 @@ google_checks.xml warning true + **/HelpMojo.java + + + com.puppycrawl.tools + checkstyle + 10.12.7 + + check-style @@ -363,139 +88,6 @@ - - org.apache.maven.plugins - maven-invoker-plugin - - - integration-test - - install - run - - - ${project.build.directory}/it - - */pom.xml - - ${project.build.directory}/local-repo - src/it/settings.xml - - - - - - com.github.github - site-maven-plugin - - - - site - - site-deploy - - github - Creating site for ${project.version} - true - - - - - - - - org.apache.maven.plugins - maven-plugin-report-plugin - ${mavenPluginToolsVersion} - - - org.apache.maven.plugins - maven-project-info-reports-plugin - 3.4.3 - - - - - - m2e - - - m2e.version - - - - - - - - org.eclipse.m2e - lifecycle-mapping - 1.0.0 - - - - - - com.github.ekryd.sortpom - sortpom-maven-plugin - [0,) - - sort - verify - - - - - - - - - org.apache.maven.plugins - maven-invoker-plugin - [0,) - - install - - - - - - - - - org.apache.maven.plugins - maven-remote-resources-plugin - [0,) - - process - - - - - - - - - org.apache.rat - apache-rat-plugin - [0,) - - check - - - - - - - - - - - - - - - diff --git a/src/it/accumulo/invoker.properties b/src/it/accumulo/invoker.properties index 0f8a314..441c4c1 100644 --- a/src/it/accumulo/invoker.properties +++ b/src/it/accumulo/invoker.properties @@ -1,14 +1,16 @@ +# # 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 +# 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. +# invoker.goals = -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean verify invoker.buildResult = failure diff --git a/src/it/accumulo/pom.xml b/src/it/accumulo/pom.xml index b090d41..0edaa77 100644 --- a/src/it/accumulo/pom.xml +++ b/src/it/accumulo/pom.xml @@ -1,16 +1,18 @@ 4.0.0 diff --git a/src/it/accumulo/postbuild.groovy b/src/it/accumulo/postbuild.groovy index bce4801..7b5dedd 100644 --- a/src/it/accumulo/postbuild.groovy +++ b/src/it/accumulo/postbuild.groovy @@ -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/it/basic/invoker.properties b/src/it/basic/invoker.properties index e930c13..f8e47c7 100644 --- a/src/it/basic/invoker.properties +++ b/src/it/basic/invoker.properties @@ -1,14 +1,16 @@ +# # 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 +# 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. +# invoker.goals = -e -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean verify invoker.buildResult = success diff --git a/src/it/basic/pom.xml b/src/it/basic/pom.xml index 2d3ef08..e64e81a 100644 --- a/src/it/basic/pom.xml +++ b/src/it/basic/pom.xml @@ -1,16 +1,18 @@ 4.0.0 diff --git a/src/it/basic/postbuild.groovy b/src/it/basic/postbuild.groovy index 014e236..c51f44a 100644 --- a/src/it/basic/postbuild.groovy +++ b/src/it/basic/postbuild.groovy @@ -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/it/basic/src/main/java/net/revelc/code/apilyzer/it/Noop.java b/src/it/basic/src/main/java/net/revelc/code/apilyzer/it/Noop.java index 9783f5f..e228445 100644 --- a/src/it/basic/src/main/java/net/revelc/code/apilyzer/it/Noop.java +++ b/src/it/basic/src/main/java/net/revelc/code/apilyzer/it/Noop.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/it/guava/invoker.properties b/src/it/guava/invoker.properties index 0f8a314..441c4c1 100644 --- a/src/it/guava/invoker.properties +++ b/src/it/guava/invoker.properties @@ -1,14 +1,16 @@ +# # 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 +# 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. +# invoker.goals = -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean verify invoker.buildResult = failure diff --git a/src/it/guava/pom.xml b/src/it/guava/pom.xml index f1a4f87..24c1254 100644 --- a/src/it/guava/pom.xml +++ b/src/it/guava/pom.xml @@ -1,16 +1,18 @@ 4.0.0 diff --git a/src/it/guava/postbuild.groovy b/src/it/guava/postbuild.groovy index edc1e70..086fad1 100644 --- a/src/it/guava/postbuild.groovy +++ b/src/it/guava/postbuild.groovy @@ -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/it/hadoop/invoker.properties b/src/it/hadoop/invoker.properties index 7b2f062..5458ff9 100644 --- a/src/it/hadoop/invoker.properties +++ b/src/it/hadoop/invoker.properties @@ -1,14 +1,16 @@ +# # 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 +# 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. +# invoker.goals = -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean verify invoker.buildResult = success diff --git a/src/it/hadoop/pom.xml b/src/it/hadoop/pom.xml index 9a5b99b..12a0aa3 100644 --- a/src/it/hadoop/pom.xml +++ b/src/it/hadoop/pom.xml @@ -1,16 +1,18 @@ 4.0.0 diff --git a/src/it/hadoop/postbuild.groovy b/src/it/hadoop/postbuild.groovy index 1d1a8ce..0d7cd12 100644 --- a/src/it/hadoop/postbuild.groovy +++ b/src/it/hadoop/postbuild.groovy @@ -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/it/hbase/invoker.properties b/src/it/hbase/invoker.properties index 0f8a314..441c4c1 100644 --- a/src/it/hbase/invoker.properties +++ b/src/it/hbase/invoker.properties @@ -1,14 +1,16 @@ +# # 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 +# 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. +# invoker.goals = -Dorg.slf4j.simpleLogger.log.org.apache.maven.cli.transfer.Slf4jMavenTransferListener=warn clean verify invoker.buildResult = failure diff --git a/src/it/hbase/pom.xml b/src/it/hbase/pom.xml index 3ca8a9e..c518baf 100644 --- a/src/it/hbase/pom.xml +++ b/src/it/hbase/pom.xml @@ -1,16 +1,18 @@ 4.0.0 diff --git a/src/it/hbase/postbuild.groovy b/src/it/hbase/postbuild.groovy index 6e10375..bb6845a 100644 --- a/src/it/hbase/postbuild.groovy +++ b/src/it/hbase/postbuild.groovy @@ -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/it/settings.xml b/src/it/settings.xml index 64e32fe..072dddf 100644 --- a/src/it/settings.xml +++ b/src/it/settings.xml @@ -1,16 +1,18 @@ diff --git a/src/main/java/net/revelc/code/apilyzer/maven/plugin/AnalyzeMojo.java b/src/main/java/net/revelc/code/apilyzer/maven/plugin/AnalyzeMojo.java index 3168c2f..f520ab9 100644 --- a/src/main/java/net/revelc/code/apilyzer/maven/plugin/AnalyzeMojo.java +++ b/src/main/java/net/revelc/code/apilyzer/maven/plugin/AnalyzeMojo.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/apilyzer/maven/plugin/PatternSet.java b/src/main/java/net/revelc/code/apilyzer/maven/plugin/PatternSet.java index 5195114..6f8ef4c 100644 --- a/src/main/java/net/revelc/code/apilyzer/maven/plugin/PatternSet.java +++ b/src/main/java/net/revelc/code/apilyzer/maven/plugin/PatternSet.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/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 d4e811d..6a1e841 100644 --- a/src/site/markdown/index.md.vm +++ b/src/site/markdown/index.md.vm @@ -1,25 +1,25 @@ -Description ------------ +## Description A simple maven plugin that detects some illegal changes to a Java project's API. -How it works ------------- +## How it works APILyzer looks for deviations from the following rules. @@ -32,8 +32,7 @@ How it works public inner classes. Protected classes and members are treated as public during analysis. -Other tools ------------ +## Other tools This tool fills a niche not covered by other tools, like [Animal Sniffer][1] and [checkstyle import control][2]. A project that wants to ensure API @@ -43,8 +42,7 @@ Other tools signatures of a previous API differs because it only validates that the old API is not broken. -How to use it -------------- +## How to use it To add this plugin to your project, configure the plugin similarly to: @@ -135,8 +133,7 @@ which is not a public API type. The second problem is `MiniAccumuloInstance.lookupInstanceName()` takes a parameter of type `ZooCache` which is not a public API type. -Annotation Example ------------------- +## Annotation Example Hadoop has two annotations that it uses to communicate who should use its APIs. First, the `InterfaceAudience` annotation has values of `Public`, `LimitedPrivate`, and `Private`. Second, the diff --git a/src/site/site.xml b/src/site/site.xml index 734c377..789eb1d 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,34 +1,27 @@ org.apache.maven.skins maven-fluido-skin - ${fluido.skin.version} + ${version.maven-fluido-skin} - - - revelc/apilyzer-maven-plugin - right - - - - - true true @@ -39,11 +32,5 @@ -