2
votes

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?
1
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
I'm confused... Are you running Nexus on your local box? Is your IP 10.193.4.5?Ryan Stewart
Yes, 10.193.4.5 is the ip of my linux system.Bala
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.Ryan Stewart

1 Answers

1
votes

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.