1

I tried to upload a Windows build to Nexus with the Maven Commandline:

mvn deploy:deploy-file -Durl=http://unity.apps.company.net/nexus/content/repositories/idesktopbuildimages-releases/ -DrepositoryId=idesktopbuildimages-releases -DgroupId=images.WINDOWS7X64EnterpriseSP0unattendedcapture.sources -DartifactId=install -Dversion=6.4 -Dpackaging=wim -Dfile=install.wim 

And got the error:

Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-clean-plugin/2.4.1/maven-clean-plugin-2.4.1.pom

[WARNING] Failed to retrieve plugin descriptor for org.apache.maven.plugins:maven-clean-plugin:2.4.1: Plugin org.apache.maven.plugins:maven-clean-plugin:2.4.1 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-clean-plugin:jar:2.4.1

This happens because I don't have Internet access (only Intranet access).

So is there the possibility to divert to a locally stored maven-install-plugin file in my Maven Command?

PS: I tried -DpomFile but got the same output.

Solution:

Adding the Proxy settings to my settings.xml

Community
  • 1
  • 1
rugkei
  • 70
  • 7

2 Answers2

2

If you don't have internet access, I assume you have a mirror of maven central available on your intranet. If it's the case you must configure your settings.xml to declare the mirror. So add something like that in your settings.xml file:

<mirrors>
  <mirror>
    <id>central-mirror</id>
    <name>Local mirror of central repo</name>
    <url>http://unity.apps.company.net/nexus/content/repositories/central</url>
    <mirrorOf>central</mirrorOf>
  </mirror>
</mirrors>

EDIT

Other thing to look at : you may need to configure some proxy settings (it seems strange that they aren't already there...)

see this

Community
  • 1
  • 1
ben75
  • 29,217
  • 10
  • 88
  • 134
  • 1
    I already had a mirror but also tried yours `http://unity.apps.company.net/nexus/content/repositories/central mine: http://unity.apps.company.net/nexus/content/groups/releases` but both ended with the same warning, which I postet at the beginning. Now I can also see an error `[ERROR] No plugin found for prefix 'deploy' in the current project .. the plugin groups [org.apache.maven.plugins, org.codehaus.mojo] available from the repositories [local (C:\Users\BXXXXXX\.m2\repository), central (http://repo.maven.apache.org/maven2)]` Any opinions (central doesn't match)? – rugkei Sep 11 '13 at 11:35
  • Be sure to have the correct mirror url. There are multiple ways to configure Nexus and it's possible that maven plugins are mirrored somewhere else. (Usually, it's possible to browse the mirror repository with a simple web browser) – ben75 Sep 12 '13 at 09:54
  • 1
    With this url I can browse my own repository [link](http://unity.apps.company.net/nexus/index.html#view-repositories;idesktopbuildimages-releases~browsestorage) and here I can browse all repositories [link](http://unity.apps.company.net/nexus/index.html#view-repositories) and in the Maven Settings it shows me "Template ID = unity-artifacts" [link](http://unity.apps.company.net/nexus/service/local/templates/settings/unity-artifacts/content) and there I find this: `${baseurl}content/groups/releases` so the I posted in my comment above should be correct? – rugkei Sep 12 '13 at 11:37
  • Do you see the install-plugin when browse deeper in the repository (under org\apache\maven\plugins\maven-install-plugin) ? – ben75 Sep 12 '13 at 11:43
  • When searching for "maven-install-plugin" I get Group = org.apache.maven.plugins, Artifact = maven-install-plugin and diffrent version, e.g. 2.4 so it defenitely exists. How do I have to adjust my settings.xml to make it work? – rugkei Sep 12 '13 at 11:50
  • and what about maven-clean-plugin ? (the error posted is about the clean-plugin) – ben75 Sep 12 '13 at 11:52
  • oops, sorry. yes, the maven-clean-plugin also exists under org.apache.maven.plugins – rugkei Sep 12 '13 at 11:59
  • Good idea, I'll look at that. But it'll probably get complicated to configure it, because we're using a proxy pac. Will keep you posted. – rugkei Sep 12 '13 at 13:03
  • Hey, the Intranet traffic usually doesn't go over a Proxy but somehow it looks like it does for Nexus. W/e it's working now! Thanks a lot! – rugkei Sep 19 '13 at 06:22
1

You have to set up your settings file to access the public group of Nexus as described in the Nexus book and ensure that your Nexus server has access to Central.

The url for the public group should be .../nexus/content/groups/public. This default group has the "Central" repository in it.

If you are using a different group like your "releases" you should ensure that the Central repository (or Maven Central in older Nexus releases) is part of the list of ordered group repositories as visible at http://books.sonatype.com/nexus-book/reference/confignx-sect-managing-groups.html#fig-group-config

Once that is set you can confirm that the Central repository is reachable by checking out the the proxy repository Central itself in the repositories view and confirm that you can access the remote repo by using the "Browse Remote" tab visible in http://books.sonatype.com/nexus-book/reference/confignx-sect-manage-repo.html#fig-repo-config

If this browsing does not work you Nexus server is most likely blocked by an internal proxy server. If that is the case you have to configure it in Administration - Server - Default HTTP Proxy Settings.

Manfred Moser
  • 29,539
  • 13
  • 92
  • 123
  • 1
    ` unity-nexus ` The is http://unity.apps.company.net/nexus/content/groups/releases/ and it's always active. But how can I figure out if my Nexus server has access to Central? http://books.sonatype.com/nexus-book/reference/confignx-sect-managing-groups.html#fig-group-config in the picture there I can see "Maven Central" - must that be in the Ordered Group Repositories? What other things could I check? – rugkei Sep 12 '13 at 07:56