Gradle + Sonar host URL and basic auth - gradle

Have a Sonar instance running behind basic auth (not Sonar auth).
Using the Sonar Gradle plugin and specifying the Sonar host URL in gradle.properties via:
systemProp.sonar.host.url=https://admin:password#sonarqube.host.com
However this does not seem to authenticate as in Gradle logs I see:
SonarQube server [https://admin:password#sonarqube.host.com] can not
be reached
If I curl the same URL I get a 200 response as expected.
Not sure why the sonar.host.url isn't playing nicely?

Two things:
proxy authentication between SonarQube Scanner and Server is only
supported since SonarQube 6.1
( SONAR-8084 )
with the above, http.proxyUser and http.proxyPassword are leveraged for basic proxy authentication (and you can leave sonar.host.url to the actual HTTP URL)

I'm not sure if my answer helps with the gradle plugin.
The maven plugin has the problem, that the first request does not use any credentials when calling /batch/index and I had to omit that route from basic auth. I think it's worth checking if that's the case here too.
Even using user:password#server was ignored completely by the plugin for the first call and I had no luck with sonar.useror any proxy user setup.
More details concerning my setup in my answer for the maven runner:
https://stackoverflow.com/a/60132667/1838233

Related

How to run sonar analysis when Sonar server is configured over HTTPS

We have a SonarQube server which is by default running on HTTP and 9000 port. We decided to use SonarQube over HTTPS configured using IIS reverse proxy and disable HTTP.
Previously in sonar-scanner.properties,sonar.host.url is configured to run as mentioned below.
sonar.host.url=http://localhost:9000 and now we want to change it to sonar.host.url=https://localhost.
On the browser https://localhost works fine. However when I configure this url in sonar-scanner.properties and try to run the sonar analysis, it says url can not be reached. Could anyone give me some suggestions to fix this issue.
Regards,
Sharieff.
Assign a valid certificate to your website. Using localhost is not the best choice; you should use and configure a valid domain name (https:/mycompany.com for example). On the machine you use to analyse you must update the Java Runtime by registering the certificate associated with this name and maybe also other (root) certificates in the certificate chain. See this blog for all the details. After executing these steps you should be able to upload the analysis to you SonarQube instance.

Cargo deploy uses proxy settings when it shouldn't

I'm using cargo to deploy my project to a test server. The cargo config is fine, works well on my local machine. However, on the hudson machine it always fails with a stacktrace showing:
Caused by: java.io.IOException: Server returned HTTP response code: 407 for URL: http://ppdtest.kbcsecurities.net:8080/manager/text/list
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1313)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.invoke(TomcatManager.java:507)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.list(TomcatManager.java:644)
at org.codehaus.cargo.container.tomcat.internal.TomcatManager.getStatus(TomcatManager.java:657)
at org.codehaus.cargo.container.tomcat.internal.AbstractTomcatManagerDeployer.redeploy(AbstractTomcatManagerDeployer.java:173)
... 34 more
The thing is however, I have NO proxy defined anywhere. Not in my setting.xml, not in the pom.xml files (parent or childs).
Anyone has some pointers or help to offer?
Are you sure that this is a proxy problem? The URL looks like it's Tomcat's Manager application. Can you verify that you're using the right credentials for your Tomcat instance?
If you want to make sure that no proxy is involved, please check the environment variables of the machine to see whether there's any global proxy setting that Java could be picking up, either in the global Maven options or in the options for Hudson.
One other thing to try is whether you can access the URL in question using a browser from the Hudson machine. If it's a headless machine, you can use a terminal browser like links and see if you can authenticate with that.

SoapUI global proxy testings not taken for test execution

I have created a web test project using the SoapUi GUI (free version). I need a proxy to connect to the Internet. Therefore, I have set the proxy host and port in File->Preferences->Proxy Settings and made sure that it is enabled. I know the proxy settings are correct, because I see the "soapUi Starter Page" properly. But to my surprise, these global proxy settings do not seem to be taken when running the web test case (I just configured a HTTP GET for http://www.google.com), and my request always times out.
I have failed to make it work both with version 4.0.1 and with 4.05 beta 1.
Can anyone help me with this?
Thanks
can you try with http://stackoverflow.com?
It seems soapui doesn't handle redirect right.

Free artifactory or nexus service url without password, for using in intellij idea

Intelliji Idea shiped with 3 free online repository in settings -> maven -> artifactory or nexus service url
http://oss.sonatype.org/service/local/
http://repo.jfrog.org/artifactory/api/
https://repository.jboss.org/nexus/service/local/
all this repos are unavialable (404 error or password protected).
Can you give more free artifactory or nexus service url without password protect?
IDEA has no settings for password on repo URL.
The service URLs are used for attaching remote libraries to a module by running class search queries using the REST APIs available at those URLs and downloading the found librarie from the remote Artifactory.
The REST URLs aren't meant to be directly browsable.
Maybe this explains it better: http://blogs.jetbrains.com/idea/2010/08/getting-external-libraries-easily/
IDEA uses the REST services to get listings of all the repositories available on each host. All three work for me on my machine which is on a network without an HTTP proxy. Is it possible you are on a network with a proxy?
Those urls appear to be pointed at the REST resources of each system, they aren't repositories, not sure what the intellij guys were attempting to do.
If you need a repo to host your own stuff in for free, see here: http://nexus.sonatype.org/oss-repository-hosting.html
If you are trying to access the repositories on Nexus, then you can find them by browsing http://oss.sonatype.org or https://repository.jboss.org/nexus/
Sonatype's service URL now only supports https, so if you're not finding expected artifacts, try updating your Intellij Idea Maven > Repositories setting to https://oss.sonatype.org/service/local/

SVNAnt Through Proxy

I just installed Ant for the first time today and have been playing with it. I am behind a proxy and I feel this is the source of my problems. I have managed to successfully create an ant build file which gets a web page over HTTP through a proxy without any problems. However, when I try to use SVNAnt to export a repository over HTTP through the proxy, I get "svn: HTTP proxy authorization failed" when the proxy task is exactly the same as in my Get build file. Any ideas what the problem might be?
See svn-proxy FAQ.

Resources