New Maven project — pom.xml error [How to Solve]

After creating a maven project using the eclipse version integrated with maven, errors will appear in the configuration file pom.xml in the project and the referenced XSD file (errors are reported in the first and second lines)

One example of error reporting:

Multiple annotations found at this line:
– Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile)

– CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Could not transfer
artifact org.codehaus.plexus:plexus-compiler-javac:jar:1.8.1 from/to central ( http://repo.maven.apache.org/maven2 ): connection timed out to http://repo.maven.apache.org/maven2/org/codehaus/plexus/plexus-compiler-javac/1.8.1/plexus-compiler-javac-1.8.1.jar

– Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins :maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile)

Wait, the error information is similar

 

The reason is that there is a problem with the Maven integrated by eclipse (version problem or website access problem), and the newly installed Maven was not successfully added to the M2e plug-in

The solution is as follows:

step. 1 download the appropriate version of Maven from the official website and store it in the appropriate path (or read which jar package file is missing in the error report – the corresponding error report information will provide the website to download the missing file – copy to the corresponding path of the local warehouse)

step. 2 Open eclipse preferences – > Maven-> Usersettings change global settings and user settings to conf/settings.xml under Maven just downloaded

Step.3   Eclipse preferences – > Maven-> Installations click Add to add the Maven folder you just downloaded, and then check the version you downloaded instead of the built-in version.

step. 4 after the above two steps, you have successfully integrated your downloaded Maven version with eclipse. At this time, right-click the item that reported an error before and right-click run as – > Maven clean and run as – > Maven install.

step. 5 (if not already available): right click – > Maven-> Update Project     This step takes a little time. You can see whether the update is completed by looking at the lower right corner of the interface

Similar Posts: