From 51f70f875f5bde578df1ca066665bef906507402 Mon Sep 17 00:00:00 2001 From: Christoph Pirkl Date: Tue, 24 Oct 2023 08:07:36 +0200 Subject: [PATCH] #480 Remove implicit plugins from dependencies.md (#481) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Sebastian Bär --- dependencies.md | 420 ++++++++---------- doc/changes/changelog.md | 1 + doc/changes/changes_2.9.13.md | 132 ++++++ doc/design.md | 16 +- maven-project-crawler/pk_generated_parent.pom | 31 +- maven-project-crawler/pom.xml | 7 +- .../MavenProjectCrawlerMojo.java | 4 +- .../changesfile/DependencyUpdateReader.java | 11 +- .../changesfile/LastReleasePomFileReader.java | 6 +- .../DependencyChangeReportReader.java | 5 +- .../dependencies/ProjectDependencyReader.java | 61 ++- .../ProjectDependencyReaderTest.java | 91 ++++ parent-pom/pom.xml | 10 +- pom.xml | 22 +- project-keeper-cli/pk_generated_parent.pom | 31 +- .../pk_generated_parent.pom | 31 +- project-keeper/pk_generated_parent.pom | 31 +- project-keeper/pom.xml | 11 - .../stream/CollectingConsumer.java | 2 +- .../dependencies/DependenciesValidator.java | 2 +- .../validators/pom/PomFileGenerator.java | 3 +- .../error-code-crawler-maven-plugin.xml | 2 +- .../maven_templates/jacoco-maven-plugin.xml | 2 +- .../maven_templates/maven-enforcer-plugin.xml | 20 - .../maven_templates/maven-javadoc-plugin.xml | 3 +- .../maven_templates/sonar-maven-plugin.xml | 4 +- .../maven_templates/versions-maven-plugin.xml | 2 +- .../dependencies/DependenciesValidatorIT.java | 19 +- .../validators/pom/PomFileGeneratorTest.java | 10 +- shared-model-classes/pk_generated_parent.pom | 31 +- shared-test-setup/pk_generated_parent.pom | 28 +- 31 files changed, 570 insertions(+), 479 deletions(-) create mode 100644 doc/changes/changes_2.9.13.md create mode 100644 maven-project-crawler/src/test/java/com/exasol/projectkeeper/dependencies/ProjectDependencyReaderTest.java delete mode 100644 project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml diff --git a/dependencies.md b/dependencies.md index 9323297b..2bbbb626 100644 --- a/dependencies.md +++ b/dependencies.md @@ -22,34 +22,28 @@ | [Hamcrest][12] | [BSD License 3][13] | | [JUnit5 System Extensions][14] | [Eclipse Public License v2.0][5] | | [EqualsVerifier \| release normal jar][15] | [Apache License, Version 2.0][16] | -| [mockito-core][17] | [The MIT License][18] | +| [mockito-core][17] | [MIT][18] | | [SLF4J JDK14 Binding][19] | [MIT License][20] | ### Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | -| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | -| [Apache Maven Enforcer Plugin][24] | [Apache-2.0][16] | -| [Maven Flatten Plugin][25] | [Apache Software Licenese][16] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][26] | [ASL2][27] | -| [Maven Surefire Plugin][28] | [Apache-2.0][16] | -| [Versions Maven Plugin][29] | [Apache License, Version 2.0][16] | -| [duplicate-finder-maven-plugin Maven Mojo][30] | [Apache License 2.0][31] | -| [Apache Maven Deploy Plugin][32] | [Apache-2.0][16] | -| [Apache Maven GPG Plugin][33] | [Apache-2.0][16] | -| [Apache Maven Source Plugin][34] | [Apache License, Version 2.0][16] | -| [Apache Maven Javadoc Plugin][35] | [Apache-2.0][16] | -| [Nexus Staging Maven Plugin][36] | [Eclipse Public License][37] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][39] | -| [error-code-crawler-maven-plugin][40] | [MIT License][41] | -| [Reproducible Build Maven Plugin][42] | [Apache 2.0][27] | -| [Maven Clean Plugin][43] | [The Apache Software License, Version 2.0][27] | -| [Maven Resources Plugin][44] | [The Apache Software License, Version 2.0][27] | -| [Maven JAR Plugin][45] | [The Apache Software License, Version 2.0][27] | -| [Maven Install Plugin][46] | [The Apache Software License, Version 2.0][27] | -| [Maven Site Plugin 3][47] | [The Apache Software License, Version 2.0][27] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | +| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | +| [Maven Flatten Plugin][24] | [Apache Software Licenese][16] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][25] | [ASL2][26] | +| [Maven Surefire Plugin][27] | [Apache-2.0][16] | +| [Versions Maven Plugin][28] | [Apache License, Version 2.0][16] | +| [duplicate-finder-maven-plugin Maven Mojo][29] | [Apache License 2.0][30] | +| [Apache Maven Deploy Plugin][31] | [Apache-2.0][16] | +| [Apache Maven GPG Plugin][32] | [Apache-2.0][16] | +| [Apache Maven Source Plugin][33] | [Apache License, Version 2.0][16] | +| [Apache Maven Javadoc Plugin][34] | [Apache-2.0][16] | +| [Nexus Staging Maven Plugin][35] | [Eclipse Public License][36] | +| [JaCoCo :: Maven Plugin][37] | [Eclipse Public License 2.0][38] | +| [error-code-crawler-maven-plugin][39] | [MIT License][40] | +| [Reproducible Build Maven Plugin][41] | [Apache 2.0][26] | ## Project Keeper Core @@ -57,26 +51,26 @@ | Dependency | License | | ----------------------------------------- | ---------------------------------------------- | -| [Project-Keeper shared model classes][48] | [The MIT License][49] | -| [org.xmlunit:xmlunit-core][50] | [The Apache Software License, Version 2.0][27] | +| [Project-Keeper shared model classes][42] | [The MIT License][43] | +| [org.xmlunit:xmlunit-core][44] | [The Apache Software License, Version 2.0][26] | | [error-reporting-java][7] | [MIT License][8] | -| [Markdown Generator][51] | [The Apache Software License, Version 2.0][27] | -| [semver4j][52] | [The MIT License][20] | -| [SnakeYAML][53] | [Apache License, Version 2.0][27] | -| [Maven Model][54] | [Apache-2.0][16] | +| [Markdown Generator][45] | [The Apache Software License, Version 2.0][26] | +| [semver4j][46] | [The MIT License][20] | +| [SnakeYAML][47] | [Apache License, Version 2.0][26] | +| [Maven Model][48] | [Apache-2.0][16] | ### Test Dependencies | Dependency | License | | ------------------------------------------ | ---------------------------------------------- | -| [Project Keeper shared test setup][48] | [The MIT License][49] | -| [Maven Project Version Getter][55] | [MIT License][56] | +| [Project Keeper shared test setup][42] | [The MIT License][43] | +| [Maven Project Version Getter][49] | [MIT License][50] | | [JUnit Jupiter Engine][10] | [Eclipse Public License v2.0][11] | | [JUnit Jupiter Params][10] | [Eclipse Public License v2.0][11] | | [Hamcrest][12] | [BSD License 3][13] | -| [org.xmlunit:xmlunit-matchers][50] | [The Apache Software License, Version 2.0][27] | -| [mockito-junit-jupiter][17] | [The MIT License][18] | -| [Maven Plugin Integration Testing][57] | [MIT License][58] | +| [org.xmlunit:xmlunit-matchers][44] | [The Apache Software License, Version 2.0][26] | +| [mockito-junit-jupiter][17] | [MIT][18] | +| [Maven Plugin Integration Testing][51] | [MIT License][52] | | [EqualsVerifier \| release normal jar][15] | [Apache License, Version 2.0][16] | | [SLF4J JDK14 Binding][19] | [MIT License][20] | @@ -84,34 +78,29 @@ | Dependency | License | | ----------------------------------------- | --------------------- | -| [Project keeper Java project crawler][48] | [The MIT License][49] | +| [Project keeper Java project crawler][42] | [The MIT License][43] | ### Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | -| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | -| [Apache Maven Enforcer Plugin][24] | [Apache-2.0][16] | -| [Maven Flatten Plugin][25] | [Apache Software Licenese][16] | -| [Apache Maven JAR Plugin][59] | [Apache License, Version 2.0][16] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][26] | [ASL2][27] | -| [Maven Surefire Plugin][28] | [Apache-2.0][16] | -| [Versions Maven Plugin][29] | [Apache License, Version 2.0][16] | -| [duplicate-finder-maven-plugin Maven Mojo][30] | [Apache License 2.0][31] | -| [Apache Maven Deploy Plugin][32] | [Apache-2.0][16] | -| [Apache Maven GPG Plugin][33] | [Apache-2.0][16] | -| [Apache Maven Source Plugin][34] | [Apache License, Version 2.0][16] | -| [Apache Maven Javadoc Plugin][35] | [Apache-2.0][16] | -| [Nexus Staging Maven Plugin][36] | [Eclipse Public License][37] | -| [Maven Failsafe Plugin][60] | [Apache-2.0][16] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][39] | -| [error-code-crawler-maven-plugin][40] | [MIT License][41] | -| [Reproducible Build Maven Plugin][42] | [Apache 2.0][27] | -| [Maven Clean Plugin][43] | [The Apache Software License, Version 2.0][27] | -| [Maven Resources Plugin][44] | [The Apache Software License, Version 2.0][27] | -| [Maven Install Plugin][46] | [The Apache Software License, Version 2.0][27] | -| [Maven Site Plugin 3][47] | [The Apache Software License, Version 2.0][27] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | +| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | +| [Maven Flatten Plugin][24] | [Apache Software Licenese][16] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][25] | [ASL2][26] | +| [Maven Surefire Plugin][27] | [Apache-2.0][16] | +| [Versions Maven Plugin][28] | [Apache License, Version 2.0][16] | +| [duplicate-finder-maven-plugin Maven Mojo][29] | [Apache License 2.0][30] | +| [Apache Maven Deploy Plugin][31] | [Apache-2.0][16] | +| [Apache Maven GPG Plugin][32] | [Apache-2.0][16] | +| [Apache Maven Source Plugin][33] | [Apache License, Version 2.0][16] | +| [Apache Maven Javadoc Plugin][34] | [Apache-2.0][16] | +| [Nexus Staging Maven Plugin][35] | [Eclipse Public License][36] | +| [Maven Failsafe Plugin][53] | [Apache-2.0][16] | +| [JaCoCo :: Maven Plugin][37] | [Eclipse Public License 2.0][38] | +| [error-code-crawler-maven-plugin][39] | [MIT License][40] | +| [Reproducible Build Maven Plugin][41] | [Apache 2.0][26] | +| [Apache Maven JAR Plugin][54] | [Apache License, Version 2.0][16] | ## Project Keeper Command Line Interface @@ -119,19 +108,19 @@ | Dependency | License | | ------------------------- | --------------------- | -| [Project keeper core][48] | [The MIT License][49] | +| [Project keeper core][42] | [The MIT License][43] | | [error-reporting-java][7] | [MIT License][8] | -| [Maven Model][54] | [Apache-2.0][16] | +| [Maven Model][48] | [Apache-2.0][16] | ### Test Dependencies | Dependency | License | | -------------------------------------- | --------------------------------- | -| [Project Keeper shared test setup][48] | [The MIT License][49] | +| [Project Keeper shared test setup][42] | [The MIT License][43] | | [JUnit Jupiter Engine][10] | [Eclipse Public License v2.0][11] | | [JUnit Jupiter Params][10] | [Eclipse Public License v2.0][11] | | [Hamcrest][12] | [BSD License 3][13] | -| [Maven Project Version Getter][55] | [MIT License][56] | +| [Maven Project Version Getter][49] | [MIT License][50] | ### Runtime Dependencies @@ -141,32 +130,27 @@ ### Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | -| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | -| [Apache Maven Enforcer Plugin][24] | [Apache-2.0][16] | -| [Maven Flatten Plugin][25] | [Apache Software Licenese][16] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][26] | [ASL2][27] | -| [Maven Surefire Plugin][28] | [Apache-2.0][16] | -| [Versions Maven Plugin][29] | [Apache License, Version 2.0][16] | -| [duplicate-finder-maven-plugin Maven Mojo][30] | [Apache License 2.0][31] | -| [Apache Maven Assembly Plugin][61] | [Apache-2.0][16] | -| [Apache Maven JAR Plugin][59] | [Apache License, Version 2.0][16] | -| [Artifact reference checker and unifier][62] | [MIT License][63] | -| [Apache Maven Deploy Plugin][32] | [Apache-2.0][16] | -| [Apache Maven GPG Plugin][33] | [Apache-2.0][16] | -| [Apache Maven Source Plugin][34] | [Apache License, Version 2.0][16] | -| [Apache Maven Javadoc Plugin][35] | [Apache-2.0][16] | -| [Nexus Staging Maven Plugin][36] | [Eclipse Public License][37] | -| [Maven Failsafe Plugin][60] | [Apache-2.0][16] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][39] | -| [error-code-crawler-maven-plugin][40] | [MIT License][41] | -| [Reproducible Build Maven Plugin][42] | [Apache 2.0][27] | -| [Maven Clean Plugin][43] | [The Apache Software License, Version 2.0][27] | -| [Maven Resources Plugin][44] | [The Apache Software License, Version 2.0][27] | -| [Maven Install Plugin][46] | [The Apache Software License, Version 2.0][27] | -| [Maven Site Plugin 3][47] | [The Apache Software License, Version 2.0][27] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | +| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | +| [Maven Flatten Plugin][24] | [Apache Software Licenese][16] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][25] | [ASL2][26] | +| [Maven Surefire Plugin][27] | [Apache-2.0][16] | +| [Versions Maven Plugin][28] | [Apache License, Version 2.0][16] | +| [duplicate-finder-maven-plugin Maven Mojo][29] | [Apache License 2.0][30] | +| [Apache Maven Assembly Plugin][55] | [Apache-2.0][16] | +| [Apache Maven JAR Plugin][54] | [Apache License, Version 2.0][16] | +| [Artifact reference checker and unifier][56] | [MIT License][57] | +| [Apache Maven Deploy Plugin][31] | [Apache-2.0][16] | +| [Apache Maven GPG Plugin][32] | [Apache-2.0][16] | +| [Apache Maven Source Plugin][33] | [Apache License, Version 2.0][16] | +| [Apache Maven Javadoc Plugin][34] | [Apache-2.0][16] | +| [Nexus Staging Maven Plugin][35] | [Eclipse Public License][36] | +| [Maven Failsafe Plugin][53] | [Apache-2.0][16] | +| [JaCoCo :: Maven Plugin][37] | [Eclipse Public License 2.0][38] | +| [error-code-crawler-maven-plugin][39] | [MIT License][40] | +| [Reproducible Build Maven Plugin][41] | [Apache 2.0][26] | ## Project Keeper Maven Plugin @@ -174,54 +158,49 @@ | Dependency | License | | ----------------------------------------- | --------------------- | -| [Project keeper core][48] | [The MIT License][49] | -| [Maven Plugin Tools Java Annotations][64] | [Apache-2.0][16] | -| [Maven Plugin API][65] | [Apache-2.0][16] | -| [Maven Core][66] | [Apache-2.0][16] | +| [Project keeper core][42] | [The MIT License][43] | +| [Maven Plugin Tools Java Annotations][58] | [Apache-2.0][16] | +| [Maven Plugin API][59] | [Apache-2.0][16] | +| [Maven Core][60] | [Apache-2.0][16] | | [error-reporting-java][7] | [MIT License][8] | ### Test Dependencies | Dependency | License | | -------------------------------------- | ---------------------------------------------- | -| [Maven Project Version Getter][55] | [MIT License][56] | +| [Maven Project Version Getter][49] | [MIT License][50] | | [JUnit Jupiter Engine][10] | [Eclipse Public License v2.0][11] | | [JUnit Jupiter Params][10] | [Eclipse Public License v2.0][11] | | [Hamcrest][12] | [BSD License 3][13] | -| [org.xmlunit:xmlunit-matchers][50] | [The Apache Software License, Version 2.0][27] | -| [mockito-core][17] | [The MIT License][18] | -| [Maven Plugin Integration Testing][57] | [MIT License][58] | +| [org.xmlunit:xmlunit-matchers][44] | [The Apache Software License, Version 2.0][26] | +| [mockito-core][17] | [MIT][18] | +| [Maven Plugin Integration Testing][51] | [MIT License][52] | | [SLF4J JDK14 Binding][19] | [MIT License][20] | -| [JaCoCo :: Agent][67] | [Eclipse Public License 2.0][39] | +| [JaCoCo :: Agent][61] | [Eclipse Public License 2.0][38] | ### Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | -| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | -| [Apache Maven Enforcer Plugin][24] | [Apache-2.0][16] | -| [Maven Flatten Plugin][25] | [Apache Software Licenese][16] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][26] | [ASL2][27] | -| [Maven Surefire Plugin][28] | [Apache-2.0][16] | -| [Versions Maven Plugin][29] | [Apache License, Version 2.0][16] | -| [Maven Plugin Plugin][68] | [Apache-2.0][16] | -| [Apache Maven JAR Plugin][59] | [Apache License, Version 2.0][16] | -| [duplicate-finder-maven-plugin Maven Mojo][30] | [Apache License 2.0][31] | -| [Apache Maven Deploy Plugin][32] | [Apache-2.0][16] | -| [Apache Maven GPG Plugin][33] | [Apache-2.0][16] | -| [Apache Maven Source Plugin][34] | [Apache License, Version 2.0][16] | -| [Apache Maven Javadoc Plugin][35] | [Apache-2.0][16] | -| [Nexus Staging Maven Plugin][36] | [Eclipse Public License][37] | -| [Apache Maven Dependency Plugin][69] | [Apache-2.0][16] | -| [Maven Failsafe Plugin][60] | [Apache-2.0][16] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][39] | -| [error-code-crawler-maven-plugin][40] | [MIT License][41] | -| [Reproducible Build Maven Plugin][42] | [Apache 2.0][27] | -| [Maven Clean Plugin][43] | [The Apache Software License, Version 2.0][27] | -| [Maven Resources Plugin][44] | [The Apache Software License, Version 2.0][27] | -| [Maven Install Plugin][46] | [The Apache Software License, Version 2.0][27] | -| [Maven Site Plugin 3][47] | [The Apache Software License, Version 2.0][27] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | +| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | +| [Maven Flatten Plugin][24] | [Apache Software Licenese][16] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][25] | [ASL2][26] | +| [Maven Surefire Plugin][27] | [Apache-2.0][16] | +| [Versions Maven Plugin][28] | [Apache License, Version 2.0][16] | +| [Maven Plugin Plugin][62] | [Apache-2.0][16] | +| [Apache Maven JAR Plugin][54] | [Apache License, Version 2.0][16] | +| [duplicate-finder-maven-plugin Maven Mojo][29] | [Apache License 2.0][30] | +| [Apache Maven Deploy Plugin][31] | [Apache-2.0][16] | +| [Apache Maven GPG Plugin][32] | [Apache-2.0][16] | +| [Apache Maven Source Plugin][33] | [Apache License, Version 2.0][16] | +| [Apache Maven Javadoc Plugin][34] | [Apache-2.0][16] | +| [Nexus Staging Maven Plugin][35] | [Eclipse Public License][36] | +| [Apache Maven Dependency Plugin][63] | [Apache-2.0][16] | +| [Maven Failsafe Plugin][53] | [Apache-2.0][16] | +| [JaCoCo :: Maven Plugin][37] | [Eclipse Public License 2.0][38] | +| [error-code-crawler-maven-plugin][39] | [MIT License][40] | +| [Reproducible Build Maven Plugin][41] | [Apache 2.0][26] | ## Project Keeper Java Project Crawler @@ -229,56 +208,51 @@ | Dependency | License | | ----------------------------------------- | ---------------------------------------------- | -| [Project-Keeper shared model classes][48] | [The MIT License][49] | -| [Maven Plugin Tools Java Annotations][64] | [Apache-2.0][16] | -| [Maven Plugin API][65] | [Apache-2.0][16] | +| [Project-Keeper shared model classes][42] | [The MIT License][43] | +| [Maven Plugin Tools Java Annotations][58] | [Apache-2.0][16] | +| [Maven Plugin API][59] | [Apache-2.0][16] | | [error-reporting-java][7] | [MIT License][8] | | [JGit - Core][9] | Eclipse Distribution License (New BSD License) | -| [semver4j][52] | [The MIT License][20] | -| [Maven Core][66] | [Apache-2.0][16] | +| [semver4j][46] | [The MIT License][20] | +| [Maven Core][60] | [Apache-2.0][16] | ### Test Dependencies | Dependency | License | | -------------------------------------- | ---------------------------------------------- | -| [Maven Project Version Getter][55] | [MIT License][56] | +| [Maven Project Version Getter][49] | [MIT License][50] | | [JUnit Jupiter Engine][10] | [Eclipse Public License v2.0][11] | | [JUnit Jupiter Params][10] | [Eclipse Public License v2.0][11] | | [Hamcrest][12] | [BSD License 3][13] | -| [org.xmlunit:xmlunit-matchers][50] | [The Apache Software License, Version 2.0][27] | +| [org.xmlunit:xmlunit-matchers][44] | [The Apache Software License, Version 2.0][26] | | [SLF4J JDK14 Binding][19] | [MIT License][20] | -| [mockito-core][17] | [The MIT License][18] | -| [Maven Plugin Integration Testing][57] | [MIT License][58] | -| [JaCoCo :: Agent][67] | [Eclipse Public License 2.0][39] | +| [mockito-core][17] | [MIT][18] | +| [mockito-junit-jupiter][17] | [MIT][18] | +| [Maven Plugin Integration Testing][51] | [MIT License][52] | +| [JaCoCo :: Agent][61] | [Eclipse Public License 2.0][38] | ### Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | -| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | -| [Apache Maven Enforcer Plugin][24] | [Apache-2.0][16] | -| [Maven Flatten Plugin][25] | [Apache Software Licenese][16] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][26] | [ASL2][27] | -| [Maven Surefire Plugin][28] | [Apache-2.0][16] | -| [Versions Maven Plugin][29] | [Apache License, Version 2.0][16] | -| [Maven Plugin Plugin][68] | [Apache-2.0][16] | -| [duplicate-finder-maven-plugin Maven Mojo][30] | [Apache License 2.0][31] | -| [Apache Maven Deploy Plugin][32] | [Apache-2.0][16] | -| [Apache Maven GPG Plugin][33] | [Apache-2.0][16] | -| [Apache Maven Source Plugin][34] | [Apache License, Version 2.0][16] | -| [Apache Maven Javadoc Plugin][35] | [Apache-2.0][16] | -| [Nexus Staging Maven Plugin][36] | [Eclipse Public License][37] | -| [Apache Maven Dependency Plugin][69] | [Apache-2.0][16] | -| [Maven Failsafe Plugin][60] | [Apache-2.0][16] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][39] | -| [error-code-crawler-maven-plugin][40] | [MIT License][41] | -| [Reproducible Build Maven Plugin][42] | [Apache 2.0][27] | -| [Maven Clean Plugin][43] | [The Apache Software License, Version 2.0][27] | -| [Maven Resources Plugin][44] | [The Apache Software License, Version 2.0][27] | -| [Maven JAR Plugin][45] | [The Apache Software License, Version 2.0][27] | -| [Maven Install Plugin][46] | [The Apache Software License, Version 2.0][27] | -| [Maven Site Plugin 3][47] | [The Apache Software License, Version 2.0][27] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | +| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | +| [Maven Flatten Plugin][24] | [Apache Software Licenese][16] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][25] | [ASL2][26] | +| [Maven Surefire Plugin][27] | [Apache-2.0][16] | +| [Versions Maven Plugin][28] | [Apache License, Version 2.0][16] | +| [Maven Plugin Plugin][62] | [Apache-2.0][16] | +| [duplicate-finder-maven-plugin Maven Mojo][29] | [Apache License 2.0][30] | +| [Apache Maven Deploy Plugin][31] | [Apache-2.0][16] | +| [Apache Maven GPG Plugin][32] | [Apache-2.0][16] | +| [Apache Maven Source Plugin][33] | [Apache License, Version 2.0][16] | +| [Apache Maven Javadoc Plugin][34] | [Apache-2.0][16] | +| [Nexus Staging Maven Plugin][35] | [Eclipse Public License][36] | +| [Apache Maven Dependency Plugin][63] | [Apache-2.0][16] | +| [Maven Failsafe Plugin][53] | [Apache-2.0][16] | +| [JaCoCo :: Maven Plugin][37] | [Eclipse Public License 2.0][38] | +| [error-code-crawler-maven-plugin][39] | [MIT License][40] | +| [Reproducible Build Maven Plugin][41] | [Apache 2.0][26] | ## Project Keeper Shared Test Setup @@ -286,32 +260,25 @@ | Dependency | License | | ----------------------------------------- | --------------------------------- | -| [Project-Keeper shared model classes][48] | [The MIT License][49] | -| [SnakeYAML][53] | [Apache License, Version 2.0][27] | +| [Project-Keeper shared model classes][42] | [The MIT License][43] | +| [SnakeYAML][47] | [Apache License, Version 2.0][26] | | [Hamcrest][12] | [BSD License 3][13] | -| [Maven Model][54] | [Apache-2.0][16] | +| [Maven Model][48] | [Apache-2.0][16] | ### Plugin Dependencies -| Dependency | License | -| ------------------------------------------------------- | ---------------------------------------------- | -| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | -| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | -| [Apache Maven Enforcer Plugin][24] | [Apache-2.0][16] | -| [Maven Flatten Plugin][25] | [Apache Software Licenese][16] | -| [org.sonatype.ossindex.maven:ossindex-maven-plugin][26] | [ASL2][27] | -| [Maven Surefire Plugin][28] | [Apache-2.0][16] | -| [Versions Maven Plugin][29] | [Apache License, Version 2.0][16] | -| [duplicate-finder-maven-plugin Maven Mojo][30] | [Apache License 2.0][31] | -| [JaCoCo :: Maven Plugin][38] | [Eclipse Public License 2.0][39] | -| [error-code-crawler-maven-plugin][40] | [MIT License][41] | -| [Reproducible Build Maven Plugin][42] | [Apache 2.0][27] | -| [Maven Clean Plugin][43] | [The Apache Software License, Version 2.0][27] | -| [Maven Resources Plugin][44] | [The Apache Software License, Version 2.0][27] | -| [Maven JAR Plugin][45] | [The Apache Software License, Version 2.0][27] | -| [Maven Install Plugin][46] | [The Apache Software License, Version 2.0][27] | -| [Maven Deploy Plugin][70] | [The Apache Software License, Version 2.0][27] | -| [Maven Site Plugin 3][47] | [The Apache Software License, Version 2.0][27] | +| Dependency | License | +| ------------------------------------------------------- | --------------------------------- | +| [SonarQube Scanner for Maven][21] | [GNU LGPL 3][22] | +| [Apache Maven Compiler Plugin][23] | [Apache-2.0][16] | +| [Maven Flatten Plugin][24] | [Apache Software Licenese][16] | +| [org.sonatype.ossindex.maven:ossindex-maven-plugin][25] | [ASL2][26] | +| [Maven Surefire Plugin][27] | [Apache-2.0][16] | +| [Versions Maven Plugin][28] | [Apache License, Version 2.0][16] | +| [duplicate-finder-maven-plugin Maven Mojo][29] | [Apache License 2.0][30] | +| [JaCoCo :: Maven Plugin][37] | [Eclipse Public License 2.0][38] | +| [error-code-crawler-maven-plugin][39] | [MIT License][40] | +| [Reproducible Build Maven Plugin][41] | [Apache 2.0][26] | [0]: https://github.com/eclipse-ee4j/jsonp [1]: https://projects.eclipse.org/license/epl-2.0 @@ -337,50 +304,43 @@ [21]: http://sonarsource.github.io/sonar-scanner-maven/ [22]: http://www.gnu.org/licenses/lgpl.txt [23]: https://maven.apache.org/plugins/maven-compiler-plugin/ -[24]: https://maven.apache.org/enforcer/maven-enforcer-plugin/ -[25]: https://www.mojohaus.org/flatten-maven-plugin/ -[26]: https://sonatype.github.io/ossindex-maven/maven-plugin/ -[27]: http://www.apache.org/licenses/LICENSE-2.0.txt -[28]: https://maven.apache.org/surefire/maven-surefire-plugin/ -[29]: https://www.mojohaus.org/versions/versions-maven-plugin/ -[30]: https://basepom.github.io/duplicate-finder-maven-plugin -[31]: http://www.apache.org/licenses/LICENSE-2.0.html -[32]: https://maven.apache.org/plugins/maven-deploy-plugin/ -[33]: https://maven.apache.org/plugins/maven-gpg-plugin/ -[34]: https://maven.apache.org/plugins/maven-source-plugin/ -[35]: https://maven.apache.org/plugins/maven-javadoc-plugin/ -[36]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ -[37]: http://www.eclipse.org/legal/epl-v10.html -[38]: https://www.jacoco.org/jacoco/trunk/doc/maven.html -[39]: https://www.eclipse.org/legal/epl-2.0/ -[40]: https://github.com/exasol/error-code-crawler-maven-plugin/ -[41]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE -[42]: http://zlika.github.io/reproducible-build-maven-plugin -[43]: http://maven.apache.org/plugins/maven-clean-plugin/ -[44]: http://maven.apache.org/plugins/maven-resources-plugin/ -[45]: http://maven.apache.org/plugins/maven-jar-plugin/ -[46]: http://maven.apache.org/plugins/maven-install-plugin/ -[47]: http://maven.apache.org/plugins/maven-site-plugin/ -[48]: https://github.com/exasol/project-keeper/ -[49]: https://github.com/exasol/project-keeper/blob/main/LICENSE -[50]: https://www.xmlunit.org/ -[51]: https://github.com/Steppschuh/Java-Markdown-Generator -[52]: https://github.com/vdurmont/semver4j -[53]: https://bitbucket.org/snakeyaml/snakeyaml -[54]: https://maven.apache.org/ref/3.9.4/maven-model/ -[55]: https://github.com/exasol/maven-project-version-getter/ -[56]: https://github.com/exasol/maven-project-version-getter/blob/main/LICENSE -[57]: https://github.com/exasol/maven-plugin-integration-testing/ -[58]: https://github.com/exasol/maven-plugin-integration-testing/blob/main/LICENSE -[59]: https://maven.apache.org/plugins/maven-jar-plugin/ -[60]: https://maven.apache.org/surefire/maven-failsafe-plugin/ -[61]: https://maven.apache.org/plugins/maven-assembly-plugin/ -[62]: https://github.com/exasol/artifact-reference-checker-maven-plugin/ -[63]: https://github.com/exasol/artifact-reference-checker-maven-plugin/blob/main/LICENSE -[64]: https://maven.apache.org/plugin-tools/maven-plugin-annotations -[65]: https://maven.apache.org/ref/3.9.4/maven-plugin-api/ -[66]: https://maven.apache.org/ref/3.9.4/maven-core/ -[67]: https://www.eclemma.org/jacoco/index.html -[68]: https://maven.apache.org/plugin-tools/maven-plugin-plugin -[69]: https://maven.apache.org/plugins/maven-dependency-plugin/ -[70]: http://maven.apache.org/plugins/maven-deploy-plugin/ +[24]: https://www.mojohaus.org/flatten-maven-plugin/ +[25]: https://sonatype.github.io/ossindex-maven/maven-plugin/ +[26]: http://www.apache.org/licenses/LICENSE-2.0.txt +[27]: https://maven.apache.org/surefire/maven-surefire-plugin/ +[28]: https://www.mojohaus.org/versions/versions-maven-plugin/ +[29]: https://basepom.github.io/duplicate-finder-maven-plugin +[30]: http://www.apache.org/licenses/LICENSE-2.0.html +[31]: https://maven.apache.org/plugins/maven-deploy-plugin/ +[32]: https://maven.apache.org/plugins/maven-gpg-plugin/ +[33]: https://maven.apache.org/plugins/maven-source-plugin/ +[34]: https://maven.apache.org/plugins/maven-javadoc-plugin/ +[35]: http://www.sonatype.com/public-parent/nexus-maven-plugins/nexus-staging/nexus-staging-maven-plugin/ +[36]: http://www.eclipse.org/legal/epl-v10.html +[37]: https://www.jacoco.org/jacoco/trunk/doc/maven.html +[38]: https://www.eclipse.org/legal/epl-2.0/ +[39]: https://github.com/exasol/error-code-crawler-maven-plugin/ +[40]: https://github.com/exasol/error-code-crawler-maven-plugin/blob/main/LICENSE +[41]: http://zlika.github.io/reproducible-build-maven-plugin +[42]: https://github.com/exasol/project-keeper/ +[43]: https://github.com/exasol/project-keeper/blob/main/LICENSE +[44]: https://www.xmlunit.org/ +[45]: https://github.com/Steppschuh/Java-Markdown-Generator +[46]: https://github.com/vdurmont/semver4j +[47]: https://bitbucket.org/snakeyaml/snakeyaml +[48]: https://maven.apache.org/ref/3.9.5/maven-model/ +[49]: https://github.com/exasol/maven-project-version-getter/ +[50]: https://github.com/exasol/maven-project-version-getter/blob/main/LICENSE +[51]: https://github.com/exasol/maven-plugin-integration-testing/ +[52]: https://github.com/exasol/maven-plugin-integration-testing/blob/main/LICENSE +[53]: https://maven.apache.org/surefire/maven-failsafe-plugin/ +[54]: https://maven.apache.org/plugins/maven-jar-plugin/ +[55]: https://maven.apache.org/plugins/maven-assembly-plugin/ +[56]: https://github.com/exasol/artifact-reference-checker-maven-plugin/ +[57]: https://github.com/exasol/artifact-reference-checker-maven-plugin/blob/main/LICENSE +[58]: https://maven.apache.org/plugin-tools/maven-plugin-annotations +[59]: https://maven.apache.org/ref/3.9.5/maven-plugin-api/ +[60]: https://maven.apache.org/ref/3.9.5/maven-core/ +[61]: https://www.eclemma.org/jacoco/index.html +[62]: https://maven.apache.org/plugin-tools/maven-plugin-plugin +[63]: https://maven.apache.org/plugins/maven-dependency-plugin/ diff --git a/doc/changes/changelog.md b/doc/changes/changelog.md index 82f44f22..79696ab1 100644 --- a/doc/changes/changelog.md +++ b/doc/changes/changelog.md @@ -1,5 +1,6 @@ # Changes +* [2.9.13](changes_2.9.13.md) * [2.9.12](changes_2.9.12.md) * [2.9.11](changes_2.9.11.md) * [2.9.10](changes_2.9.10.md) diff --git a/doc/changes/changes_2.9.13.md b/doc/changes/changes_2.9.13.md new file mode 100644 index 00000000..ca9302b6 --- /dev/null +++ b/doc/changes/changes_2.9.13.md @@ -0,0 +1,132 @@ +# Project Keeper 2.9.13, released 2023-10-24 + +Code name: Remove Enforcer Plugin + +## Summary + +This release removes plugins from the generated `dependencies.md` file that are defined by Maven itself. This avoids a dependency on the Maven version which allows using any version you want. + +The release also reduces build verbosity by setting the `quiet` option of `maven-javadoc-plugin` to `true`. + +## Features + +* #480: Removed indirect plugins from `dependencies.md` & remove enforcer plugin + +## Dependency Updates + +### Project-Keeper Shared Model Classes + +#### Compile Dependency Updates + +* Updated `jakarta.json:jakarta.json-api:2.1.2` to `2.1.3` + +#### Test Dependency Updates + +* Updated `org.mockito:mockito-core:5.5.0` to `5.6.0` + +#### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` +* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` + +### Project Keeper Core + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-shared-model-classes:2.9.12` to `2.9.13` + +#### Runtime Dependency Updates + +* Updated `com.exasol:project-keeper-java-project-crawler:2.9.12` to `2.9.13` + +#### Test Dependency Updates + +* Updated `com.exasol:project-keeper-shared-test-setup:2.9.12` to `2.9.13` +* Updated `org.mockito:mockito-junit-jupiter:5.5.0` to `5.6.0` + +#### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` +* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` + +### Project Keeper Command Line Interface + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-core:2.9.12` to `2.9.13` +* Updated `org.apache.maven:maven-model:3.9.4` to `3.9.5` + +#### Test Dependency Updates + +* Updated `com.exasol:project-keeper-shared-test-setup:2.9.12` to `2.9.13` + +#### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` +* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` + +### Project Keeper Maven Plugin + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-core:2.9.12` to `2.9.13` + +#### Test Dependency Updates + +* Updated `org.mockito:mockito-core:5.5.0` to `5.6.0` + +#### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` +* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` + +### Project Keeper Java Project Crawler + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-shared-model-classes:2.9.12` to `2.9.13` + +#### Test Dependency Updates + +* Updated `org.mockito:mockito-core:5.5.0` to `5.6.0` +* Added `org.mockito:mockito-junit-jupiter:5.6.0` + +#### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` +* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` +* Updated `org.apache.maven.plugins:maven-javadoc-plugin:3.5.0` to `3.6.0` +* Updated `org.apache.maven.plugins:maven-plugin-plugin:3.9.0` to `3.10.1` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` + +### Project Keeper Shared Test Setup + +#### Compile Dependency Updates + +* Updated `com.exasol:project-keeper-shared-model-classes:2.9.12` to `2.9.13` + +#### Plugin Dependency Updates + +* Updated `com.exasol:error-code-crawler-maven-plugin:1.3.0` to `1.3.1` +* Removed `org.apache.maven.plugins:maven-enforcer-plugin:3.4.0` +* Updated `org.codehaus.mojo:versions-maven-plugin:2.16.0` to `2.16.1` +* Updated `org.jacoco:jacoco-maven-plugin:0.8.10` to `0.8.11` +* Updated `org.sonarsource.scanner.maven:sonar-maven-plugin:3.9.1.2184` to `3.10.0.2594` diff --git a/doc/design.md b/doc/design.md index 9b73e9d0..e64bc8d5 100644 --- a/doc/design.md +++ b/doc/design.md @@ -152,7 +152,7 @@ Needs: impl, utest, itest ### Dependencies.md File Validator -`dsn~depnedency.md-file-validator~1` +`dsn~dependency.md-file-validator~1` For validating the `dependencies.md` file we first generate the expected content and then compare the actual file with the expected content. @@ -166,6 +166,20 @@ Covers: Needs: impl, itest +#### Excluding Implicit Plugins from Dependencies.md + +`dsn~dependency.md-file-validator-excludes-implicit-plugins~1` + +PK excludes implicit plugins from `dependencies.md`. + +Rationale: + +Maven implicitly adds plugins like `org.apache.maven.plugins:maven-clean-plugin` due to the Maven lifecycle. The version of these plugins depends on the Maven version. Each plugin version defines its own name and license which is included in `dependencies.md`. That means the content of `dependencies.md` depends on the Maven version, causing build failures when using a different Maven version, see [issue #436](https://github.com/exasol/project-keeper/issues/436). + +One workaround is pinning the Maven version using `maven-enforcer-plugin` but this causes problems on developer's machines. That's why we decided to remove these implicit plugins from `dependencies.md`. + +Needs: impl, utest, itest + ### Readme.md File Validator `dsn~readme-validator~1` diff --git a/maven-project-crawler/pk_generated_parent.pom b/maven-project-crawler/pk_generated_parent.pom index d8cc355f..92ecd8ae 100644 --- a/maven-project-crawler/pk_generated_parent.pom +++ b/maven-project-crawler/pk_generated_parent.pom @@ -62,7 +62,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -73,26 +73,6 @@ ${java.version} - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.codehaus.mojo flatten-maven-plugin @@ -146,7 +126,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates @@ -233,7 +213,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs @@ -248,6 +228,7 @@ true true true + true @@ -317,7 +298,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -364,7 +345,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/maven-project-crawler/pom.xml b/maven-project-crawler/pom.xml index 1dfb1b34..1aaa3581 100644 --- a/maven-project-crawler/pom.xml +++ b/maven-project-crawler/pom.xml @@ -80,6 +80,11 @@ mockito-core test + + org.mockito + mockito-junit-jupiter + test + com.exasol maven-plugin-integration-testing @@ -91,7 +96,7 @@ org.apache.maven.plugins maven-plugin-plugin - 3.9.0 + 3.10.1 org.basepom.maven diff --git a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java index 92978e7d..dc62dc4e 100644 --- a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java +++ b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/MavenProjectCrawlerMojo.java @@ -48,8 +48,8 @@ public void execute() { final MavenProject project = readProject(mavenProjectReader, path); final DependencyChangeReport dependencyChangeReport = new DependencyUpdateReader(mavenProjectReader, project.getBasedir().toPath(), project.getModel()).readDependencyChanges(); - final ProjectDependencies dependencies = new ProjectDependencyReader(modelFromRepositoryReader) - .readDependencies(project); + final ProjectDependencies dependencies = new ProjectDependencyReader(modelFromRepositoryReader, project) + .readDependencies(); final CrawledMavenProject crawledMavenProject = new CrawledMavenProject(dependencyChangeReport, dependencies, project.getVersion()); crawledProjects.put(path, crawledMavenProject); diff --git a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/DependencyUpdateReader.java b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/DependencyUpdateReader.java index 7a4bce5e..c6f19fd5 100644 --- a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/DependencyUpdateReader.java +++ b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/DependencyUpdateReader.java @@ -54,16 +54,19 @@ private Model getOldModel() { if (lastReleasesPomFile.isPresent()) { return parseOldPomFile(lastReleasesPomFile.get()); } else { - final var emptyModel = new Model(); - final var build = new Build(); - emptyModel.setBuild(build); - return emptyModel; + return emptyModel(); } } finally { deleteTempDir(tempDirectory); } } + private Model emptyModel() { + final var emptyModel = new Model(); + emptyModel.setBuild(new Build()); + return emptyModel; + } + private void deleteTempDir(final Path tempDirectory) { try { if (Files.isDirectory(tempDirectory)) { diff --git a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/LastReleasePomFileReader.java b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/LastReleasePomFileReader.java index 99afe846..1b707699 100644 --- a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/LastReleasePomFileReader.java +++ b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/LastReleasePomFileReader.java @@ -16,14 +16,14 @@ import com.exasol.projectkeeper.shared.repository.TaggedCommit; /** - * This class reads the pom file of the latest previous release on the current branch. + * This class reads the pom file including its parent POMs of the latest previous release on the current branch. */ public class LastReleasePomFileReader { private static final Logger LOGGER = Logger.getLogger(LastReleasePomFileReader.class.getName()); /** - * Copy pom.xml file from a given git release tag to another directory. If the pom file specifies a parent with - * relative path, this method extracts it too. + * Copy {@code pom.xml} file from a given git release tag to another directory. If the pom file specifies a parent + * with relative path, this method extracts it too. * * @param projectDirectory projects root directory * @param relativePathToPom path to the pom file to extract (relative to the {@code projectDirectory}) diff --git a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/dependencies/DependencyChangeReportReader.java b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/dependencies/DependencyChangeReportReader.java index 86a376ee..cbb7ed8e 100644 --- a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/dependencies/DependencyChangeReportReader.java +++ b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/changesfile/dependencies/DependencyChangeReportReader.java @@ -60,8 +60,9 @@ private List filterDependenciesByScope(final Model model, final Stri .collect(Collectors.toList()); } - private List convertPluginsToDependencies(final Model oldModel) { - return oldModel.getBuild().getPlugins().stream().map(this::convertPluginToDependency) + private List convertPluginsToDependencies(final Model model) { + return model.getBuild().getPlugins().stream() // + .map(this::convertPluginToDependency) // .collect(Collectors.toList()); } diff --git a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/dependencies/ProjectDependencyReader.java b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/dependencies/ProjectDependencyReader.java index 659b6126..0097dbd5 100644 --- a/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/dependencies/ProjectDependencyReader.java +++ b/maven-project-crawler/src/main/java/com/exasol/projectkeeper/validators/dependencies/ProjectDependencyReader.java @@ -21,31 +21,76 @@ */ public class ProjectDependencyReader { private final MavenModelFromRepositoryReader artifactModelReader; + private final MavenProject project; /** * Create a new instance of {@link ProjectDependencyReader}. * * @param artifactModelReader maven dependency reader + * @param project maven project */ - public ProjectDependencyReader(final MavenModelFromRepositoryReader artifactModelReader) { + public ProjectDependencyReader(final MavenModelFromRepositoryReader artifactModelReader, + final MavenProject project) { this.artifactModelReader = artifactModelReader; + this.project = project; } /** * Read the dependencies of the pom file (including plugins). * - * @param project maven project * @return list of dependencies */ - public ProjectDependencies readDependencies(final MavenProject project) { - final List dependencies = getDependenciesIncludingPlugins(project.getModel()) - .map(dependency -> getLicense(dependency, project)).collect(Collectors.toList()); + public ProjectDependencies readDependencies() { + final List dependencies = getDependenciesIncludingPlugins() + .map(dependency -> getLicense(dependency, project)) // + .collect(Collectors.toList()); return new ProjectDependencies(dependencies); } - private Stream getDependenciesIncludingPlugins(final Model model) { - return Stream.concat(model.getDependencies().stream(), - model.getBuild().getPlugins().stream().map(this::convertPluginToDependency)); + private Stream getDependenciesIncludingPlugins() { + return Stream.concat(getDependencies(), getPluginDependencies()); + } + + private Stream getDependencies() { + return project.getModel().getDependencies().stream(); + } + + private Stream getPluginDependencies() { + return project.getModel().getBuild().getPlugins().stream() // + .filter(this::isExplicitPlugin) // + .map(this::convertPluginToDependency); + } + + /** + * Check if the given plugin is an explicit or implicit plugin. + * + *
    + *
  • Direct plugins (e.g. {@code org.apache.maven.plugins:maven-failsafe-plugin}) are explicitly added to the + * build in a POM or parent POM. + *
      + *
    • Source model ID is {@code com.exasol:project-keeper-shared-test-setup-generated-parent:${revision}} + * or {@code com.exasol:project-keeper-cli:${revision}}
    • + *
    • Source location is {@code /path/to/project-keeper/project-keeper-cli/pom.xml} or + * {@code /path/to/project-keeper/project-keeper-maven-plugin/pk_generated_parent.pom}
    • + *
    + *
  • Indirect plugins (e.g. {@code org.apache.maven.plugins:maven-clean-plugin}) are implicitly added to the build + * a Maven lifecycle. + *
      + *
    • Source model ID is {@code org.apache.maven:maven-core:3.8.7:default-lifecycle-bindings}
    • + *
    • Source location is {@code null}
    • + *
    + *
  • + *
