tags:

views:

60

answers:

2

hello all,

i am new to maven and I am having what i'm sure is a config issue. i have my master pom and a child jar pom. inside the jar pom i declared this dependency:

<dependency>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
<version>2.4</version>
</dependency>

however when i look in my $HOME/.m2/repository dir, only the pom file is there. there is no jar file. most of the other dependencies have jar files, but not this one. without this jar, the compile step is failing.

any ideas about what i am doing wrong?

+1  A: 

The commons-lang 2.4 jar is on the Maven repo : http://repo1.maven.org/maven2/commons-lang/commons-lang/2.4/

There are several possibilities to solve your problem:

  • you can manually add the jar to your local repository, using the "mvn install:install-file" goal, or directly by putting the jar in the good directory
  • you can delete the commons-lang directory in your repository, and lauch Maven again. Sometimes, Maven download fails and a clenup of your local repository can solve the problem
Benoit Courtine
i tried deleting the directory and running mvn again. the same thing happens, i get a directory with a pom and no jar. i know i can run mvn install, but i'm trying to understand why its not working in the first place.
bostonBob
You can check the downloaded pom. The problem is probably in this file since Maven first downloads it, and then determine what he has to do. For example, if the packaging is set to "pom", the jar file won't be downloaded.
Benoit Courtine
+1  A: 

Is it possible that you are behind a proxy server/firewall, which is preventing downloads of "jar" files?

Raghuram
there were a number of issues causing this problem. First i had mis-matching repo IDs in my settings.xml and my master pom.xml. secondly, i was trying to use a public repo on the otherside of the firewall without adding the proxy information to my settings.xml
bostonBob