From 4493fa05eadb35ba0fd1106ffba5ad84a83bbe44 Mon Sep 17 00:00:00 2001 From: Olga Maciaszek-Sharma Date: Fri, 26 Nov 2021 08:41:00 +0100 Subject: [PATCH 1/3] Add duplicate finder (#220) * Add duplicate finder to plugins and executions. * Add duplicate finder to plugins and executions. * Fix docs. --- docs/src/main/asciidoc/contributing.adoc | 51 +++++++++++++++++++++++ pom.xml | 52 ++++++++++++++++++++++++ 2 files changed, 103 insertions(+) diff --git a/docs/src/main/asciidoc/contributing.adoc b/docs/src/main/asciidoc/contributing.adoc index e36b0a49..71f8aab5 100644 --- a/docs/src/main/asciidoc/contributing.adoc +++ b/docs/src/main/asciidoc/contributing.adoc @@ -177,3 +177,54 @@ Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on t - `checkstyle.additional.suppressions.file` - this variable corresponds to suppressions in your local project. E.g. you're working on `spring-cloud-contract`. Then point to the `project-root/src/checkstyle/checkstyle-suppressions.xml` folder. Example for `spring-cloud-contract` would be: `/home/username/spring-cloud-contract/src/checkstyle/checkstyle-suppressions.xml`. IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources. + +=== Duplicate Finder + +Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath. + +==== Duplicate Finder configuration + +Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`. + +.pom.xml +[source,xml] +---- + + + + org.basepom.maven + duplicate-finder-maven-plugin + + + +---- + +For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation]. + +You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build. + +If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project: + +[source,xml] +---- + + + + org.basepom.maven + duplicate-finder-maven-plugin + + + org.joda.time.base.BaseDateTime + .*module-info + + + changelog.txt + + + + + + + +---- + diff --git a/pom.xml b/pom.xml index 45b0b45f..ef0ac77d 100644 --- a/pom.xml +++ b/pom.xml @@ -121,6 +121,24 @@ ${docs.classes.dir} readme.class.path 5.14.0.18788 + 1.5.0 + false + false + false + true + true + true + true + false + false + true + true + 2 + ${project.build.directory}/duplicate-finder-result.xml + false + sun.boot.class.path + true + false @@ -642,6 +660,40 @@ + + org.basepom.maven + duplicate-finder-maven-plugin + ${duplicate-finder-maven-plugin.version} + + + duplicate-validation + verify + + check + + + + + ${duplicate-finder-maven-plugin.printEqualFiles} + ${duplicate-finder-maven-plugin.failBuildInCaseOfDifferentContentConflict} + ${duplicate-finder-maven-plugin.failBuildInCaseOfEqualContentConflict} + ${duplicate-finder-maven-plugin.failBuildInCaseOfConflict} + ${duplicate-finder-maven-plugin.checkCompileClasspath} + ${duplicate-finder-maven-plugin.checkRuntimeClasspath} + ${duplicate-finder-maven-plugin.checkTestClasspath} + ${duplicate-finder-maven-plugin.skip} + ${duplicate-finder-maven-plugin.quiet} + ${duplicate-finder-maven-plugin.preferLocal} + ${duplicate-finder-maven-plugin.useResultFile} + ${duplicate-finder-maven-plugin.resultFileMinClasspathCount} + ${duplicate-finder-maven-plugin.resultFile} + ${duplicate-finder-maven-plugin.includeBootClasspath} + ${duplicate-finder-maven-plugin.bootClasspathProperty} + ${duplicate-finder-maven-plugin.useDefaultResourceIgnoreList} + ${duplicate-finder-maven-plugin.includePomProjects} + + + From ee66ee479198a7a32b936ee50e2b3505a3a55441 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Fri, 26 Nov 2021 08:12:59 +0000 Subject: [PATCH 2/3] Bumping versions --- README.adoc | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/README.adoc b/README.adoc index ac0a4bc5..910e42c7 100644 --- a/README.adoc +++ b/README.adoc @@ -227,6 +227,57 @@ Go to `File` -> `Settings` -> `Other settings` -> `Checkstyle`. There click on t IMPORTANT: Remember to set the `Scan Scope` to `All sources` since we apply checkstyle rules for production and test sources. +=== Duplicate Finder + +Spring Cloud Build brings along the `basepom:duplicate-finder-maven-plugin`, that enables flagging duplicate and conflicting classes and resources on the java classpath. + +==== Duplicate Finder configuration + +Duplicate finder is *enabled by default* and will run in the `verify` phase of your Maven build, but it will only take effect in your project if you add the `duplicate-finder-maven-plugin` to the `build` section of the projecst's `pom.xml`. + +.pom.xml +[source,xml] +---- + + + + org.basepom.maven + duplicate-finder-maven-plugin + + + +---- + +For other properties, we have set defaults as listed in the https://github.com/basepom/duplicate-finder-maven-plugin/wiki[plugin documentation]. + +You can easily override them but setting the value of the selected property prefixed with `duplicate-finder-maven-plugin`. For example, set `duplicate-finder-maven-plugin.skip` to `true` in order to skip duplicates check in your build. + +If you need to add `ignoredClassPatterns` or `ignoredResourcePatterns` to your setup, make sure to add them in the plugin configuration section of your project: + +[source,xml] +---- + + + + org.basepom.maven + duplicate-finder-maven-plugin + + + org.joda.time.base.BaseDateTime + .*module-info + + + changelog.txt + + + + + + + +---- + + == Flattening the POMs To avoid propagating build setup that is required to build a Spring Cloud project, we're using the maven flatten plugin. It has the advantage of letting you use whatever features you need while publishing "clean" pom to the repository. From b91b10a197d0aca30ca6ce436c5b81486e0041c9 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Mon, 29 Nov 2021 17:01:00 +0000 Subject: [PATCH 3/3] Bumping versions --- pom.xml | 2 +- spring-cloud-build-dependencies/pom.xml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ef0ac77d..b21b9853 100644 --- a/pom.xml +++ b/pom.xml @@ -28,7 +28,7 @@ ${java.version} ${basedir} ${project.artifactId} - 2.6.0 + 2.6.1 3.1.0-SNAPSHOT ${project.build.directory}/build-docs ${project.build.directory}/build-docs-classes diff --git a/spring-cloud-build-dependencies/pom.xml b/spring-cloud-build-dependencies/pom.xml index 89219250..d807c6b9 100644 --- a/spring-cloud-build-dependencies/pom.xml +++ b/spring-cloud-build-dependencies/pom.xml @@ -14,12 +14,12 @@ org.springframework.boot spring-boot-dependencies - 2.6.0 + 2.6.1 UTF-8 - 2.6.0 + 2.6.1