I want to switch my java spring project to maven and start from simple srtucture. I have created archetype project and add subfolder with Service.java in main package. I describe dependencies but get an error:
maven Could not find artifact org.springframework:spring:jar:3.1.1 i central (http://repo.maven.apache.org/maven2)
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.home.springtraining</groupId><artifactId>SpringTrainingTemplate</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SpringTrainingTemplate</name>
<url>http://maven.apache.org</url>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring</artifactId>
<version>3.1.1</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>3.8.1</version>
<scope>test</scope>
</dependency>
Do you know why I can not dowload this package?
Your version and artifact ID are wrong, they should be:
Note that since (AFAIR) Spring 3.0 there is no longer singel
spring.jar– you must includespring-core.jar,spring-context.jar,spring-beans.jarand whatever you also need. You can find all of them in maven repository.