2

I am trying to configure it so that Karaf can access a Nexus Sonatype Server using a password which contains special characters.

I found the link here: https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol#MvnProtocol-repositories which specifies the need to use the format of http://user:password@host in the org.ops4j.pax.url.mvn.repositories portion of the configs. When I tried to use, say, an '@' in the password, I ran into the issue of it not being able to interpret this. So for instance:

http://user:p@ssword@host.example.com would complain about "unknown host" ssword@host.example.com.

I tried encoding the password. So I'd end up with my URL being http://user:p%40ssword@host.example.com. This would throw the following trace:

org.sonatype.aether.resolution.ArtifactResolutionException: Could not transfer artifact org.apache.felix:org.apache.felix.metatype:jar:1.0.8 from/to repository (http://user:p%40ssword@host.example.com/nexus/content/repositories/): Access denied to: http://host.example.com/nexus/content/repositories/bla/bla/bla.xml

For the record I tried adding a back slash before the '@' symbol and encoding the full URL to no avail. I am curious if anyone has any idea how I can get this to take passwords containing special characters?

catagon87
  • 548
  • 5
  • 21
  • A similar issue is reported for [JBoss Fuse](https://issues.jboss.org/browse/ENTESB-605). You may have to submit bug reports for Pax URL or Karaf. Any chance of changing the password to get around this? – approxiblue Jun 24 '15 at 02:00
  • Thanks for the reply. I saw this, but I don't think it applies. I don't see the package from that ticket mentioned at all in our pom.xml, or the stack trace. The error actually gets traced back to URL.java: org.ops4j.pax.url.mvn:1.6.0. Also the password can be changed, I just wanted to support passwords containing special characters. – catagon87 Jun 24 '15 at 15:29
  • I thought it was funny because quite a few different projects have this error. Here's one from [scp for Ant](https://bz.apache.org/bugzilla/show_bug.cgi?id=38082). In any case, your issue looks like a bug report to me. – approxiblue Jun 24 '15 at 23:05
  • You need to URL encode the @ as %40. It worked for me. https://stackoverflow.com/questions/10050877/url-username-with – Chirag Patel Apr 23 '20 at 19:15

0 Answers0