From d77ebbe9b757ba0b638cf9eef26a6417e96c45e7 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Thu, 6 Apr 2023 11:38:46 +0200 Subject: [PATCH] Fix assembly-plugin warnings Don't override "finalName" anymore. This however changes the filenames of the generated binary distribution files. --- .ci/build.sh | 12 ++++++------ .ci/inc/pmd-doc.inc | 4 ++-- docs/pages/release_notes.md | 5 +++++ docs/pages/release_notes_pmd7.md | 3 +++ pmd-dist/pom.xml | 4 +--- pmd-dist/src/main/resources/assemblies/pmd-bin.xml | 2 +- pmd-dist/src/main/resources/assemblies/pmd-src.xml | 2 +- .../pmd/it/AbstractBinaryDistributionTest.java | 4 ++-- .../src/test/java/net/sourceforge/pmd/it/AntIT.java | 3 +-- .../java/net/sourceforge/pmd/it/PMDExecutor.java | 5 ++--- .../net/sourceforge/pmd/it/SourceDistributionIT.java | 2 +- pom.xml | 2 +- 12 files changed, 26 insertions(+), 22 deletions(-) diff --git a/.ci/build.sh b/.ci/build.sh index 5f4d321698..885913a303 100755 --- a/.ci/build.sh +++ b/.ci/build.sh @@ -177,8 +177,8 @@ function pmd_ci_build_run() { # function pmd_ci_deploy_build_artifacts() { # Deploy to sourceforge files https://sourceforge.net/projects/pmd/files/pmd/ - pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" - pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip" + pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip" if pmd_ci_maven_isReleaseBuild; then # create a draft github release @@ -186,8 +186,8 @@ function pmd_ci_deploy_build_artifacts() { GH_RELEASE="$RESULT" # Deploy to github releases - pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-bin-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" - pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-src-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-bin.zip" + pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "pmd-dist/target/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-src.zip" fi } @@ -201,11 +201,11 @@ function pmd_ci_build_and_upload_doc() { pmd_ci_sourceforge_uploadFile "pmd/${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" if pmd_ci_maven_isReleaseBuild; then - pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + pmd_ci_gh_releases_uploadAsset "$GH_RELEASE" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" fi # Deploy doc to https://docs.pmd-code.org/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/ - pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + pmd_code_uploadDocumentation "${PMD_CI_MAVEN_PROJECT_VERSION}" "docs/pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" # Deploy javadoc to https://docs.pmd-code.org/apidocs/*/${PMD_CI_MAVEN_PROJECT_VERSION}/ pmd_code_uploadJavadoc "${PMD_CI_MAVEN_PROJECT_VERSION}" "$(pwd)" diff --git a/.ci/inc/pmd-doc.inc b/.ci/inc/pmd-doc.inc index 4a6d5acc14..59c598ca50 100644 --- a/.ci/inc/pmd-doc.inc +++ b/.ci/inc/pmd-doc.inc @@ -35,8 +35,8 @@ function pmd_doc_create_archive() { echo -e "\n\n" pmd_ci_log_info "Creating pmd-doc archive..." mv _site "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}" - zip -qr "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/" - pmd_ci_log_success "Successfully created pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}.zip" + zip -qr "pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" "pmd-doc-${PMD_CI_MAVEN_PROJECT_VERSION}/" + pmd_ci_log_success "Successfully created pmd-dist-${PMD_CI_MAVEN_PROJECT_VERSION}-doc.zip" popd || exit 1 } diff --git a/docs/pages/release_notes.md b/docs/pages/release_notes.md index b875222f4d..33a2db3361 100644 --- a/docs/pages/release_notes.md +++ b/docs/pages/release_notes.md @@ -39,6 +39,11 @@ for all.

