2

I am new to Sonatype Nexus and Maven and trying examples as given in Maven by Example. I have a problem deploying artifacts generated by Maven to Nexus running on Linux. If my pom.xml has 'localhost:8081' as the repository, the deployment is a success. If I replace localhost with an IP address (10.193.4.5:8081) deployment fails with 'Access denied' error. Details below.

Error:
Downloading: h ttp://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata org.sonatype.mavenbook.simple:parent:0.8-SNAPSHOT/maven-metadata.xml from/to testing
(http://10.193.4.5:8081/nexus/content/repositories/snapshots): Access denied to: http://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml
org.sonatype.aether.transfer.MetadataTransferException:
Could not transfer metadata org.sonatype.mavenbook.simple:parent:0.8-SNAPSHOT/maven-metadata.xml from/to testing (http://10.193.4.5:8081/nexus/content/repositories/snapshots): Access denied to:
http://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml

My configuration details are as follows.

  1. Nexus (nexus-oss-webapp-1.9.1.1) installed on linux_x64 (RHEL5) as "root" user and running as service
  2. Maven Apache Maven 3.0.3 (r1075438; 2011-02-28 23:01:09+0530) Maven home: /usr/local/apache-maven/apache-maven-3.0.3 Java version: 1.6.0_16, vendor: Sun Microsystems Inc. Java home: /usr/java1.6.0_16/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "2.6.18-8.el5", arch: "amd64", family: "unix"
  3. settings.xml snapshots deployment deployment
  4. pom.xml testing Internal Releases http://10.193.4.5:8081/nexus/content/repositories/snapshots</url>--> http://localhost:8081/nexus/content/repositories/snapshots

I guess this is related to a permission problem on Linux, and I am not able to debug.

  1. What should be the ideal user for Nexus to run root or Nexus?
  2. What should be the group and owner for a Sonatype-work folder?
4
  • I am not familiar with Nexus, but this looks more like a nexus setup problem than a file permission problem to me. Did you check your nexus security settings?
    – Torsten
    Jul 15, 2011 at 16:26
  • I'm confused... Are you running Nexus on your local box? Is your IP 10.193.4.5? Jul 15, 2011 at 18:23
  • Yes, 10.193.4.5 is the ip of my linux system.
    – Bala
    Jul 16, 2011 at 12:04
  • When you add a comment, if you want to get someone's attention, you need to @<user> them. e.g., you'd want to add @Ryan to get my attention. I just happened to notice you had replied to my question, or I wouldn't have known. Jul 18, 2011 at 13:59

1 Answer 1

1

Your problem is most likely related to networking and not to the Nexus setup. Try

nc -vz 10.193.4.5 8081

at the console to see if you can route packets to that address. To make it work with the IP, you'll probably need to add an /etc/hosts entry.

10
  • :"Connection to 10.193.4.5 8081 port [tcp/tproxy] succeeded!".
    – Bala
    Jul 19, 2011 at 10:16
  • I tried the nc command from the linux system and its succeeded.
    – Bala
    Jul 19, 2011 at 11:01
  • Then maybe nexus really is the one denying access. What about wget http://10.193.4.5:8081/nexus/content/repositories/snapshots/org/sonatype/mavenbook/simple/parent/0.8-SNAPSHOT/maven-metadata.xml? Does that work? Jul 19, 2011 at 14:43
  • Yes, I am able to download the xml using wget. (PS: This xml was deployed to sonatype nexus using localhost. 'Access denied error' is when deploying using IP)
    – Bala
    Jul 19, 2011 at 15:00
  • @Bala: You don't happen to be changing the repository's id when you change localhost to 10.193.4.5, do you? Jul 19, 2011 at 19:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.