Quantcast

How can I let Sonar know what its public URL username and password is?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

How can I let Sonar know what its public URL username and password is?

laredotornado2
Hi,

I'm using Jenkins 1.478, Sonar 3.2.1, and the Sonar-Jenkins plugin.  I have Sonar attached to the end of my Maven 2/3 job.  We have exposed Sonar on a public URL but require an HTTP Auth username and password to access it externally.  Is there a way to indicate to Sonar what the username and password it should use when accessing the URL?  Right now, running Sonar after the Jenkins job results in the exception …

[ERROR] Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project didoclient: Sonar server can not be reached at http://sonar.mydomain.com. Please check the parameter 'sonar.host.url'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project didoclient: Sonar server can not be reached at http://sonar.mydomain.com. Please check the parameter 'sonar.host.url'.
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can not be reached at http://sonar.mydomain.com. Please check the parameter 'sonar.host.url'.
        at org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.java:79)
        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more


I could change the server URL back to "http://localhost:9000" (in which everything works fine), but I would like the developers to be able to easily click on the link that results in the Jenkins job console output …

    [INFO] [17:35:56.010] Execute decorators...
    [INFO] [17:35:56.797] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000

and if I have "http://localhost:9000", they aren't able to.

Thanks, - Dave
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: How can I let Sonar know what its public URL username and password is?

Freddy Mallet
Hi David,

The Sonar analyser doesn't support any authentication mechanism which would filter access to the Sonar server instance. In such case, the only solution is to allow the Sonar analyser to access directly to the Sonar server through a private network. 

Kind regards,
Freddy
-----
Sonar for Continuous Inspection



On Fri, Oct 12, 2012 at 9:22 PM, laredotornado2 <[hidden email]> wrote:
Hi,

I'm using Jenkins 1.478, Sonar 3.2.1, and the Sonar-Jenkins plugin.  I have
Sonar attached to the end of my Maven 2/3 job.  We have exposed Sonar on a
public URL but require an HTTP Auth username and password to access it
externally.  Is there a way to indicate to Sonar what the username and
password it should use when accessing the URL?  Right now, running Sonar
after the Jenkins job results in the exception …

[ERROR] Failed to execute goal
org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project
didoclient: Sonar server can not be reached at http://sonar.mydomain.com.
Please check the parameter 'sonar.host.url'. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute
goal org.codehaus.mojo:sonar-maven-plugin:2.0:sonar (default-cli) on project
didoclient: Sonar server can not be reached at http://sonar.mydomain.com.
Please check the parameter 'sonar.host.url'.
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
        at
org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
        at
org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at
org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException: Sonar server can
not be reached at http://sonar.mydomain.com. Please check the parameter
'sonar.host.url'.
        at
org.codehaus.mojo.sonar.ServerMetadata.logSettings(ServerMetadata.java:79)
        at org.codehaus.mojo.sonar.SonarMojo.execute(SonarMojo.java:86)
        at
org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at
org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more


I could change the server URL back to "http://localhost:9000" (in which
everything works fine), but I would like the developers to be able to easily
click on the link that results in the Jenkins job console output …

    [INFO] [17:35:56.010] Execute decorators...
    [INFO] [17:35:56.797] ANALYSIS SUCCESSFUL, you can browse
http://localhost:9000

and if I have "http://localhost:9000", they aren't able to.

Thanks, - Dave




--
View this message in context: http://sonar.15.n6.nabble.com/How-can-I-let-Sonar-know-what-its-public-URL-username-and-password-is-tp5004010.html
Sent from the Sonar user mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Loading...