This section lists the most important changes from the last release candidate. The remaining section describe the complete release notes for 7.0.0. +Incompatible changes: +* The asset filenames of PMD on [GitHub Releases](https://github.com/pmd/pmd/releases) are + now `pmd-dist--bin.zip` and `pmd-dist--src.zip`. Keep that in mind, if you have an automated + download script. + Fixed Issues: * java-codestyle * [#4273](https://github.com/pmd/pmd/issues/4273): \[java] CommentDefaultAccessModifier ignoredAnnotations should include "org.junit.jupiter.api.extension.RegisterExtension" by default diff --git a/docs/pages/release_notes_pmd7.md b/docs/pages/release_notes_pmd7.md index 9f74c26e59..7e68c3925c 100644 --- a/docs/pages/release_notes_pmd7.md +++ b/docs/pages/release_notes_pmd7.md @@ -656,6 +656,9 @@ The following previously deprecated rules have been finally removed: to be reviewed. * Custom rules using rulechains: Need to override {% jdoc core::lang.rule.AbstractRule#buildTargetSelector() %} using {% jdoc core::lang.rule.RuleTargetSelector#forTypes(java.lang.Class,java.lang.Class...) %}. +* The asset filenames of PMD on [GitHub Releases](https://github.com/pmd/pmd/releases) are + now `pmd-dist--bin.zip` and `pmd-dist--src.zip`. Keep that in mind, if you have an automated + download script. ### For integrators diff --git a/pmd-dist/pom.xml b/pmd-dist/pom.xml index 554b2cb809..a136110ba3 100644 --- a/pmd-dist/pom.xml +++ b/pmd-dist/pom.xml @@ -42,7 +42,7 @@ maven-assembly-plugin - false + true false 493 @@ -56,7 +56,6 @@ single - ${pmd.dist.bin.baseDirectory} src/main/resources/assemblies/pmd-bin.xml @@ -69,7 +68,6 @@ single - pmd-src-${project.version} src/main/resources/assemblies/pmd-src.xml diff --git a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml index 2215aa3265..eb1c32057d 100644 --- a/pmd-dist/src/main/resources/assemblies/pmd-bin.xml +++ b/pmd-dist/src/main/resources/assemblies/pmd-bin.xml @@ -1,7 +1,7 @@ - pmd-bin + bin zip diff --git a/pmd-dist/src/main/resources/assemblies/pmd-src.xml b/pmd-dist/src/main/resources/assemblies/pmd-src.xml index a364b8f88f..0a5176637c 100644 --- a/pmd-dist/src/main/resources/assemblies/pmd-src.xml +++ b/pmd-dist/src/main/resources/assemblies/pmd-src.xml @@ -1,7 +1,7 @@ - pmd-src + src zip diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java index 5162c6f7dc..7a26392ff0 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AbstractBinaryDistributionTest.java @@ -15,10 +15,10 @@ import org.junit.jupiter.api.io.TempDir; import net.sourceforge.pmd.PMDVersion; abstract class AbstractBinaryDistributionTest { - public static final String PMD_BIN_PREFIX = "pmd-bin-"; + public static final String PMD_BIN_PREFIX = "pmd-bin-" + PMDVersion.VERSION; protected static File getBinaryDistribution() { - return new File(".", "target/" + PMD_BIN_PREFIX + PMDVersion.VERSION + ".zip"); + return new File(".", "target/pmd-dist-" + PMDVersion.VERSION + "-bin.zip"); } @TempDir diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java index bc4ca8be7d..e220d9d816 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/AntIT.java @@ -21,7 +21,6 @@ import org.junit.jupiter.api.Test; import org.junit.jupiter.api.condition.EnabledOnOs; import org.junit.jupiter.api.condition.OS; -import net.sourceforge.pmd.PMDVersion; import net.sourceforge.pmd.internal.util.IOUtil; /** @@ -36,7 +35,7 @@ class AntIT extends AbstractBinaryDistributionTest { @EnabledOnOs(OS.LINUX) void runAnt() throws IOException, InterruptedException { String antBasepath = new File("target/ant").getAbsolutePath(); - String pmdHome = tempDir.resolve(PMD_BIN_PREFIX + PMDVersion.VERSION).toAbsolutePath().toString(); + String pmdHome = tempDir.resolve(PMD_BIN_PREFIX).toAbsolutePath().toString(); File antTestProjectFolder = prepareAntTestProjectFolder(); ExecutionResult result = runAnt(antBasepath, pmdHome, antTestProjectFolder); diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java index ccc151ddc3..55a2fb9cca 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/PMDExecutor.java @@ -16,7 +16,6 @@ import java.util.concurrent.TimeUnit; import org.apache.commons.lang3.SystemUtils; -import net.sourceforge.pmd.PMDVersion; import net.sourceforge.pmd.internal.util.IOUtil; /** @@ -37,7 +36,7 @@ public class PMDExecutor { } private static ExecutionResult runPMDUnix(Path tempDir, Path reportFile, String... arguments) throws Exception { - String cmd = tempDir.resolve(AbstractBinaryDistributionTest.PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/pmd").toAbsolutePath().toString(); + String cmd = tempDir.resolve(AbstractBinaryDistributionTest.PMD_BIN_PREFIX + "/bin/pmd").toAbsolutePath().toString(); List args = new ArrayList<>(); args.add("check"); args.addAll(Arrays.asList(arguments)); @@ -45,7 +44,7 @@ public class PMDExecutor { } private static ExecutionResult runPMDWindows(Path tempDir, Path reportFile, String... arguments) throws Exception { - String cmd = tempDir.resolve(AbstractBinaryDistributionTest.PMD_BIN_PREFIX + PMDVersion.VERSION + "/bin/pmd.bat").toAbsolutePath().toString(); + String cmd = tempDir.resolve(AbstractBinaryDistributionTest.PMD_BIN_PREFIX + "/bin/pmd.bat").toAbsolutePath().toString(); List args = new ArrayList<>(); args.add("check"); args.addAll(Arrays.asList(arguments)); diff --git a/pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java b/pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java index d80ae52760..fea767d6b2 100644 --- a/pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java +++ b/pmd-dist/src/test/java/net/sourceforge/pmd/it/SourceDistributionIT.java @@ -20,7 +20,7 @@ class SourceDistributionIT { private static final String BASE_PATH = "pmd-src-" + PMDVersion.VERSION; private File getSourceDistribution() { - return new File(".", "target/" + BASE_PATH + ".zip"); + return new File(".", "target/pmd-dist-" + PMDVersion.VERSION + "-src.zip"); } @Test diff --git a/pom.xml b/pom.xml index a2b90df0c5..49e8c893dc 100644 --- a/pom.xml +++ b/pom.xml @@ -171,7 +171,7 @@ org.apache.maven.plugins maven-assembly-plugin - 3.4.2 + 3.5.0 org.apache.maven.plugins