SonarQube 5.1 running on Ubuntu 12.04.4 LTS
Jenkins ver. 1.616 running on Ubuntu 12.04.4 LTS
SonarQube Plugin 2.2.1
Artifactory Pro Power Pack 3.8.0 (rev. 30190) running on Ubuntu 12.04.5 LTS

sbt 0.13.8

Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.8.0_45, vendor: Oracle Corporation
Java home: /usr/lib/jvm/jdk1.8.0_45/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.5.0-23-generic", arch: "amd64", family: "unix"

Attempting to use the SonarQube Jenkins Plugin in a Jenkins Build, the plugin 
seems to try to rebuild the entire build and re-resolve all the dependencies 
out of Artifactory.  Problem is, unlike the rest of the build, when the 
SonarQube plugin requests artifacts from Artifactory, it does so as a 
non-authenticated-user, and Artifactory refuses the request.

I've tried everything from copying the <servers/>, <profiles/>, and 
<activeProfiles/> from the jenkins user's settings.xml file into 
/etc/maven.settings.xml and explicitly telling the plugin to use the former as 
user settings and the latter as system settings - in short, anything and 
everything I could find documented to force the plugin to use the jenkins 
user's credentials , but still it just keeps connecting as a non-authenticated 
user and having its requests refused.

Example from Jenkins Log (sensitive information obfuscated):

INFO: No credentials available for BASIC 'Artifactory 
Realm'@libs.<organization>:443
[WARNING] Could not transfer metadata <GAV>/maven-metadata.xml from/to 
ArtifactorySnapshotsRepo (https://<server>/artifactory/libs-snapshot/): Not 
authorized.

[WARNING] The POM for org.codehaus.jackson:jackson-core-asl:jar:1.8 is missing, 
no dependency information available
[WARNING] The POM for org.codehaus.jackson:jackson-mapper-asl:jar:1.8 is 
missing, no dependency information available
[WARNING] Failure to transfer <GAV>/maven-metadata.xml from 
https://<server>/artifactory/libs-snapshot/ was cached in the local repository, 
resolution will not be reattempted until the update interval of 
ArtifactorySnapshotsRepo has elapsed or updates are forced. Original error: 
Could not transfer metadata <GAV>/maven-metadata.xml from/to 
ArtifactorySnapshotsRepo (https://<server>/artifactory/libs-snapshot/): Not 
authorized.

And in Artifactory's request.log we get (again with sensitive information 
obfuscated):

20150916190344|5181|REQUEST|<Jenkins 
IP>|non_authenticated_user|GET|/libs-snapshot//<GAV>/maven-metadata.xml|HTTP/1.0|401|0

The maven command launched by the SonarQube Plugin was as follows (lines broken 
for clarity, sensitive information obfuscated):

mvn
-f /var/lib/jenkins/workspace/NE-BUILD-1/pom.xml
-s /var/lib/jenkins/.m2/settings.xml
-gs /etc/maven/settings.xml
-e
-B org.codehaus.mojo:sonar-maven-plugin:2.6:sonar
-Dsonar.jdbc.url=jdbc:postgresql://<server>:<port>/sonar
******** ********
-Dsonar.host.url=http://<server>:<port>/
-Dsonar.branch=sbt-publish-deb ******** ********

How can I make this process authenticate to Artifactory properly?

------------------------------------------------------------------------------
_______________________________________________
Artifactory-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/artifactory-users

Reply via email to