Obtaining TeamCity Root Url from Server Side plugin
Hi,
I have a serverside plugin where I need to know the root url for TeamCity.
I used to be able to do myServer.getRootUrl() but as of TC 2.0, this methos does not exist.
I see that one can use WebLinks, but it I am not sure how to instanciate it properly.
Thanks,
Scott
Please sign in to leave a comment.
The simplest way is to define WebLinks as argument of the constructor of
your class. In this case it will be provided automatically by Spring.
--
Pavel Sher
"Scott Hebert" <no_reply@jetbrains.com> wrote in message
news:10663083.1177014759455.JavaMail.itn@is.intellij.net...
>
>
>
>
>
Thank you. This works perfectly!
Scott
I'm using webLinks.getOverviewUrl() in TC 4 and it returns http://localhost/overview.html instead of the actual URL.
The "Server URL" under Administration > Server Configuration is the correct value.
Any idea what may be wrong ?
Thanks
Hussain
Please check what value is set for the rootURL in the main-config.xml file.
<server rootURL="...">
--
Pavel Sher
That value in main-config.xml is correct: <server rootURL="http://servername.companyname.com:8111">
Strange.
What value is returned by method SBuildServer.getRootUrl() ?
--
Pavel Sher
It returns http://localhost
Could you please send your plugin to teamcity-feedback [at] jetbrains.com to reproduce this problem?
--
Pavel Sher
I have the same problem..
any idea?
:(
Hello Ayellet,
What server URL do you see in Administration > Global Settings page in TeamCity UI? If it's the same as specified in main-config.xml, but you still get http://localhost using SBuildServer.getRootUrl() then please send your plugin for investigation using the "Submit a report" button on the top.