SonarQube Gradle Plugin is not found by Artifactory - gradle

(This question elaborates on a a question I asked earlier, but with enough differences that I think it warrants a separate question)
This post on the Gradle forums describes similar symptoms, but not quite the same as my problem.
Like the poster there, I get the error:
Plugin with id 'org.sonarqube' not found.
when trying to use the SonarQube Gradle plugin with the following in my build.gradle file:
buildscript {
repositories {
mavenLocal()
maven { url 'http://[artifactory-url]:8081/artifactory/plugins-release/' }
}
dependencies {
classpath("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2")
}
}
apply plugin: 'org.sonarqube'
He says that his instance of Artifactory has cached the plugin, whereas mine hasn't. Similar to him, I'm behind a corporate firewall, and have no admin rights on Artifactory, but I can see that the plugins-release virtual repo does include both https://plugins.gradle.org/m2 and http://jcenter.bintray.com. Ordinarily, simply requesting a library from our Artifactory server makes it find and cache that library immediately, but in this case it is clearly failing.
When I remove the apply plugin... line, I see the following error:
> Could not find org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2.
Searched in the following locations:
file:/C:/Users/[username]/.m2/repository/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.pom
file:/C:/Users/[username]/.m2/repository/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.jar
http://[artifactory-url]/artifactory/plugins-release/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.pom
http://[artifactory-url]/artifactory/plugins-release/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.jar
So, I'm fairly sure that Artifactory is failing to find and cache the plugin. If I browse to https://plugins.gradle.org/m2/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.pom, I can get to the POM file, and the same for the JAR file, but I notice that if I browse to https://plugins.gradle.org/m2/org/sonarsource/scanner, it doesn't include 'gradle' as a subdirectory. I don't know if that's relevant, but perhaps that's the cause of the problem I'm seeing with Artifactory?
I'm not sure whether to raise this as a bug against the plugin, or if it's an Artifactory issue, or simply some kind of misconfiguration on our side. Any thoughts much appreciated!
Update with trace
Thanks to #drorb I got a trace from Artifactory, and found:
2016-04-12T10:28:40.918+01:00 Executing HEAD request to https://plugins.gradle.org/m2/org/sonarsource/scanner/gradle/sonarqube-gradle-plugin/1.2/sonarqube-gradle-plugin-1.2.pom
2016-04-12T10:28:40.924+01:00 Received status {} (message: 501) on remote info request - returning unfound resource
501 is 'not implemented', so I assume this is telling me that the plugins.gradle.org repo doesn't support HEAD requests, which seems to mean Artifactory can't query it properly. I'm surprised that it works for others though - perhaps there's some Artifactory config I can get changed to not do the HEAD request?
Further update with cause, but not really an answer
Further digging made me realise that the HEAD request does in fact give me a proper response (303 which leads to a 200), so I think the issue is connectivity from our Artifactory server. This doesn't seem worth adding as an answer, but I'll leave it here in case it helps someone else experiencing similar issues.

Here is a snippet of our Gradle conf, which works:
buildscript {
repositories {
maven {
url "http://[artifactory-url]:7980/artifactory/libs-release"
}
}
dependencies {
classpath "org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:1.2"
}
}
apply plugin: 'org.sonarqube'
The only difference I can see is that we put /artifactory/libs-release in the maven url, while you have /artifactory/plugins-release. Perhaps you should try pointing to libs-release, and see if that works?

Related

Fetch the latest version of a Maven artifact using search.maven

I need to fetch with an HTTP GET the latest version of the following Maven artifact as a JSON document:
https://mvnrepository.com/artifact/org.keycloak/keycloak-core
I'm trying with search.maven.org:
https://search.maven.org/?g=org.keycloak&a=keycloak-core&sort=latest&core=gav&rows=1
However I'm not getting anything as response
Previously I have been using "https://search.maven.org/solrsearch/" but recently I see this is going in timeout quite often
Any help?
Thanks

Why do I need to log in to Github

