Re:Making jenkins plugin - change context path

252 views
Skip to first unread message

Kevin Fleming (BLOOMBERG/ 731 LEXIN)

unread,
Jun 4, 2013, 11:07:30 AM6/4/13
to jenkin...@googlegroups.com
Why does it matter what the context path is? Your plugin should not care about that.

----- Original Message -----
From: jenkin...@googlegroups.com
To: jenkin...@googlegroups.com
At: Jun 4 2013 11:05:34

Hello,

I am developing jenkins plugin on Netbeans. My question is - how can I change jenkin's contextPath when I run my project in Netbeans or command line?

It always gets deployed to http://localdomain.com:8080/jenkins, and I need it to be deployed to root (http://localdomain.com:8080).

No matter whan I am doing, I always see

> Context path = /jenkins

in Netbeans log.

Besides, I cannot make it work via command line as well. This command

> mvn hpi:run -Dhpi.prefix=/lol

has no effect.

--
You received this message because you are subscribed to the Google Groups "Jenkins Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Lev Stipakov

unread,
Jun 4, 2013, 11:17:23 AM6/4/13
to jenkin...@googlegroups.com, Kevin Fleming
In my *.jelly files, I have something like:

$j.ajax({
 url: '/plugin/helloworld/api/json?depth=3',
 type: 'get',
}

If I have initial slash in url like above, it does not work on my dev machine, since plugin is deployed to "http://localhost:8080/jenkins". If I skip initial slash "/", request goes to address relative to current page, which also obviously does not work on both dev and production machine (where jenkins is deployed to root).

So far I am a bit stuck.

Jesse Glick

unread,
Jun 4, 2013, 12:17:35 PM6/4/13
to jenkin...@googlegroups.com
On 06/04/2013 11:17 AM, Lev Stipakov wrote:
> If I have initial slash in url like above, it does not work on my dev machine, since plugin is deployed to "http://localhost:8080/jenkins".

Then it is a good thing hpi:run picked the context path that it did, or you would be unaware of a critical bug in your plugin. See

https://wiki.jenkins-ci.org/display/JENKINS/Basic+guide+to+Jelly+usage+in+Jenkins#BasicguidetoJellyusageinJenkins-PredefinedURLs

for how to deal with URLs.

Lev Stipakov

unread,
Jun 4, 2013, 12:32:46 PM6/4/13
to jenkin...@googlegroups.com
Yep, thanks! ${rootURL} solved my problem.
Reply all
Reply to author
Forward
0 new messages