javamavenwarjava-21

maven-war-plugin upgrade to java 21


We're using today

org.apache.maven.plugins:maven-war-plugin:2.1.1 which is working with java 11 which version do I need so it will work for java 21 ?

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war (default-war) on project landingzone: Execution default-war of goal org.apache.maven.plugins:maven-war-plugin:2.1.1:war failed: Unable to load the mojo 'war' in the plugin 'org.apache.maven.plugins:maven-war-plugin:2.1.1' due to an API incompatibility: org.codehaus.plexus.component.repository.exception.ComponentLookupException: Cannot access defaults field of Properties

Solution

  • I have changed the version of war plugin

    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>3.4.0</version>