Maven build errors after upgrading from Eclipse Luna to Mars - eclipse

I've been using Eclipse Luna with the M2E plugin for some time. I recently decided to upgrade to Eclipse Mars but before I did that, I upgraded all my Maven plugins to the latest version. Once I did that, I verified that everything built on the comamnd line and also built inside Eclipse. I then fired up Eclipse Mars, installed the latest M2E plugin, and started importing my project. Unfortunately, things didn't go so well. I'm getting the following errors:
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile:
PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.5 or one of its dependencies could not be resolved:
The following artifacts could not be resolved:
org.apache.maven:maven-plugin-api:jar:3.0,
org.apache.maven:maven-model:jar:3.0
org.sonatype.sisu:sisu-inject-plexus:jar:1.4.2
org.apache.maven:maven-artifact:jar:3.0
org.apache.maven:maven-core:jar:3.0
org.apache.maven:maven-settings:jar:3.0
org.apache.maven:maven-settings-builder:jar:3.0
org.apache.maven:maven-repository-metadata:jar:3.0
org.apache.maven:maven-model-builder:jar:3.0
org.apache.maven:maven-aether-provider:jar:3.0
org.sonatype.aether:aether-impl:jar:1.7
org.sonatype.aether:aether-spi:jar:1.7
org.sonatype.aether:aether-api:jar:1.7
org.codehaus.plexus:plexus-classworlds:jar:2.2.3
org.apache.maven:maven-toolchain:jar:2.2.1:
Failure to transfer org.apache.maven:maven-plugin-api:jar:3.0 from https://repo.maven.apache.org/maven2 was cached in the local repository
resolution will not be reattempted until the update interval of central has elapsed or updates are forced.
Original error: Could not transfer artifact org.apache.maven:maven-plugin-api:jar:3.0 from/to central (https://repo.maven.apache.org/maven2):
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to
find valid certification path to requested target pom.xml /pacbridge-utl line 4 Maven Project Build Lifecycle Mapping Problem
Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.6:resources failed:
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved:
The following artifacts could not be resolved:
org.apache.maven:maven-plugin-api:jar:2.0.6
org.apache.maven:maven-project:jar:2.0.6
org.apache.maven:maven-profile:jar:2.0.6
org.apache.maven:maven-artifact-manager:jar:2.0.6
org.apache.maven:maven-plugin-registry:jar:2.0.6
org.apache.maven:maven-core:jar:2.0.6
org.apache.maven:maven-plugin-parameter-documenter:jar:2.0.6
org.apache.maven:maven-repository-metadata:jar:2.0.6
org.apache.maven:maven-error-diagnostics:jar:2.0.6
org.apache.maven:maven-plugin-descriptor:jar:2.0.6
org.apache.maven:maven-artifact:jar:2.0.6
org.apache.maven:maven-settings:jar:2.0.6
org.apache.maven:maven-model:jar:2.0.6
org.apache.maven:maven-monitor:jar:2.0.6:
Failure to transfer org.apache.maven:maven-plugin-api:jar:2.0.6 from https://repo.maven.apache.org/maven2 was cached in the local repository,
resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer
artifact org.apache.maven:maven-plugin-api:jar:2.0.6 from/to central (https://repo.maven.apache.org/maven2):
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target (org.apache.maven.plugins:maven-resources-plugin:2.6:resources:default-resources:process-resources)
I compared my Eclipse settings (between Luna and Mars) and everything looks the same. In particular, I've made sure the Windows/Preferences/General/Network Connections are the same (i.e. my proxies are setup properly) and I've tried running "mvn -U clean install" from the command line. As I say, the command line build runs fine but Eclipse Mars just won't build. Can anyone suggest a solution? BTW: I'm using Maven 3.3.3 with Java 8
Thanks.

It turns out the M2E plugin was using the wrong Settings.xml file, one that did not have a reference to the correct plugin-repo. Once I fixed the that (in Windows->Preferences->Maven->User Settings) thing started working again.

Related

How to fix this Maven error in eclipse - "Could not calculate build plan: Plugin or one of its dependencies cannot be resolved""

When trying to create a Maven project in Eclipse for Selenium, I am getting the following errors in my POM.xml :
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.8.0 or one of its dependencies could not be resolved
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.8.0:compile (execution: default-compile, phase: compile)
org.apache.maven.plugins:maven-resources-plugin:pom:3.0.2 from http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.8.0:testCompile (execution: default-testCompile, phase: test-compile)
I am using the following artifacts :
Eclipse - Version: Kepler Service Release 2
Maven artifact id - maven-archetype-quickstart - v1.4
Group id - org.apache.maven.archetypes
You have to fix your settings or maven installation to use the HTTPS version of http://repo.maven.apache.org/maven2 (https://repo.maven.apache.org/maven2): that probably what is blocking your Eclipse installation from finding the dependency, and therefore from continuing.
This is what happens when you type in the HTTP url:
501 HTTPS Required.
Use https://repo.maven.apache.org/maven2/
More information at https://links.sonatype.com/central/501-https-required
To fix that:
Update your Eclipse installation to latest (2020.06)
Update your Maven to latest (3.6.3)
You may clean up the "*.lastUpdated" files from your local repository (%USERPROFILE%\.m2\repository\). They may block Maven from retrying to download dependency (their purpose is actually to avoid download missing dependency more than once a day).
If the previous items failed, you may also try to add the HTTPs repository in your settings: https://maven.apache.org/guides/mini/guide-multiple-repositories.html
Note: Kepler is very old. If you can't, for various reason, switch to latest Eclipse, you may also update maven and build the pom with maven directly rather than Eclipse. m2e (the Eclipse Plugin in charge of handling maven) does not use the mvn installation for dependency resolution.

RapidClipse Error

Am new to RapidClipse. I tried running it and got this error.
Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'test2'.
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Plugin org.apache.maven.plugins:maven-resources-plugin:2.6 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.6
Please help.
RapidClipse projects are maven projects who are build with a maven plugin.
The 'Maven Project Builder' itself uses some additional plugins, among others the "maven-resources-plugin".
If a plugin doesn't exist in local repository, maven searches for it in remote repositories and tries to download it automatically to the local repository (default location: .m2/repository folder in user home directory).
This process fails here.
You can trigger the resolve-and-download process manually:
Be sure there is a working internet connection and, if necessary, the proxy settings are correct.
Rightclick on a Rapidclipse project in ProjectManagement or Project Explorer and go to Maven - Update project
Activate the checkbox Force Update of Snapshots/Releases and finish the dialog with OK
After that, the building process for the project should work.

Accessing local Nexus repository over https from eclipse

I am using maven build in my project. I have a corporate nexus repository in our local network. This repository is hosted over https.
I am facing issues accessing this repository from eclipse.
The error displayed is:
Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:compile (execution: default-compile, phase: compile)
- CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.5.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-compiler-plugin:jar:2.5.1: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from https://
NexusServer/nexus/content/groups/CLM/ was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced. Original
error: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to nexus (https://NexusServer/nexus/content/groups/CLM/):
sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-compile)
I googled a bit and found a solution to pass the certificate while running maven build. I downloaded the certificate and passed it to maven using -Djavax.net.ssl.trustStore=Path/To/My/KeyStore
The command line tool works fine. However, I am still not able to build the project using maven in eclipse.
Maven does not download new dependencies form the local repository.
Thanks in advance for you help!
Prabodh
Your Nexus is using an SSL certificate which is not considered to be valid by the Java running Eclipse. This is because the certificate in Nexus was not signed by a trusted root certificate authority such as Verisign.
You'll need to install the public certificate in Nexus into the Java truststore of the Java running Eclipse to fix this, then it will be trusted. You can use our import-ssl.jar utility to help you with this, see section 24.2.3 here:
https://books.sonatype.com/nexus-book/reference/ssl-sect-client-cert.html

ArtifactDescriptorException: Failed to read artifact descriptor Maven error

I am using the latest Eclipse for Java EE with JBoss Tools installed so Maven is included. I imported an existing Maven project to my workspace and tried to update the dependencies but I only get errors error in my POM that some argument is invalid and no artifact could have been transfered.
There are actually two different errors and maybe they depend on each other?
You can check: the server is available and I also tried to reinstall Eclipse and JBoss. So what else is missing?
ArtifactDescriptorException: Failed to read artifact descriptor for
edu.kit.aifb.ai2.sqsclient:sqsclient:jar:1.0.0:
ArtifactResolutionException: Failure to transfer
edu.kit.aifb.ai2.sqsclient:sqsclient:pom:1.0.0 from
http://eorg-ai2.aifb.kit.edu:8081/nexus/content/repositories/releases
was cached in the local repository, resolution will not be reattempted
until the update interval of Beehive has elapsed or updates are
forced. Original error: Could not transfer artifact
edu.kit.aifb.ai2.sqsclient:sqsclient:pom:1.0.0 from/to Beehive
(http://eorg-ai2.aifb.kit.edu:8081/nexus/content/repositories/releases):
Invalid argument: getsockname to
http://eorg-ai2.aifb.kit.edu:8081/nexus/content/repositories/releases/edu/kit/aifb/ai2/sqsclient/sqsclient/1.0.0/sqsclient-1.0.0.pom
There is indeed nothing in my repository-folder but .pom.lastUpdated-files
Error resolving version for plugin
'org.apache.maven.plugins:maven-shade-plugin' from the repositories
[local (C:\Users\Gregor.Gregs.m2\repository), central
(http://repo1.maven.org/maven2)]: Plugin not found in any plugin
repository
Thank you
For me it was because Eclipse was caching the exception ( even after I solved the original problem ) so try to:
right click on project -> maven -> update-project -> force to update snapshot/release -> OK.
it worked for me for a similar problem.
Check in you eclipse that settings file path is pointing to right one.
Window --> Preferences --> Maven--> User Settings.
right click on project -> maven -> update-project -> force to update snapshot/release -> OK.
it worked for me too

Eclipse maven plugin getting HTTP 416 when retrieving jar

I'm getting this error in the eclipse logs when I use the maven integration plugin for eclipse in my project:
Build errors for transport-data; org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources (default-resources) on project transport-data: Execution default-resources of goal org.apache.maven.plugins:maven-resources-plugin:2.4.3:resources failed: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4, org.apache.maven.shared:maven-filtering:jar:1.0-beta-4, org.codehaus.plexus:plexus-interpolation:jar:1.13: Failure to transfer org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4 from http://repo1.maven.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact org.codehaus.plexus:plexus-interactivity-api:jar:1.0-alpha-4 from/to central (http://repo1.maven.org/maven2): Failed to transfer http://repo1.maven.org/maven2/org/codehaus/plexus/plexus-interactivity-api/1.0-alpha-4/plexus-interactivity-api-1.0-alpha-4.jar. Error code 416, Requested Range Not Satisfiable
From the browser I can access the jar but how come the plugin gets a 416 status response?
I'm using STS 2.7.2.RELEASE (Eclipse 3.6) with the Maven Integration plugin on Maven 2.2.1
and my OS is Ubuntu 10.10. If someone could please help explain this mystery to me I'd be very grateful.
Thanks!
I know that this is a very old request, but I just came across it too. What worked for me was deleting the relevant downloaded components in the .m2 repository. I figured that there may be some partially-loaded bits in there as I had used both Eclipse and command line with maven.
Hope this helps...
HTTP 416 means that the client requested only a portion of the file, but the server probably doesn't support such requests. Though I would be surprised if maven would have broken their repo webserver.
Another possibility is that you are behind a proxy which doesn't support range requests.