Search code examples
javamaven-2apache-commons-lang

How to install commons-lang src to local repository?


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?


Solution

  • 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.