reset password
Author Message
agedam
Posts: 15
Posted 11:17 Apr 12, 2013 |

Hello

After completing steps 1 and 2 from Spring and Hibernate from scratch....I am getting an error in pom.xml in the second line(the red line appears):
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

When I click on dependencies, I get the following error messages:

ArtifactTransferException: Failure to transfer commons-logging:commons-logging:jar:1.1.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 commons-logging:commons-logging:jar:1.1.1 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar

ArtifactTransferException: Failure to transfer org.springframework:spring-expression:jar:3.2.2.RELEASE 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.springframework:spring-expression:jar:3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/org/springframework/spring-expression/3.2.2.RELEASE/spring-expression-3.2.2.RELEASE.jar

ArtifactTransferException: Failure to transfer org.springframework:spring-web:jar:3.2.2.RELEASE 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.springframework:spring-web:jar:3.2.2.RELEASE from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/org/springframework/spring-web/3.2.2.RELEASE/spring-web-3.2.2.RELEASE.jar

ArtifactTransferException: Failure to transfer aopalliance:aopalliance:jar:1.0 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 aopalliance:aopalliance:jar:1.0 from/to central (http://repo.maven.apache.org/maven2): connection timed out to http://repo.maven.apache.org/maven2/aopalliance/aopalliance/1.0/aopalliance-1.0.jar

I tried cleaning the project and redoing the whole process. Is there anything wrong I did?

 

 

 

 

cysun
Posts: 2935
Posted 12:12 Apr 12, 2013 |

Maven automatically downloads the project dependencies and saves them in a local folder ${USER}/.m2 - on Windows 7 it should be C:\Users\<username>\.m2.

If the downloading was interrupted, some files may be corrupted or incomplete, and currently Maven is not smart enough to re-download those files, so you just need to delete the cached dependencies and force Maven to re-download:

1. Make sure you have a reliable internet connection.

2. Delete the ${USER}/.m2 folder.

3. Right click on the project and select Maven -> Update Project

4. Wait until all background operations are finished. In Eclipse you can see the background operations in the Progress view.

agedam
Posts: 15
Posted 13:20 Apr 12, 2013 |

I followed the instructions..after all the background processes got over...I am getting the two errors as given in the screenshot.

Also I noticed that when I added the dependency of org.springframework:spring-webmvc, I start to get these errrors on pom.xml

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

 

Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Attachments:
Last edited by agedam at 13:24 Apr 12, 2013.
cysun
Posts: 2935
Posted 13:58 Apr 12, 2013 |
agedam wrote:

I followed the instructions..after all the background processes got over...I am getting the two errors as given in the screenshot.

Also I noticed that when I added the dependency of org.springframework:spring-webmvc, I start to get these errrors on pom.xml

Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

 

Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5
Plugin org.apache.maven.plugins:maven-resources-plugin:2.5 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.5

Create another project, add the spring-webmvc dependency and see if you get the same error.

Also check the .m2 folder and see if the resources plugin was downloaded correctly. It should be under the folder ${USER}\.m2\repository\org\apache\maven\plugins\maven-resources-plugin\2.5. Check if you have both the .jar file and .pom file. The .jar file should be about 26KB and the .pom file should be about 7KB.

agedam
Posts: 15
Posted 14:07 Apr 12, 2013 |

So I created another project. Now I am getting the error as shown in the screenshot.

 

Also in the maven files...the pom file is 1 KB rather than 7 KB. I have attached a screenshot of the folder.

cysun
Posts: 2935
Posted 14:11 Apr 12, 2013 |
agedam wrote:

So I created another project. Now I am getting the error as shown in the screenshot.

 

Also in the maven files...the pom file is 1 KB rather than 7 KB. I have attached a screenshot of the folder.

You should have a file with the .pom suffix but you don't, which means the previous download failed. Just delete the folder (i.e. 2.5/) and do a Maven update project again in Eclipse to force Maven to re-download the plugin.
 

jrodriguez
Posts: 33
Posted 12:42 Apr 16, 2013 |

Hi professor.  I am getting the same errors when I add the spring dependency

Project build error: 'dependencies.dependency.version' for org.springframework:spring-webmvc:jar is missing. 

 

Also in the pom file the error I'm getting is 

null (org.apache.maven.plugins:maven-war-plugin:2.1.1:war:default-war:package)

null (org.apache.maven.plugins:maven-resources-plugin:2.5:testResources:default-testResources:process-test-resources)

null (org.apache.maven.plugins:maven-resources-plugin:2.5:resources:default-resources:process-resources)

jrodriguez
Posts: 33
Posted 13:17 Apr 16, 2013 |

Has anyone found way to fix this error?

cysun
Posts: 2935
Posted 13:51 Apr 16, 2013 |
jrodriguez wrote:

Hi professor.  I am getting the same errors when I add the spring dependency

Project build error: 'dependencies.dependency.version' for org.springframework:spring-webmvc:jar is missing. 

...

You need to specify a version for the dependency. In the guide I didn't say which version because I want you to use the latest version. So for example, if it asks you to add a dependency "org.springframework:spring-webmvc", it means you should add the latest version of the dependency whose artifact id is spring-mvc and group id is org.springframework. You can easily find the dependencies if you use the GUI in Eclipse.

jrodriguez
Posts: 33
Posted 14:42 Apr 16, 2013 |

When I use the GUI on eclipse it does not give me any results for spring-webmvc.  Am I missing something else?  I have all the plugins installed. 

jrodriguez
Posts: 33
Posted 14:45 Apr 16, 2013 |

I have it working already.  It was 3.2.2.RELEASE for version