Because xlsx tag v1.1.0 does not contain the latest features, I use the following command to update the xlsx package to master
# go get github.com/bingoohuang/xlsx#master
Username for 'https://github.com':
Why do I still need to login to download the github public code, this does not happen when I download packages from other go get
The strange thing is that I can execute it on windows, but the above login question occurs on centos7.
what caused this to happen? I really appreciate any help with this.
It looks like github.com/bingoohuang/xlsx#master depends on github.com/bingoohuang/go-yaml, which either does not exist or is private.
Because GitHub responds with a 404 error for private repositories, it is likely this missing repository is causing go get to issue a password prompt.
A go get for a library without missing dependencies (e.g., go get github.com/rs/zerolog#master) works without a problem.

Gradle wrapper authenticated download credentials not being picked up from environment

Using gradle wrapper and specifying an internal repository URL to download the zip distribution - I followed the instructions from here: https://docs.gradle.org/5.2.1/userguide/gradle_wrapper.html#sec:authenticated_download
The https\://<username>:<password>#... in the distributionUrl works fine, but it's sub-optimal - we don't want credentials checked in source control. I tried:
systemProp.gradle.wrapperUser=<username>
systemProp.gradle.wrapperPassword=<password>
and confirmed that the properties are being set; however, they seem to be completely ignored. I keep getting a 401 unauthorized error when trying to access our internal repository. I tried all possibile combinations: systemProp.gradle.wrapperUser=username, gradle.wrapperUser=username and wrapperUser=username, nothing seems to work.
Any help is much appreciated.
Well, it turns out the issue was not with Gradle, but with IntelliJ, which seems to be overriding or completely ignoring the properties above. From a Unix shell script, everything works as advertised.

Bintray's JCenter not in Sync After publishing the file to Bintray

I have uploaded my library to jcenter successfully. I received the mail that my package has included to jcenter but I'm unable to use my package by adding compile 'com.opg.sdk:opgsdk_lite:1.0.0 to another project.
Mail from jcenter: Your request to include your package /onepoint/OPGSDKLite/OPGSDK_Lite_V1.6 in Bintray's JCenter has been approved.
I'm also unable to see my package in http://jcenter.bintray.com/
Thank you for submitting this issue.
Please note that we can see your package (https://bintray.com/onepointglobal/OpgsdkLiteAndroid/OPGSDKLite) under JCenter (http://jcenter.bintray.com/com/opg/sdk/opgsdk_lite/).
Can you please let us know if you still experiencing any issues?
Looking forward to your reply.
Yonatan Brand

GCM: java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender

I have been trying to get Google Cloud Messaging to work in eclipse. I was able to compile the example given on their demo webpage and run that without any errors; however, when I try to create my own example using jersey I get the run time error "java.lang.NoClassDefFoundError: com/google/android/gcm/server/Sender" when the following code tries to create a sender.
#POST
#Path("/send")
public Response sendMessage() throws IOException
{
Sender sender = new Sender("api_key");
Message message = new Message.Builder().build();
sender.send(message, DataStore.getDevices(), 5);
return Response.status(200).entity("Success").build();
}
Note: I have replaced my real api key with api_key. I know it works because I was able to get the demo working by running the ant commands explained in the tutorial. Also just to be specific in case of ambiguity, the error I am getting is server side, and has nothing to do with the android device.
Things I have already tried:
I have included the gcm-server.jar in my WEB-INF/lib folder and under project properties I have included it in the build path.
I have also tried, as mentioned on other sites, to include json_simple-1.1.jar the same way I included gcm-server.jar. I don't see how this would effect this error but I saw this listed as an answer in a few different places.
(Solution) Deleted the tomcat server and created a new one. I probably could have just cleaned the project instead and had the same results.
Demo tutorial link: http://developer.android.com/guide/google/gcm/demo.html.
I just found a solution to my problem. In frustration I deleted the old Tomcat server from eclipse and created a new one. When I ran the project again there weren't any problems at all. When I first set up the project I had included the jar files in WEB-INF/lib and later, after reading a lot of posts on the internet, added gcm-server.jar to the build path. It appears that this action would have fixed it but for some reason unknown to me there were some left over files on the server from before the change. I should have tried cleaning my project but I didn't even think about that being the issue. Anyway, I hope that this helps someone because I've sort of condensed all of the information I could find on the internet into this post, as well as included my own dilemma and solution to it.

Resources