+ * The Maven API allows distinguishing both types via Source model ID and Source location. We decided to only use + * the source location as this requires only a simple not-null check. + * + * @param plugin plugin to check + * @return {@code true} if the plugin is explicitly added to the build + */ + // [impl -> dsn~dependency.md-file-validator-excludes-implicit-plugins~1] + private boolean isExplicitPlugin(final Plugin plugin) { + final String location = plugin.getLocation("").getSource().getLocation(); + return location != null; } private Dependency convertPluginToDependency(final Plugin plugin) { diff --git a/maven-project-crawler/src/test/java/com/exasol/projectkeeper/dependencies/ProjectDependencyReaderTest.java b/maven-project-crawler/src/test/java/com/exasol/projectkeeper/dependencies/ProjectDependencyReaderTest.java new file mode 100644 index 00000000..208c6788 --- /dev/null +++ b/maven-project-crawler/src/test/java/com/exasol/projectkeeper/dependencies/ProjectDependencyReaderTest.java @@ -0,0 +1,91 @@ +package com.exasol.projectkeeper.dependencies; + +import static java.util.Collections.emptyList; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.contains; +import static org.hamcrest.Matchers.empty; +import static org.mockito.ArgumentMatchers.anyList; +import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.Mockito.when; + +import java.util.List; + +import org.apache.maven.model.*; +import org.apache.maven.project.MavenProject; +import org.apache.maven.project.ProjectBuildingException; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.extension.ExtendWith; +import org.mockito.Mock; +import org.mockito.junit.jupiter.MockitoExtension; + +import com.exasol.projectkeeper.pom.MavenModelFromRepositoryReader; +import com.exasol.projectkeeper.shared.dependencies.BaseDependency.Type; +import com.exasol.projectkeeper.shared.dependencies.License; +import com.exasol.projectkeeper.shared.dependencies.ProjectDependency; +import com.exasol.projectkeeper.validators.dependencies.ProjectDependencyReader; + +@ExtendWith(MockitoExtension.class) +class ProjectDependencyReaderTest { + + @Mock + MavenModelFromRepositoryReader artifactModelReaderMock; + + @Test + void noDependencies() { + assertThat(readDependencies(emptyList()), empty()); + } + + private List readDependencies(final List plugins) { + final MavenProject project = new MavenProject(new Model()); + project.getModel().setBuild(new Build()); + project.getModel().getBuild().setPlugins(plugins); + return new ProjectDependencyReader(artifactModelReaderMock, project).readDependencies().getDependencies(); + } + + @Test + void explicitPlugin() throws ProjectBuildingException { + simulateDependencies("group", "art", "ver", "website", List.of(createMavenLicense("license", "licenseUrl"))); + + assertThat(readDependencies(List.of(createPlugin("group", "art", "ver", "non-null"))), + contains(ProjectDependency.builder().type(Type.PLUGIN).name("name:group:art").websiteUrl("website") + .licenses(List.of(new License("license", "licenseUrl"))).build())); + } + + private org.apache.maven.model.License createMavenLicense(final String name, final String url) { + final org.apache.maven.model.License license = new org.apache.maven.model.License(); + license.setName(name); + license.setUrl(url); + return license; + } + + private Plugin createPlugin(final String groupId, final String artifactId, final String version, + final String sourceLocation) { + final Plugin plugin = new Plugin(); + plugin.setGroupId(groupId); + plugin.setArtifactId(artifactId); + plugin.setVersion(version); + final InputSource source = new InputSource(); + source.setLocation(sourceLocation); + plugin.setLocation("", new InputLocation(0, 0, source)); + return plugin; + } + + private void simulateDependencies(final String groupId, final String artifactId, final String version, + final String url, final List licenses) throws ProjectBuildingException { + final Model model = new Model(); + model.setArtifactId(artifactId); + model.setGroupId(groupId); + model.setVersion(version); + model.setName("name:" + groupId + ":" + artifactId); + model.setUrl(url); + model.setLicenses(licenses); + when(artifactModelReaderMock.readModel(eq(artifactId), eq(groupId), eq(version), anyList())).thenReturn(model); + } + + // [utest -> dsn~dependency.md-file-validator-excludes-implicit-plugins~1] + @Test + void implicitPlugin() throws ProjectBuildingException { + assertThat(readDependencies(List.of(createPlugin("group", "art", "ver", null))), empty()); + } + +} diff --git a/parent-pom/pom.xml b/parent-pom/pom.xml index 62616cc3..377f913f 100644 --- a/parent-pom/pom.xml +++ b/parent-pom/pom.xml @@ -28,11 +28,11 @@ - 2.9.12 - 3.9.4 + 2.9.13 + 3.9.5 5.10.0 2.9.1 - 5.5.0 + 5.6.0 UTF-8 UTF-8 11 @@ -67,7 +67,7 @@ jakarta.json jakarta.json-api - 2.1.2 + 2.1.3 jakarta.json.bind @@ -82,7 +82,7 @@ org.apache.maven.plugin-tools maven-plugin-annotations - 3.9.0 + 3.10.1 provided diff --git a/pom.xml b/pom.xml index 3241fe24..1b9adc0b 100644 --- a/pom.xml +++ b/pom.xml @@ -17,26 +17,6 @@ Project Keeper Project - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.itsallcode openfasttrace-maven-plugin @@ -61,7 +41,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/project-keeper-cli/pk_generated_parent.pom b/project-keeper-cli/pk_generated_parent.pom index 0745cecd..9a01294c 100644 --- a/project-keeper-cli/pk_generated_parent.pom +++ b/project-keeper-cli/pk_generated_parent.pom @@ -54,7 +54,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -65,26 +65,6 @@ ${java.version} - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.codehaus.mojo flatten-maven-plugin @@ -138,7 +118,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates @@ -275,7 +255,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs @@ -290,6 +270,7 @@ true true true + true @@ -337,7 +318,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -378,7 +359,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/project-keeper-maven-plugin/pk_generated_parent.pom b/project-keeper-maven-plugin/pk_generated_parent.pom index 4f8551de..becb136f 100644 --- a/project-keeper-maven-plugin/pk_generated_parent.pom +++ b/project-keeper-maven-plugin/pk_generated_parent.pom @@ -62,7 +62,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -73,26 +73,6 @@ ${java.version} - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.codehaus.mojo flatten-maven-plugin @@ -146,7 +126,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates @@ -233,7 +213,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs @@ -248,6 +228,7 @@ true true true + true @@ -317,7 +298,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -364,7 +345,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/project-keeper/pk_generated_parent.pom b/project-keeper/pk_generated_parent.pom index 872317d5..9e540ba9 100644 --- a/project-keeper/pk_generated_parent.pom +++ b/project-keeper/pk_generated_parent.pom @@ -54,7 +54,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -65,26 +65,6 @@ ${java.version} - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.codehaus.mojo flatten-maven-plugin @@ -138,7 +118,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates @@ -225,7 +205,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs @@ -240,6 +220,7 @@ true true true + true @@ -287,7 +268,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -328,7 +309,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/project-keeper/pom.xml b/project-keeper/pom.xml index f0cecb38..d2b70f53 100644 --- a/project-keeper/pom.xml +++ b/project-keeper/pom.xml @@ -114,17 +114,6 @@ - - org.sonatype.ossindex.maven - ossindex-maven-plugin - - - - sonatype-2020-0491 - - - diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/stream/CollectingConsumer.java b/project-keeper/src/main/java/com/exasol/projectkeeper/stream/CollectingConsumer.java index 4cc8c2c1..594629d6 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/stream/CollectingConsumer.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/stream/CollectingConsumer.java @@ -46,4 +46,4 @@ public String getContent(final Duration timeout) throws InterruptedException { } return this.stringBuilder.toString(); } -} \ No newline at end of file +} diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidator.java b/project-keeper/src/main/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidator.java index 7da239f5..5114d571 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidator.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidator.java @@ -17,7 +17,7 @@ /** * {@link Validator} for the dependencies.md file. */ -// [impl->dsn~depnedency.md-file-validator~1] +// [impl->dsn~dependency.md-file-validator~1] public class DependenciesValidator implements Validator { private final Path dependenciesFile; private final List sources; diff --git a/project-keeper/src/main/java/com/exasol/projectkeeper/validators/pom/PomFileGenerator.java b/project-keeper/src/main/java/com/exasol/projectkeeper/validators/pom/PomFileGenerator.java index 9e2f5ed8..2c492dd3 100644 --- a/project-keeper/src/main/java/com/exasol/projectkeeper/validators/pom/PomFileGenerator.java +++ b/project-keeper/src/main/java/com/exasol/projectkeeper/validators/pom/PomFileGenerator.java @@ -23,7 +23,6 @@ public class PomFileGenerator { private static final List PLUGIN_GENERATORS = List.of( new SimplePluginTemplateGenerator("maven_templates/sonar-maven-plugin.xml", DEFAULT), new SimplePluginTemplateGenerator("maven_templates/maven-compiler-plugin.xml", DEFAULT), - new SimplePluginTemplateGenerator("maven_templates/maven-enforcer-plugin.xml", DEFAULT), new SimplePluginTemplateGenerator("maven_templates/flatten-maven-plugin.xml", DEFAULT), new SimplePluginTemplateGenerator("maven_templates/ossindex-maven-plugin.xml", DEFAULT), new SimplePluginTemplateGenerator("maven_templates/maven-surefire-plugin.xml", DEFAULT), @@ -260,4 +259,4 @@ private RepoInfo getRepoInfo() { return repoInfo; } } -} \ No newline at end of file +} diff --git a/project-keeper/src/main/resources/maven_templates/error-code-crawler-maven-plugin.xml b/project-keeper/src/main/resources/maven_templates/error-code-crawler-maven-plugin.xml index b18076e2..09dccd46 100644 --- a/project-keeper/src/main/resources/maven_templates/error-code-crawler-maven-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/error-code-crawler-maven-plugin.xml @@ -1,7 +1,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/project-keeper/src/main/resources/maven_templates/jacoco-maven-plugin.xml b/project-keeper/src/main/resources/maven_templates/jacoco-maven-plugin.xml index c3353c9f..da827aa9 100644 --- a/project-keeper/src/main/resources/maven_templates/jacoco-maven-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/jacoco-maven-plugin.xml @@ -1,7 +1,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent diff --git a/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml b/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml deleted file mode 100644 index bf32929e..00000000 --- a/project-keeper/src/main/resources/maven_templates/maven-enforcer-plugin.xml +++ /dev/null @@ -1,20 +0,0 @@ - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - diff --git a/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml b/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml index 20b2a0b1..9f47c7ef 100644 --- a/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/maven-javadoc-plugin.xml @@ -1,7 +1,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs @@ -16,5 +16,6 @@ true true true + true diff --git a/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml b/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml index e6e945b1..5aeeb51c 100644 --- a/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/sonar-maven-plugin.xml @@ -1,5 +1,5 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 - \ No newline at end of file + 3.10.0.2594 + diff --git a/project-keeper/src/main/resources/maven_templates/versions-maven-plugin.xml b/project-keeper/src/main/resources/maven_templates/versions-maven-plugin.xml index 1b0b978f..5858787c 100644 --- a/project-keeper/src/main/resources/maven_templates/versions-maven-plugin.xml +++ b/project-keeper/src/main/resources/maven_templates/versions-maven-plugin.xml @@ -1,7 +1,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidatorIT.java b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidatorIT.java index bd0fd8a0..ef6b9d51 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidatorIT.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/dependencies/DependenciesValidatorIT.java @@ -3,6 +3,7 @@ import static com.exasol.projectkeeper.shared.config.SourceType.MAVEN; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.Matchers.containsString; +import static org.hamcrest.Matchers.not; import static org.junit.jupiter.api.Assertions.assertAll; import java.io.IOException; @@ -22,16 +23,18 @@ import com.exasol.projectkeeper.test.TestMavenModel; @Tag("integration") -// [itest->dsn~depnedency.md-file-validator~1] +// [itest->dsn~dependency.md-file-validator~1] // [itest->dsn~reading-project-dependencies~1] class DependenciesValidatorIT extends ProjectKeeperAbstractMavenIT { private MavenProjectFixture fixture; + private Path dependenciesFile; @BeforeEach void setup() { this.fixture = new MavenProjectFixture(this.projectDir); this.fixture.gitInit(); + this.dependenciesFile = this.projectDir.resolve("dependencies.md"); } @Test @@ -39,7 +42,7 @@ void testVerify() throws IOException { createExamplePomFile(); this.fixture.writeConfig(createConfigWithNoModules()); runFix(); - Files.deleteIfExists(this.projectDir.resolve("dependencies.md")); + Files.deleteIfExists(this.dependenciesFile); final String output = assertInvalidAndGetOutput(); assertThat(output, containsString("E-PK-CORE-50: This project does not have a dependencies.md file.")); } @@ -49,7 +52,7 @@ void testWrongContent() throws IOException { createExamplePomFile(); this.fixture.writeConfig(createConfigWithNoModules()); runFix(); - Files.writeString(this.projectDir.resolve("dependencies.md"), "wrong content"); + Files.writeString(this.dependenciesFile, "wrong content"); final String output = assertInvalidAndGetOutput(); assertThat(output, containsString("E-PK-CORE-53: The dependencies.md file has outdated content.")); } @@ -59,20 +62,22 @@ void testWrongContentWithNonDefaultRepository() throws IOException { createExamplePomFileWithNonDefaultRepo(); this.fixture.writeConfig(createConfigWithNoModules()); runFix(); - Files.writeString(this.projectDir.resolve("dependencies.md"), "wrong content"); + Files.writeString(this.dependenciesFile, "wrong content"); final String output = assertInvalidAndGetOutput(); assertThat(output, containsString("E-PK-CORE-53: The dependencies.md file has outdated content.")); } + // [itest -> dsn~dependency.md-file-validator-excludes-implicit-plugins~1] @Test void testFix() throws IOException { createExamplePomFile(); this.fixture.writeConfig(createConfigWithNoModules()); runFix(); - final String dependenciesFileContent = Files.readString(this.projectDir.resolve("dependencies.md")); + final String dependenciesFileContent = Files.readString(this.dependenciesFile); assertAll(// () -> assertThat(dependenciesFileContent, containsString("error-reporting-java")), - () -> assertThat(dependenciesFileContent, containsString("Maven Clean Plugin"))// + () -> assertThat(dependenciesFileContent, containsString("SonarQube Scanner for Maven")), + () -> assertThat(dependenciesFileContent, not(containsString("Maven Clean Plugin")))// ); } @@ -90,7 +95,7 @@ void testBrokenLinkReplacing() throws IOException { .linkReplacements( List.of("https://www.apache.org/licenses/LICENSE-2.0.txt|https://my-replacement.de"))); runFix(); - final String dependenciesFileContent = Files.readString(this.projectDir.resolve("dependencies.md")); + final String dependenciesFileContent = Files.readString(this.dependenciesFile); assertThat(dependenciesFileContent, containsString("https://my-replacement.de")); } diff --git a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/pom/PomFileGeneratorTest.java b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/pom/PomFileGeneratorTest.java index edf3c62e..9a491e70 100644 --- a/project-keeper/src/test/java/com/exasol/projectkeeper/validators/pom/PomFileGeneratorTest.java +++ b/project-keeper/src/test/java/com/exasol/projectkeeper/validators/pom/PomFileGeneratorTest.java @@ -65,10 +65,10 @@ void testGenerateWithDefaultModule() throws XmlPullParserException, IOException () -> assertThat(license.getName(), equalTo("My License")), () -> assertThat(license.getDistribution(), equalTo("repo")), () -> assertThat(pluginNames, - containsInAnyOrder("sonar-maven-plugin", "maven-compiler-plugin", "maven-enforcer-plugin", - "flatten-maven-plugin", "ossindex-maven-plugin", "reproducible-build-maven-plugin", - "maven-surefire-plugin", "versions-maven-plugin", "jacoco-maven-plugin", - "error-code-crawler-maven-plugin", "duplicate-finder-maven-plugin"))); + containsInAnyOrder("sonar-maven-plugin", "maven-compiler-plugin", "flatten-maven-plugin", + "ossindex-maven-plugin", "reproducible-build-maven-plugin", "maven-surefire-plugin", + "versions-maven-plugin", "jacoco-maven-plugin", "error-code-crawler-maven-plugin", + "duplicate-finder-maven-plugin"))); } static Stream testPluginsAddedByModuleCases() { @@ -160,4 +160,4 @@ void testReproducibleBuildPluginIsLast() throws XmlPullParserException, IOExcept assertAll(() -> assertThat(lastPlugin.getGroupId(), equalTo("io.github.zlika")), () -> assertThat(lastPlugin.getArtifactId(), equalTo("reproducible-build-maven-plugin"))); } -} \ No newline at end of file +} diff --git a/shared-model-classes/pk_generated_parent.pom b/shared-model-classes/pk_generated_parent.pom index f9bd4a16..c0a1c56f 100644 --- a/shared-model-classes/pk_generated_parent.pom +++ b/shared-model-classes/pk_generated_parent.pom @@ -54,7 +54,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -65,26 +65,6 @@ ${java.version} - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.codehaus.mojo flatten-maven-plugin @@ -138,7 +118,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates @@ -225,7 +205,7 @@ org.apache.maven.plugins maven-javadoc-plugin - 3.5.0 + 3.6.0 attach-javadocs @@ -240,6 +220,7 @@ true true true + true @@ -266,7 +247,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -307,7 +288,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify diff --git a/shared-test-setup/pk_generated_parent.pom b/shared-test-setup/pk_generated_parent.pom index 7a0f1110..b4aa26ca 100644 --- a/shared-test-setup/pk_generated_parent.pom +++ b/shared-test-setup/pk_generated_parent.pom @@ -43,7 +43,7 @@ org.sonarsource.scanner.maven sonar-maven-plugin - 3.9.1.2184 + 3.10.0.2594 org.apache.maven.plugins @@ -54,26 +54,6 @@ ${java.version} - - org.apache.maven.plugins - maven-enforcer-plugin - 3.4.0 - - - enforce-maven - - enforce - - - - - [3.8.7,3.9.0) - - - - - - org.codehaus.mojo flatten-maven-plugin @@ -127,7 +107,7 @@ org.codehaus.mojo versions-maven-plugin - 2.16.0 + 2.16.1 display-updates @@ -170,7 +150,7 @@ org.jacoco jacoco-maven-plugin - 0.8.10 + 0.8.11 prepare-agent @@ -211,7 +191,7 @@ com.exasol error-code-crawler-maven-plugin - 1.3.0 + 1.3.1 verify