Couldn't use maven dependecies - java

ArtifactDescriptorException: Failed to read artifact descriptor for org.aspectj:aspectjrt:jar:1.6.10:
ArtifactResolutionException: Failure to transfer org.aspectj:aspectjrt:pom:1.6.10 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.aspectj:aspectjrt:pom:1.6.10 from/to central (http://repo.maven.apache.org/maven2): The operation was cancelled.
Or this:
Description Resource Path Location Type
The container 'Maven Dependencies' references non existing library C:\Users\...\\.m2\repository\org\springframework\spring-context\3.2.4.RELEASE\spring-context-3.2.4.RELEASE.jar p1 Build path Build Path Problem
And this:
Description Resource Path Location Type
The project cannot be built until build path errors are resolved p1 Unknown Java Problem
How to solve this maven problem?

I solve it by adding
central
Maven Repository Manager running on repo.mycompany.com
http://repo1.maven.apache.org/maven2
central

Related

maven configuration plugin issue

IM using eclipse java 2021-03-R and java jdk1.8.0 as i tried to configure the java project to maven Im getting error and im unable to clear. Pls help. Im trying to learn selenium automation.Please help.
oreException: 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): Failed to transfer http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-compiler-plugin/2.3.2/maven-compiler-plugin-2.3.2.pom. Error code 501, HTTPS Required

'Import getting Started Content' has encountered a problem

I have created new spring starter project in SpringSuiteTool. I am getting this error when I created new spring starter project.
ArtifactTransferException: com.google.guava:guava:jar:10.0.1 failed to transfer from https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced. Original error: Could not transfer artifact com.google.guava:guava:jar:10.0.1 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. java.lang.reflect.InvocationTargetException
Go to {userdir}/.m2/repository/com/google/guava/guava, delete 10.0.1 folder and re build the project

Maven Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2 or one of its dependencies could not be resolved

New to maven and ubuntu. Maven version is 3.0.5. First i imported a maven project into eclipse and there were lot of maven dependency error. So i did maven clean install from pom.xml location using terminal and subsequent mvn install command from terminal build was successful. But if I import the project again and update project into eclipse I see 5 errors.
Maven configuration Problem:
Description Resource Path Location Type
Failure to transfer org.apache.maven.plugins:maven-war-plugin:pom:2.2 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.plugins:maven-war-plugin:pom:2.2 from/to central (https://repo.maven.apache.org/maven2): connect timed out pom.xml /loga line"
Maven Problem
Description Resource Path Location Type
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.3 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.2.1, org.apache.maven:maven-artifact:jar:2.2.1, org.apache.maven:maven-core:jar:2.2.1, org.apache.maven:maven-settings:jar:2.2.1, org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1, org.apache.maven:maven-profile:jar:2.2.1, org.apache.maven:maven-model:jar:2.2.1, org.apache.maven:maven-repository-metadata:jar:2.2.1, org.apache.maven:maven-error-diagnostics:jar:2.2.1, org.apache.maven:maven-project:jar:2.2.1, org.apache.maven:maven-plugin-registry:jar:2.2.1, org.apache.maven:maven-plugin-descriptor:jar:2.2.1, org.apache.maven:maven-artifact-manager:jar:2.2.1, org.apache.maven:maven-monitor:jar:2.2.1, org.apache.maven:maven-toolchain:jar:2.2.1, org.codehaus.plexus:plexus-container-default:jar:1.5.5, org.codehaus.plexus:plexus-classworlds:jar:2.2.2: Failure to transfer org.apache.maven:maven-plugin-api:jar:2.2.1 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.2.1 from/to central (https://repo.maven.apache.org/maven2): Connect timed out pom.xml /loga line 334 Maven Project Build Lifecycle Mapping Problem
Description Resource Path Location Type
CoreException: Could not get the value for parameter compilerId for plugin execution default-testCompile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.3 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-plugin-api:jar:2.2.1, org.apache.maven:maven-artifact:jar:2.2.1, org.apache.maven:maven-core:jar:2.2.1, org.apache.maven:maven-settings:jar:2.2.1, org.apache.maven:maven-plugin-parameter-documenter:jar:2.2.1, org.apache.maven:maven-profile:jar:2.2.1, org.apache.maven:maven-model:jar:2.2.1, org.apache.maven:maven-repository-metadata:jar:2.2.1, org.apache.maven:maven-error-diagnostics:jar:2.2.1, org.apache.maven:maven-project:jar:2.2.1, org.apache.maven:maven-plugin-registry:jar:2.2.1, org.apache.maven:maven-plugin-descriptor:jar:2.2.1, org.apache.maven:maven-artifact-manager:jar:2.2.1, org.apache.maven:maven-monitor:jar:2.2.1, org.apache.maven:maven-toolchain:jar:2.2.1, org.codehaus.plexus:plexus-container-default:jar:1.5.5, org.codehaus.plexus:plexus-classworlds:jar:2.2.2: Failure to transfer org.apache.maven:maven-plugin-api:jar:2.2.1 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.2.1 from/to central (https://repo.maven.apache.org/maven2): Connect timed out pom.xml /loga line 334 Maven Project Build Lifecycle Mapping Problem
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (execution: default-compile, phase: compile) pom.xml /loga line 334 Maven Project Build Lifecycle Mapping Problem
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:3.3:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /loga line 334 Maven Project Build Lifecycle Mapping Problem
And if try to update maven project I get an error alert
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-war-plugin:2.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-war-plugin:jar:2.2
Plugin org.apache.maven.plugins:maven-war-plugin:2.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-war-plugin:jar:2.2
Same project I imported in windows environment and there were no errors Where as in ubuntu i see above errors. I have spent 10 hours googling with out any solution. Any help appreciated.

Error when importing project with maven

I'm starting to learn AngularJS and spring at work. I'm following this tutorial.
There it has a sample code that you can download from git
I'm following this steps:
Clone the project.
Eclipse -> Import -> maven project -> project called "basic"( which I download from the git source).
The problem is that maven detects the following errors:
Description Resource Path Location Type
Failure to transfer org.apache.maven:maven-core: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-core:jar:2.0.6 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. pom.xml /basic line 1 Maven Configuration Problem
Description Resource Path Location Type
CoreException: Could not get the value for parameter compilerId for plugin execution default-compile: PluginResolutionException: Plugin org.apache.maven.plugins:maven-compiler-plugin:3.1 or one of its dependencies could not be resolved: The following artifacts could not be resolved: org.apache.maven:maven-artifact:jar:2.0.9, org.apache.maven:maven-toolchain:jar:1.0, org.apache.maven.shared:maven-shared-utils:jar:0.1, com.google.code.findbugs:jsr305:jar:2.0.1, org.codehaus.plexus:plexus-component-annotations:jar:1.5.5, org.codehaus.plexus:plexus-compiler-api:jar:2.2, org.codehaus.plexus:plexus-classworlds:jar:2.2.2, org.apache.xbean:xbean-reflect:jar:3.4, log4j:log4j:jar:1.2.12, commons-logging:commons-logging-api:jar:1.1, com.google.collections:google-collections:jar:1.0, junit:junit:jar:3.8.2: Failure to transfer org.apache.maven:maven-artifact:jar:2.0.9 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-artifact:jar:2.0.9 from/to central (https://repo.maven.apache.org/maven2): The operation was cancelled. pom.xml /basic line 14 Maven Project Build Lifecycle Mapping Problem
I really don't understand the error, and I don't know where to look up for a fix.

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

Categories