Rhyso
Rhyso

Reputation: 696

Maven build failing on dependencies

I have a local artefact repository which my maven settings are pointed at but for some reason this doesn't seem to hit it, and fails all the time when trying to do an install. I can access the url directly in my browser and can also access the maven repo via browser. I can also ping both.

Any ideas why it keeps failing? Stack trace below

Cheers,

mvn clean install -DskipTests -T 8C
[INFO] Scanning for projects...
Downloading: http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-webdav/1.0-beta-2/wagon-webdav-1.0-beta-2.pom
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]   
[ERROR]   The project uk.co.three:Three:0.1 (/Users/***/Projects/three/Development/pom.xml) has 1 error
[ERROR]     Unresolveable build extension: Plugin org.apache.maven.wagon:wagon-webdav:1.0-beta-2 or one of its dependencies could not be resolved: Failed to collect dependencies for org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2 (): Failed to read artifact descriptor for org.apache.maven.wagon:wagon-webdav:jar:1.0-beta-2: Could not transfer artifact org.apache.maven.wagon:wagon-webdav:pom:1.0-beta-2 from/to central (http://repo1.maven.org/maven2): Error transferring file: Connection refused -> [Help 2]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Upvotes: 6

Views: 42341

Answers (5)

Vijay C
Vijay C

Reputation: 4869

If you are using proxy and you have unzipped the Maven directory, then update settings.xml in {APACHE_MAVEN_DIR}\conf like below,

just update the "REPLACE~~" strings with the proper info, and try again.

<proxies>
 <proxy>
    <id>example-proxy</id>
    <active>true</active>
    <protocol>http</protocol>
    <host>proxy.example.com</host>
    <port>8080</port>
    <username>proxyuser</username>
    <password>somepassword</password>
    <nonProxyHosts>www.google.com|*.example.com</nonProxyHosts>
  </proxy>
</proxies>

Here is the official documentation for proxy configuration in maven settings.xml:

https://maven.apache.org/guides/mini/guide-proxies.html

Upvotes: 2

Volker Seibt
Volker Seibt

Reputation: 1536

I don't know if you used the embedded or an external maven installation (Window-> Preferences -> Maven -> Installations).

If it's external you have to declare your corporate proxy in the settings.xml (in the conf folder of your external installation or in your local repository).

It may be also the case if you use the embedded maven. Then you have to provide a settings file in "Global settings for embedded installation".

If you are using an external maven installation you can also try the command line outside eclipse.

With

mvn -U ...

You can force maven to look for the latest plugin versions.

Upvotes: 9

prabhugs
prabhugs

Reputation: 742

You can also try running the below command from withing your project,

$ git config --global url."https://".insteadOf git://

Upvotes: 0

Sajan Chandran
Sajan Chandran

Reputation: 11487

If you are behind the proxy, you can use

mvn clean install -DproxySet=true -DproxyHost=<your proxy host> -DproxyPort=<port>

Upvotes: 1

Amin Abu-Taleb
Amin Abu-Taleb

Reputation: 4511

Try to set up your eclipse's proxy configuration in

Settings -> General -> Network Connection

and try again, it seems to be a matter of visibility.

Upvotes: 0

Related Questions