Error in Maven project packaging: error injecting constructor, java.lang.exceptionininitializererror: cannot access defaults field of properties at org.apache.maven.plugin.war.WarMojo.< init>( Unknown Source) while locating org.apache.maven.plugin.war.WarMojo
When locating org.apache.maven.plugin.war.warmojo, you cannot access org.apache.maven.plugin.war.warmojo. & lt; init>( Default field for the property at unknown source)
I found many methods on the Internet and finally came to the conclusion that it has nothing to do with the code. Just specify the package plug-in version in pom.xml:
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-war-plugin</artifactId> <version>3.2.2</version> </plugin> </plugins> </build>
My JDK version is 16. Change to the latest package plug-in version 3.2.2 to package successfully
Similar Posts:
- Maven warnning: ‘build.plugins.plugin.version’ is missing [How to Solve]
- [Solved] Spring Boot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0
- Maven no main manifest attribute when generate jar for project
- [Solved] SpringBoot Package Error: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-res
- Springboot 2.4 package error, missing web.xml
- [Solved] Dynamic Web Module 3.0 requires Java 1.6 or newer
- [Solved] Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode)
- [Solved] Error:java: error: release version 5 not supported & Switch Unrecognized String
- Spring boot: run startup error [How to Solve]
- [Solved] Spring Start Error: Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.2:test (default-test) on project gulimall-coupon: There are test failures. Please refer to D:\m1\0613\mall-coup