Hello,
My ServiceMix instance (v5.0.1) doesn't seem to be picking up my m2 settings
because I keep getting 401 unauthorized when trying to retrieve jars from
our artifactory instance. I've done what I believe to be the necessary
setup:
- Modified /opt/apache-servicemix/etc/org.ops4j.pax.url.mvn.cfg to include:
org.ops4j.pax.url.mvn.settings = /home/my-user/.m2/settings.xml
org.ops4j.pax.url.mvn.useFallbackRepositories=false
org.ops4j.pax.url.mvn.proxySupport=false
org.ops4j.pax.url.mvn.disableAether=true
org.ops4j.pax.url.mvn.defaultRepositories=file:${karaf.home}/${karaf.default.repository}@snapshots@id=karaf.${karaf.default.repository},\
file:${karaf.home}/local-repo@snapshots@id=karaf.local-repo
org.ops4j.pax.url.mvn.repositories= \
http://my.artifactoryonline.com/mystuff/libs-releases@id=my.releases, \
http://my.artifactoryonline.com/mystuff/libs-snapshots@id=my.snapshots@snapshots,
\
http://repo1.maven.org/maven2@id=maven.central.repo, \
http://repository.apache.org/content/groups/snapshots-group@snapshots@noreleases@id=apache.snapshots.repo,
\
http://svn.apache.org/repos/asf/servicemix/m2-repo@id=maven.smx.repo, \
http://repository.springsource.com/maven/bundles/release@id=springsource.release.repo,
\
http://repository.springsource.com/maven/bundles/external@id=springsource.external.repo,
\
http://oss.sonatype.org/content/repositories/releases/@id=maven.sonatype.repo,
\
https://maven.alfresco.com/nexus/content/groups/public/@id=maven.alfresco.repo
- Modified /home/my-user/.m2/settings.xml and $M2_HOME/conf/settings.xml to
include:
<servers>
<server>
<id>my.snapshots</id>
<username>uname</username>
<password>pword</password>
</server>
<server>
<id>my.releases</id>
<username>uname</username>
<password>pword</password>
</server>
</servers>
And this is the output I get from servicemix.log:
13:00:31,569 | TRACE | lixDispatchQueue | HttpURLConnection |
Proxy used: DIRECT
13:00:31,569 | DEBUG | lixDispatchQueue | HttpURLConnection |
sun.net.www.MessageHeader@6df391a27 pairs: {GET
/mystuff/libs-snapshots/com/mycompany/path/to/my/artifact/1.2.0-SNAPSHOT/pauser-1.2.0-SNAPSHOT.jar
HTTP/1.1: null}{User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95
Safari/537.11}{Cache-Control: no-cache}{Pragma: no-cache}{Host:
my.artifactoryonline.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2,
*/*; q=.2}{Connection: keep-alive}
13:00:31,572 | DEBUG | lixDispatchQueue | HttpURLConnection |
sun.net.www.MessageHeader@6df391a27 pairs: {GET
/mystuff/libs-snapshots/com/mycompany/path/to/my/artifact/1.2.0-SNAPSHOT/pauser-1.2.0-SNAPSHOT.jar
HTTP/1.1: null}{User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64)
AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95
Safari/537.11}{Cache-Control: no-cache}{Pragma: no-cache}{Host:
my.artifactoryonline.com}{Accept: text/html, image/gif, image/jpeg, *; q=.2,
*/*; q=.2}{Connection: keep-alive}
13:00:31,579 | TRACE | lixDispatchQueue | HttpURLConnection |
KeepAlive stream used:
http://my.artifactoryonline.com/mystuff/libs-snapshots/com/mycompany/path/to/my/artifact/1.2.0-SNAPSHOT/pauser-1.2.0-SNAPSHOT.jar
13:00:31,579 | DEBUG | lixDispatchQueue | HttpURLConnection |
sun.net.www.MessageHeader@11de5b138 pairs: {null: HTTP/1.1 401
Unauthorized}{Content-Type: application/json;charset=ISO-8859-1}{Date: Mon,
10 Nov 2014 18:00:31 GMT}{Server: nginx}{WWW-Authenticate: Basic
realm="Artifactory Realm"}{X-Artifactory-Id:
aolprod2-use-1d-mystuff}{Content-Length: 92}{Connection: keep-alive}
13:00:31,579 | TRACE | lixDispatchQueue | HttpURLConnection |
Requesting Authentication: host =my.artifactoryonline.com url =
http://my.artifactoryonline.com/mystuff/libs-snapshots/com/mycompany/path/to/my/artifact/1.2.0-SNAPSHOT/pauser-1.2.0-SNAPSHOT.jar
13:00:31,579 | TRACE | lixDispatchQueue | HttpURLConnection |
Authentication returned: null
13:00:31,579 | DEBUG | lixDispatchQueue | HttpURLConnection |
Server Authentication for AuthenticationHeader: prefer Basic
realm="Artifactory Realm" returned null
So, is there anything in addition to this setup that I need to do?
Thanks in advance,
Jordan
--
View this message in context:
http://servicemix.396122.n5.nabble.com/ServiceMix-not-picking-up-maven-authentication-settings-tp5721832.html
Sent from the ServiceMix - Dev mailing list archive at Nabble.com.