1

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?

skaffman
  • 398,947
  • 96
  • 818
  • 769
EdwardLau
  • 1,139
  • 4
  • 20
  • 26

3 Answers3

3

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.

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
2

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
  • 5,140
  • 1
  • 32
  • 52
1

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.

Community
  • 1
  • 1
Pascal Thivent
  • 562,542
  • 136
  • 1,062
  • 1,124