I just downloaded a Spring tutorial off the internet and am trying to run it in my local workspace. To do it, I first tried to get all the dependant jars needed by the project. I tried maven build and it failed because dependant jar's were missing from my local repository and those jar's were also missing from the remote repository(the one which my project uses)
Initially, my settings.xml only has a reference to the remote repository url which is used across the organization by various projects. I cannot expect it to be uptodate with latest jars. Can I get the remote repository names of the various utility projects fore.g for Log4j, commons logging, spring jars etc. I can then put these repository urls in my setting.xml to solve my issue.
EDIT: I even tried "http://repo1.maven.org/maven2/" which I thought houses all the required latest jars but even this wont work.
Example..
Missing:
1) log4j:log4j:jar:1.2.13
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=log4j -DartifactId=log4j \ -Dversion=1.2.13 -Dpackaging=jar -Dfile=/path/to/file
Path to dependency: 1) com.mkyong.core:Spring3Example:jar:1.0-SNAPSHOT 2) org.codehaus.castor:castor:jar:1.1.2.1 3) log4j:log4j:jar:1.2.13
2) xerces:xerces:jar:1.4.0
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=xerces -DartifactId=xerces \ -Dversion=1.4.0 -Dpackaging=jar -Dfile=/path/to/file
Path to dependency: 1) com.mkyong.core:Spring3Example:jar:1.0-SNAPSHOT 2) org.codehaus.castor:castor:jar:1.1.2.1 3) xerces:xerces:jar:1.4.0
3) commons-lang:commons-lang:jar:2.5
Try downloading the file manually from the project website.
Then, install it using the command: mvn install:install-file -DgroupId=commons-lang -DartifactId=commons-lang \ -Dversion=2.5 -Dpackaging=jar -Dfile=/path/to/file
My pom.xml:
<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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.mkyong.core</groupId>
<artifactId>Spring3Example</artifactId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<name>Spring3Example</name>
<url>http://maven.apache.org</url>
<properties>
<spring.version>3.0.5.RELEASE</spring.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.2</version>
<scope>test</scope>
</dependency>
<!-- Spring 3 dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>${spring.version}</version>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>${spring.version}</version>
</dependency>
<!-- Uses Castor for XML -->
<dependency>
<groupId>org.codehaus.castor</groupId>
<artifactId>castor</artifactId>
<version>1.1.2.1</version>
</dependency>
<!-- Castor need this -->
<dependency>
<groupId>xerces</groupId>
<artifactId>xercesImpl</artifactId>
<version>2.8.1</version>
</dependency>
</dependencies>
My setting .xml
<settings>
<localRepository>
C:\Repository
</localRepository>
<interactiveMode>true</interactiveMode>
<offline>false</offline>
<profiles>
<profile>
<id>R2</id>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
<repositories>
<repository>
<id>Log4j</id>
<url>http://central.maven.org/maven2</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>Artifact_Repository_Plugin</id>
<url>http://central.maven.org/maven2</url>
<layout>default</layout>
<releases>
<enabled>true</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</releases>
<snapshots>
<enabled>false</enabled>
<updatePolicy>never</updatePolicy>
<checksumPolicy>warn</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
</profile>
</profiles>
<pluginGroups>
<pluginGroup>com.hsbc.alm.maven.plugins</pluginGroup>
<pluginGroup>com.hsbc.alm.maven.scm</pluginGroup>
<pluginGroup>com.hsbc.alm.maven.jr2</pluginGroup>
</pluginGroups>
</settings>