How to solve error related maven plugin loading failure - java

I'm following this tutorial and trying to create simple REST API example
http://crunchify.com/how-to-build-restful-service-with-java-using-jax-rs-and-jersey/
Every time I convert project to Maven project...This particular error comes up and I'm not able to solve it anyhow ...
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
How to solve it .. I already installed maven and set up the Environment variable.
"I have pretty steep timeline" .. any help will be appreciated.
Using Eclipse Mars
Jersey 1.9 bundle of jars
EDIT
EXACT ERROR
Errors occurred during the build.
Errors running builder 'Maven Project Builder' on project 'CrunchifyRESTJerseyExample1'.
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

Try deleting all the files under the .m2 repository folder and build the project again. 12533885

Related

Error Building Maven project when I do maven install

I'm trying to build a Maven Project using Spring Tool Suit from Eclipse and I'm having an error when I do the Maven Install.
First I do the Maven Clean and it works properly but when I do the maven install this error appears:
Failed to execute goal org.codehaus.mojo:build-helper-maven-plugin:1.9.1:regex-properties
(set-properties-with-regex) on project qad-webshell-pom:
Execution set-properties-with-regex of goal
org.codehaus.mojo:build-helper-maven-plugin:1.9.1:regex-properties failed:
Plugin org.codehaus.mojo:build-helper-maven-plugin:1.9.1 or
one of its dependencies could not be resolved:
Failed to collect dependencies at org.codehaus.mojo:build-helper-maven-plugin:jar:1.9.1 ->
org.beanshell:bsh:jar:2.0b4: Failed to read artifact descriptor
for org.beanshell:bsh:jar:2.0b4:
Could not transfer artifact org.beanshell:bsh:pom:2.0b4 from/to
central (http://repo1.maven.org/maven2):
Cannot access http://repo1.maven.org/maven2 with type default
using the available connector factories:
BasicRepositoryConnectorFactory:
Cannot access http://repo1.maven.org/maven2 using the registered transporter
factories: WagonTransporterFactory: java.util.NoSuchElementException
[ERROR] role: org.apache.maven.wagon.Wagon
[ERROR] roleHint: http'
I had the same issue.
I have restarted Eclipse, then go on the project specific maven module in which you have the error, right click > Maven > Update Project ...
After the Update on the specific module the Maven install worked without any error.

Could not calculate build plan at the creation of a maven project

I just created a new maven project, at the creation, I already have an error :
Description Resource Path Location Type
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom pom.xml /WD_Automation line 1 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) pom.xml /WD_Automation line 1 Maven Project Build Lifecycle Mapping Problem
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: Failure to transfer org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.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 org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 from/to central (http://repo.maven.apache.org/maven2): null to http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom pom.xml /WD_Automation line 1 Maven Project Build Lifecycle Mapping Problem
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /WD_Automation line 1 Maven Project Build Lifecycle Mapping Problem
I don't understand why because I haven't touch anything in the pom or anything else.
Do you have an idea ?
Maven tries to download plugins from MavenCentral, but fails. This is usually a network or proxy problem.
From the error message, maybe this repository http://repo.maven.apache.org/maven2 is unreached for you, you can search for a usable repositroy on the internet.
I replaced Eclipse Kepler 4.3.2 SR2 with java8 patches with Eclipse Photon 4.8.0, and the problem has gone.

Can't create maven project in STS

I can't create new maven project using this IDE Spring Tool Suite.
It show me the following errors
CoreException: Could not calculate build plan: Plugin
org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its
dependencies could not be resolved: Failed to read artifact descriptor
for org.apache.maven.plugins:maven-compiler-plugin:jar:3.1:
ArtifactResolutionException: Could not transfer artifact
org.apache.maven.plugins:maven-compiler-plugin:pom:3.1 from/to central
(https://repo.maven.apache.org/maven2): proxy.example.com
enter image description here
the version of my STS is 3.7.1 RELEASE
Could any one please help
I had the exact same problem and since I read somewhere that the error was caused by a cached file, I fixed it by deleting all the files under de .m2 repository folder. The next time I built the project I had to download all the dependencies again but it was worth it.

Maven error : Could not calculate build plan

I am getting the following errors and i do not know why. I have set up my project on multiple environments and Ive never had any issue but recently i have added the project to an environment running Windows 8 with everything set up correctly (e.g. Maven... ) and i seem to be getting this issue
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)
- Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.5.1:testCompile (execution: default-testCompile, phase: test-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: Could not transfer artifact org.apache.maven.plugins:maven-compiler-
plugin:pom:2.5.1 from/to central (http://repo.maven.apache.org/maven2): Address family not supported by protocol family: connect
- 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 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 org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to central (http://repo.maven.apache.org/maven2): Address family not supported
by protocol family: connect
and
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
I have looked at this online and have tried numerous different things listed below to try and resolve this issue but none of them seem to work. Just to note i am not using any proxies
Delete .m2 repository, Maven -> Update Project...
Delete all .lastUpdated files, Maven -> Update Project...
Tried selecting "Force Update of Snapshots/Releases" when updating project
Does anyone have any other ideas on what i could try?
In Eclipse, go to Windows > Preferences > Maven > User Settings
In User Settings, fill in the field with the path to settings.xml > %M2_HOME%\conf (or the correct path).
it seems like that your project doesn't install the dependency needed.
Therefore you need to install it yourself.
Download both jar and pom files from the Maven Repository and installing it using the command (better than copying to the folder directly)
mvn install:install-file -Dfile=<path-to-file> -DpomFile=<path-to-pomfile>
and also be sure that you have installed all the necessary repository for the project and cross verify in the .m2/repository folder with the jar files
I had similar error while setting up my project on new VM:
"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 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 org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to central (http://repo.maven.apache.org/maven2): connect timed out..."
Cause and Fix for this in my case :
I have apache-maven-3.2.5 installed on the system but found that
settings.xml file is missing in .M2 folder under my user name ( C:\Users\MyUserName.m2) hence above error on building the project
Steps to fix:
Step 1: Copy settings.xml from C:\Users\Public.m2 to .m2 folder under my username on the VM ( C:\Users\MyUserName.m2)
Step2: Using CMD run a clean install after navigating to the project to see if issue is fixed and project builds without error
like this :
C:\Selenium_Test_SetupB\WebUatDemo>mvn clean install

Error in Updating Maven - Spring MVC project

I am new to Spring MVC framework.I am trying to develop a web application following these steps here. I was going on well until I reached the stage of updating Maven to include dependencies; I got the following error after right click project --> Maven --> Update Project -tick Force Update of Snapshots/Releases --> Finish.
UPDATE
The following errors is shown in the IDE:
`ArtifactDescriptorException: Failed to read artifact descriptor for javax.inject:javax.inject:jar:1: ArtifactResolutionException: Could not transfer artifact javax.inject:javax.inject:pom:1 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org pom.xml /HelloSpringMVC line 1 Maven Dependency Problem`
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: Could not transfer artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.5.1 from/to central (http://repo.maven.apache.org/maven2): repo.maven.apache.org pom.xml /HelloSpringMVC line 136 Maven Project Build Lifecycle Mapping Problem
Set up the same example at my end and generated the issue.
Perform the following steps to fix the issue
right click project --> Maven --> Update Project -tick Force Update of Snapshots/Releases --> Finish.

Categories