Hi Martin,
Your super simplistic POM does not specify a parent, and as such it
inherits from the default POM that ships with Maven 3.6.3.
Using mvn help:effective-pom -Dverbose=true you can see how the
effective model for your project builds up, and there you'll find that
version 2.2 is determined by Maven 3.6.3 indeed.
You can declare the desired version for the Maven WAR Plugin by adding
this snippet to your POM:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.0</version>
</plugin>
Hope this helps.
Maarten
On 12/07/2020 15:21, Martin Funk wrote:
> How are the default versions of of a plugin in determined?
>
> My setup chooses:
> org.apache.maven.plugins:maven-war-plugin:2.2:war
> where I'd expect:
> org.apache.maven.plugins:maven-war-plugin:3.3:war
>
> I.e.: I downloaded the current maven and execute it in place:
> › ~/Downloads/apache-maven-3.6.3/bin/mvn -v
> Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
> Maven home: /Users/mafulafunk/Downloads/apache-maven-3.6.3
> Java version: 11.0.7, vendor: AdoptOpenJDK, runtime:
> /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
> Default locale: en_DE, platform encoding: UTF-8
> OS name: "mac os x", version: "10.15.5", arch: "x86_64", family: "Mac"
>
>
> When running
> › ~/Downloads/apache-maven-3.6.3/bin/mvn clean package
> agains this super simplistic pom.xml:
> <project>
> <modelVersion>4.0.0</modelVersion>
> <groupId>foo.bar</groupId>
> <artifactId>baz</artifactId>
> <version>1</version>
> <packaging>war</packaging>
> </project>
>
> An error ist thrown:
>
> [...]
> [INFO] Building war:
> /Users/mafulafunk/Code/gitlab/eigenfunk/eigen_microprofile/target/baz-1.war
> [INFO]
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.847 s
> [INFO] Finished at: 2020-07-12T15:13:41+02:00
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal
> org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project
> baz: Error assembling WAR: webxml attribute is required (or pre-existing
> WEB-INF/web.xml if executing in update mode) -> [Help 1]
> [...]
>
> Which surprises me as I thought the current plugin version 3.3.0
> https://maven.apache.org/plugins/maven-war-plugin/index.html
>
> What am I missing?
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]