When building with Maven 3.8.1, the build outputs a few warnings:
[WARNING] Some problems were encountered while building the effective model for io.dapr:dapr-sdk-springboot:jar:1.2.0-SNAPSHOT
[WARNING] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-web:jar -> duplicate declaration of version 5.2.10.RELEASE @ line 92, column 17
[WARNING]
[WARNING] Some problems were encountered while building the effective model for io.dapr:dapr-sdk-examples:jar:1.2.0-SNAPSHOT
[WARNING] 'dependencies.dependency.version' for org.junit.jupiter:junit-jupiter:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 100, column 16
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ line 175, column 15
[WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 190, column 15
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
The first warning (about duplicate dependencies) will indeed break with the upcoming release of Maven 4:
mvn -V test
Apache Maven 4.0.0-alpha-1-SNAPSHOT (5acdfb665035c5e57c50a9f8198dee53da674df6)
Maven home: /usr/local/Cellar/maven-snapshot/4.0.0-alpha-1-SNAPSHOT_217/libexec
Java version: 16.0.1, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-16.jdk/Contents/Home
Default locale: en_GB, platform encoding: UTF-8
OS name: "mac os x", version: "11.5", arch: "x86_64", family: "mac"
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] 'dependencies.dependency.(groupId:artifactId:type:classifier)' must be unique: org.springframework:spring-web:jar -> duplicate declaration of version 5.2.10.RELEASE @ line 92, column 17
[WARNING] 'dependencies.dependency.version' for org.junit.jupiter:junit-jupiter:jar is either LATEST or RELEASE (both of them are being deprecated) @ line 100, column 16
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-deploy-plugin is missing. @ line 175, column 15
[WARNING] 'build.plugins.plugin.version' for org.springframework.boot:spring-boot-maven-plugin is missing. @ line 190, column 15
The other ones (about missing versions for certain plugins) would be good to address anyway, as they make the build outcome dependent of the exact version of Maven that is in use.
My proposal is to improve the project setup by
- Removing the duplicate dependency declaration
- Specifying a version for all Maven plugins that the build uses - also the ones that are considered default Maven plugins.
When building with Maven 3.8.1, the build outputs a few warnings:
The first warning (about duplicate dependencies) will indeed break with the upcoming release of Maven 4:
The other ones (about missing versions for certain plugins) would be good to address anyway, as they make the build outcome dependent of the exact version of Maven that is in use.
My proposal is to improve the project setup by