I am getting this error on importing https://github.com/spring-projects/spring-mvc-showcase in STS 3.7.3:---
Description Resource Path Location Type
Failure to transfer org.codehaus.mojo:aspectj-maven-plugin:pom:1.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.codehaus.mojo:aspectj-maven-plugin:pom:1.2 from/to central: connect timed out pom.xml /spring-mvc-showcase line 1 Maven pom Loading Problem
Edit
Mvn is ok now but pom.xml error still persists if I remove the errors and do maven clean I get errors as:
[INFO] https://repo.maven.apache.org/maven2/org/codehaus/mojo/aspectj-maven-plugin/1.2/aspectj-maven-plugin-1.2.pom [INFO] ------------------------------------------------------------------------ [INFO] BUILD FAILURE [ERROR] Plugin org.codehaus.mojo:aspectj-maven-plugin:1.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.codehaus.mojo:aspectj-maven-plugin:jar:1.2: Could not transfer artifact org.codehaus.mojo:aspectj-maven-plugin:pom:1.2 from/to central: connect timed out -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
First of all STS is build on Eclipse. So you can easily install the IDE Integration Eclipse IDE - M2Eclipse for STS. You can see how here. If you want to use it with this integration plugin you dont need to have a local maven repository.
Resolving Maven dependencies from the Eclipse workspace without installing to local Maven repository
But its also possible to use maven as a local system repository. Download is here and follow the steps for the installation and configuration here.
To see if you have a valid maven installation done, you can test it by typing mvn -v in a cmd shell or using STS -> right click on your project -> run as -> maven build or maven install.
Update:
I would say delete the project from your workspace and try it again. Download the project from gitHub as a zip file and import it again to your workspace. Right Click -> import -> existing maven project.
If you need to use a proxy for your connection you have to create a settings.xml in your .m2 folder. Look here for more info
Related
I downloaded and imported a multi-module maven project say Project-A. In installed one of its modules say moduleA1 into my local repository and I can see it in the repository directory.
I created another Project-B which has moduleA1 as a dependency. But when I try to package Project-B, I notice that maven is searching for moduleA1 in the online central repository and it fails.
This is the error I get:
[ERROR] Failed to execute goal on project <project-B>: Could not resolve dependencies for project <Project-B>:war:1.0: Failed to collect dependencies at <moduleA1>:jar:<version>: Failed to read artifact descriptor for <moduleA1>:jar:<version>: Failure to find <moduleA1-groupId>:<moduleA1>:pom:<version> in 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 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
How can I make maven to resolve this moduelA1 dependency from my local repository.
This problem can occur if you have some child projects that refer to a parent pom (moduleA1 in your case) and you have not installed from the parent pom directory (run mvn install from the parent directory (i.e. Project-A in your case)). If one of the child projects (moduleA1 in your case) may depend on a sibling project (let's assume you have another module moduleA2) and when it goes to read the pom of the sibling, it will fail with the error mentioned in the question unless you have installed from the parent pom directory at least once. So just try running:
mvn -U clean install
from your Project-A directory
Maven automatically resolves dependencies from the local repository.
Without the exact error message, it is difficult to give a more precise answer.
If we use the 'LATEST' parameter when generating the project, the command 'mvn clean install' errors out. Should this parameter be used or should the latest version be provided in the command?
mvn archetype:generate "-DarchetypeGroupId=com.sap.cloud.s4hana.archetypes" "-DarchetypeArtifactId=scp-cf-tomee" **"-DarchetypeVersion=LATEST**" "-DgroupId=com.sap.cloud.s4hana.examples" "-DartifactId=my-app" "-Dversion=1.0-SNAPSHOT"
Error is
Error:
[INFO] Scanning for projects...
Downloading: https://repo.maven.apache.org/maven2/org/springframework/spring-framework-bom/5.1.1.RELEASE/spring-framework-bom-5.1.1.RELEASE.pom
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.myproxy.corp # com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25
#[ERROR] The build could not read 1 project -> [Help 1]
[ERROR][ERROR] The project com.sap.cloud.s4hana.examples:address-manager1:1.0-SNAPSHOT (C:\my-app\pom.xml) has 1 error
[ERROR] Non-resolvable import POM: Could not transfer artifact org.springframework:spring-framework-bom:pom:5.1.1.RELEASE from/to central (https://repo.maven.apache.org/maven2): proxy.wdf.sap.corp # com.sap.cloud.s4hana:sdk-bom:2.7.1-SNAPSHOT, C:\Users\xxxxxx\.m2\repository\com\sap\cloud\s4hana\sdk-bom\2.7.1-SNAPSHOT\sdk-bom-2.7.1-SNAPSHOT.pom, line 994, column 25: Unknown host proxy.myproxy.corp -> [Help 2]
[ERROR][ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR][ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException
The version 2.7.1-SNAPSHOT in not a released version. It is not available externally (maven-central). So, you cannot download it from maven central. However, 2.6.1 is available. That is why it works.
Please try with RELEASE instead of LATEST or better use released versions directly.
Please also check that settings.xml does not point to an internal snapshot nexus server and delete the local repository in your .m2 directory.
Have you checked your network configuration?
I can see a proxy and unknown host error in the log.
I worked on netbeans 8.2 so there when i create a project on maven -javafx the project does not buiilt it gives the following error.
Failed to execute goal org.apache.maven.plugins:maven-archetype-
plugin:3.0.1:generate (default-cli) on project standalone-pom:
Execution default-cli of goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate failed:
Plugin org.apache.maven.plugins:maven-archetype-plugin:3.0.1
or one of its dependencies could not be resolved:
The following artifacts could not be resolved: org.codehaus.groovy:groovy:jar:1.8.3,
org.apache.ant:ant:jar:1.8.1:
Could not transfer artifact org.codehaus.groovy:groovy:jar:1.8.3 from/to central
(http://repo.maven.apache.org/maven2): repo.maven.apache.org: Unknown host repo.maven.apache.org -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
A picture is also attached please help me solve this problem.picture of the problem
It appears you cannot reach the maven repository to download the dependencies!
see This question it helps find out which is the problem.
The url http://repo.maven.apache.org/maven2 you are using is it correct?
Can you reach this address from the machine on which you run the maven build?
I would like to try a copy of gwtp-carstore.
Step 1: Download https://github.com/ArcBees/GWTP via GitHub app
Step 2: In eclipse select import Maven Projects then browse to gwtp-carstore
I then get the error
No marketplace entries found to handle maven-gae-plugin:0.9.6:unpack in Eclipse. Please see Help for more information.
I select resolve later - then I get the error
Could not get configured mojo for org.apache.maven.plugins:maven-checkstyle-plugin:2.7:checkstyle {execution: validate}
Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.7 or one of its dependencies could not be resolved: Failure to find com.gwtplatform:gwtp-build-tools:jar:1.1-SNAPSHOT in http://repository.apache.org/snapshots was cached in the local repository, resolution will not be reattempted until the update interval of apache.snapshots has elapsed or updates are forced
From the command line I've run
mvn generate-sources and I get the errors
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-checkstyle-plugin:2.7:checkstyle (validate) on project gwtp-carstore: Execution validate of goal org.apache.maven.plugins:maven-checkstyle-plugin:2.7:checkstyle failed: Plugin org.apache.maven.plugins:maven-checkstyle-plugin:2.7 or one of its dependencies could not be resolved: Could not find artifact com.gwtplatform:gwtp-build-tools:jar:1.1-SNAPSHOT in apache.snapshots (http://repository.apache.org/snapshots) -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException
Any suggestions?
Cheers
Step 1 - Took a github checkout
Step 2 - Import into eclipse as maven project (it just downloaded half the internet i guess!!)
Step 3 - Use "Quick Fix" option from the "Marker" view to solve two maven errors as you report.
Step 4 - Fix error for "Update project configuration" account of above POM changes.
Remove/Disable the checkstyle plugin if the above steps do not help.
I'm using Maven 3.0.3. Evidently, the Oracle JDBC drivers are not available in a public Maven repo, so I'm reduced to installing it to my local one. So I created this file
~/.m2/repository/oracle/oracle/10.2.0.3.0/classes12.jar
I have this in my pom.xml file …
<dependency>
<groupId>oracle</groupId>
<artifactId>classes12</artifactId>
<version>10.2.0.3.0</version>
</dependency>
Yet upon running maven, I'm getting this error. How do I structure my local repo? - Dave
[ERROR] Failed to execute goal on project infinitiusa_leads_testing: Could not resolve dependencies for project infinitiusa_leads_testing:infinitiusa_leads_testing:jar:1.0-SNAPSHOT: Failure to find oracle:classes12:jar:10.2.0.3.0 in 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 -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
First of all, you must install the file in the repository, not only copy it to the right directory. See the answer: Find Oracle JDBC driver in Maven repository.
Secondly, the directory is actually not right. For the dependency you provided in pom.xml it should lie in:
~/.m2/repository/oracle/classes12/10.2.0.3.0/classes12-10.2.0.3.0.jar
But this is taken care of by install:install-file, don't manipulate the repository directory manually (except deleting some stuff, maven sometimes gets confused and it needs restart, but that's a different story).
mvn install:install-file -DgroupId=oracle -DartifactId=classes12 \
-Dversion=10.2.0.3.0 -Dpackaging=jar -Dfile=classes12.jar
BTW consider com.oracle as groupId.
Also maven typically gives the very exact command line you should run to install the missing dependency in your local repository. Don't know why it didn't happen in your case.