views:

34

answers:

3

I want to use the commons-lang by maven,but apache repository isn't ,I down commons-lang-src publish in local repository ,but is warning.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.4.3:test (default-test) on project commons-lang: There are test failures.

how to solve?

+2  A: 

This is not the way to do it. As you can see in this maven mirror listing, the commons/lang sources are already available in all maven repositories that mirror central, so there is no need to build them yourself (BTW: if you build the project, you are installing the compiled binaries, not the sources, so even a success wouldn't have helped you).

Here's how to do it (Assuming you use eclipse):

  1. If you use m2eclipse, just right-click the project and select Maven -> Download Sources
  2. If you use the maven-eclipse-plugin see the page about adding sources to libs

If you don't use eclipse, I know there are similar plugins for NetBeans and IntelliJ Idea.

seanizer
A: 

There are commons-lang binaries at repo1.maven.org.

http://repo1.maven.org/maven2/commons-lang/commons-lang/

Why don't use this?

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

Hope this will help you.

SourceRebels
+1  A: 

As an addition to @seanizer's answer, the command line solution is to use dependency:sources goal from the Maven Dependency Plugin:

dependency:sources tells Maven to resolve all dependencies and their source attachments, and displays the version.

So just run the following against your project on the command line

mvn dependency:sources

And maven will download the sources of dependencies, if they exist.

Pascal Thivent