Re: Reading from Messages.properties file

2014-08-16 Thread Karthik V S
I have solved the issue. Apparently, my Messages.Properies was under the 
default package in target/generated-sources. It should have been under the 
package name of my project. Solved the issue. Thanks. :)

On Friday, 15 August 2014 13:41:49 UTC-7, Karthik V S wrote:

 Hi,

 I have attached my POM.xml and I have not done any additions to it.

 On Friday, 15 August 2014 13:35:15 UTC-7, slide wrote:

 I have NEVER had to add anything manually for the Messages stuff. It 
 sounds like something is incorrect in your setup. Can you post your pom.xml 
 so it can be looked over?


 On Fri, Aug 15, 2014 at 1:27 PM, Karthik V S karthik...@gmail.com 
 wrote:

 Hi,

 As correctly pointed out, the file Messages.java gets generated 
 automatically without adding anything to the POM File besides inheriting 
 from the parent.

 But however after the file gets generated in* 
 targets/generated-sources/Messages.Java, *if I attempt to invoke the 
 functions in my Action class located in src/main/java/MyPackage, the 
 Netbeans IDE throws an error while compiling saying *Unable to resolve 
 symbol Messages.*

 I read that we have to manually add the class to the source root. What 
 does that mean?

 This is the final step in my plugin development and I m stuck with it. 
 It would be great if I could get inputs from experts on this.

 Thanks.


 On Tuesday, 12 August 2014 15:35:17 UTC-7, Jesse Glick wrote:

 On Tue, Aug 12, 2014 at 6:16 PM, Slide slide...@gmail.com wrote: 
  I've never had to do anything like that for netbeans. 

 Nor I. 

  Do you have the Jenkins plugin installed? Not sure if that makes a 
 difference, but it might. 

 No, this is not necessary. 

  The files get generated and compiled automatically for me. 

 Yes, it is fully automatic; as soon as you build the plugin (F11), 
 functions generated from Messages.properties should become available 
 for use from the editor. You need not add anything to your POM besides 
 inheriting from the standard plugin POM. 

  -- 
 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/d/optout.




 -- 
 Website: http://earl-of-code.com 



-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reading from Messages.properties file

2014-08-15 Thread Karthik V S
Hi,

As correctly pointed out, the file Messages.java gets generated 
automatically without adding anything to the POM File besides inheriting 
from the parent.

But however after the file gets generated in* 
targets/generated-sources/Messages.Java, *if I attempt to invoke the 
functions in my Action class located in src/main/java/MyPackage, the 
Netbeans IDE throws an error while compiling saying *Unable to resolve 
symbol Messages.*

I read that we have to manually add the class to the source root. What does 
that mean?

This is the final step in my plugin development and I m stuck with it. It 
would be great if I could get inputs from experts on this.

Thanks.

On Tuesday, 12 August 2014 15:35:17 UTC-7, Jesse Glick wrote:

 On Tue, Aug 12, 2014 at 6:16 PM, Slide slide...@gmail.com javascript: 
 wrote: 
  I've never had to do anything like that for netbeans. 

 Nor I. 

  Do you have the Jenkins plugin installed? Not sure if that makes a 
 difference, but it might. 

 No, this is not necessary. 

  The files get generated and compiled automatically for me. 

 Yes, it is fully automatic; as soon as you build the plugin (F11), 
 functions generated from Messages.properties should become available 
 for use from the editor. You need not add anything to your POM besides 
 inheriting from the standard plugin POM. 


-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reading from Messages.properties file

2014-08-15 Thread Karthik V S
Hi,

I have attached my POM.xml and I have not done any additions to it.

On Friday, 15 August 2014 13:35:15 UTC-7, slide wrote:

 I have NEVER had to add anything manually for the Messages stuff. It 
 sounds like something is incorrect in your setup. Can you post your pom.xml 
 so it can be looked over?


 On Fri, Aug 15, 2014 at 1:27 PM, Karthik V S karthik...@gmail.com 
 javascript: wrote:

 Hi,

 As correctly pointed out, the file Messages.java gets generated 
 automatically without adding anything to the POM File besides inheriting 
 from the parent.

 But however after the file gets generated in* 
 targets/generated-sources/Messages.Java, *if I attempt to invoke the 
 functions in my Action class located in src/main/java/MyPackage, the 
 Netbeans IDE throws an error while compiling saying *Unable to resolve 
 symbol Messages.*

 I read that we have to manually add the class to the source root. What 
 does that mean?

 This is the final step in my plugin development and I m stuck with it. It 
 would be great if I could get inputs from experts on this.

 Thanks.


 On Tuesday, 12 August 2014 15:35:17 UTC-7, Jesse Glick wrote:

 On Tue, Aug 12, 2014 at 6:16 PM, Slide slide...@gmail.com wrote: 
  I've never had to do anything like that for netbeans. 

 Nor I. 

  Do you have the Jenkins plugin installed? Not sure if that makes a 
 difference, but it might. 

 No, this is not necessary. 

  The files get generated and compiled automatically for me. 

 Yes, it is fully automatic; as soon as you build the plugin (F11), 
 functions generated from Messages.properties should become available 
 for use from the editor. You need not add anything to your POM besides 
 inheriting from the standard plugin POM. 

  -- 
 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 javascript:.
 For more options, visit https://groups.google.com/d/optout.




 -- 
 Website: http://earl-of-code.com 


-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


pom.xml
Description: XML document


Re: Reading from Messages.properties file

2014-08-12 Thread Karthik V S
Hi,

I have generated the Messages.java class according to the steps mentioned 
in the link inside my target/generated-sources folder.

When I call a function from the messages class

Messages.MyAction_getDisplayName(), compiler is throwing me an error that 
the Messages class is not found.How can I overcome the error?

Thanks,
Karthik

On Tuesday, 12 August 2014 01:02:52 UTC-7, Christopher wrote:

 On 08/12/2014 03:09 AM, Karthik V S wrote: 
  I have a class in my plugin that extends from Action. Is it possible to 
  include a Message.properties file for such a class and make the plugin 
  read strings from the Messages.properties file? 
  
  If yes, How can it be done? 

 See the wiki page: 
 https://wiki.jenkins-ci.org/display/JENKINS/Internationalization 

 You can also check the source code of Jenkins core or any popular plugin 
 to see this in action. 

 Regards, 
 Chris 


-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting project's LogRotation Strategy

2014-08-12 Thread Karthik V S
Thank you Jesse. 

On Monday, 11 August 2014 18:37:50 UTC-7, Jesse Glick wrote:

 On Mon, Aug 11, 2014 at 7:57 PM, Karthik V S karthik...@gmail.com 
 javascript: wrote: 
  I checked the project.getLogRotator() method. But the method is 
 currently 
  deprecated. So is the setter method. Is there any other way to get it? 
 That 
  is currently not deprecated. 

 Did you not look at the Javadoc? 

 http://javadoc.jenkins-ci.org/hudson/model/Job.html#getLogRotator() 

  Use getBuildDiscarder(). 


-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reading from Messages.properties file

2014-08-12 Thread Karthik V S
Corrections below in red

On Tuesday, 12 August 2014 10:50:02 UTC-7, Karthik V S wrote:

 Hi,

 I have generated the Messages.java class according to the steps mentioned 
 in the link given by you, and also checked the Jenkins Source Code and 
 other plugins. The generated class is inside my target/generated-sources 
 folder.

 When I call a function of the messages class from inside any class inside 
 my src/main/java

 for example : Messages.MyAction_getDisplayName(), compiler is throwing me 
 an error that the Messages class is not found.How can I overcome the error?

 Thanks,
 Karthik

 On Tuesday, 12 August 2014 01:02:52 UTC-7, Christopher wrote:

 On 08/12/2014 03:09 AM, Karthik V S wrote: 
  I have a class in my plugin that extends from Action. Is it possible to 
  include a Message.properties file for such a class and make the plugin 
  read strings from the Messages.properties file? 
  
  If yes, How can it be done? 

 See the wiki page: 
 https://wiki.jenkins-ci.org/display/JENKINS/Internationalization 

 You can also check the source code of Jenkins core or any popular plugin 
 to see this in action. 

 Regards, 
 Chris 



-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Getting project's LogRotation Strategy

2014-08-12 Thread Karthik V S
After posting the question I looked at the JavDoc. And then deleted my post.

On Tuesday, 12 August 2014 10:52:51 UTC-7, Karthik V S wrote:

 Thank you Jesse. 

 On Monday, 11 August 2014 18:37:50 UTC-7, Jesse Glick wrote:

 On Mon, Aug 11, 2014 at 7:57 PM, Karthik V S karthik...@gmail.com 
 wrote: 
  I checked the project.getLogRotator() method. But the method is 
 currently 
  deprecated. So is the setter method. Is there any other way to get it? 
 That 
  is currently not deprecated. 

 Did you not look at the Javadoc? 

 http://javadoc.jenkins-ci.org/hudson/model/Job.html#getLogRotator() 

  Use getBuildDiscarder(). 



-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Reading from Messages.properties file

2014-08-12 Thread Karthik V S
After manually copying it, the error message got resolved, but the Messages 
are not read at runtime!!

On Tuesday, 12 August 2014 13:13:26 UTC-7, Karthik V S wrote:

 Does that mean manually copying the Messages.java file that is generated 
 to src/main/java/myPackage

 After doing this it works.

 On Tuesday, 12 August 2014 11:19:38 UTC-7, Daniel Beck wrote:


 On 12.08.2014, at 19:50, Karthik V S karthik...@gmail.com wrote: 

  found.How can I overcome the error? 

 If your IDE fails to find these classes, manually add 
 target/generated-sources/localizer directory to your source root.



-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Reading from Messages.properties file

2014-08-11 Thread Karthik V S
Hi,

I have a class in my plugin that extends from Action. Is it possible to 
include a Message.properties file for such a class and make the plugin read 
strings from the Messages.properties file?

If yes, How can it be done?

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Creating a new job type in Plugin

2014-08-07 Thread Karthik V S
Hi,

I need to develop a plugin that helps me to create a new job type. Any 
pointers on how I can do it?

I know implementing TopLevelItem should solve my purpose, but by 
implementing that there are a lot of methods for which I need to provide 
definitions, I dunno how to.

Any code example or a plugin that already does that?

Thanks!

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Redirecting new job to workspace link instead of Configure

2014-08-07 Thread Karthik V S
Hi,

In my plugin, I am creating a new Job type.

Here goes my requirement,

After selecting my custom job type, I need the redirection on Clicking the 
OK button, to redirect to Workspace Link.

Is that possible?

Thanks.

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Creating a new job type in Plugin

2014-08-07 Thread Karthik V S
Hi Jesse,
I have got to know how to create a new Job Type.

My Plugin is supposed to do this:

1) Create a new Job type
2) After user selects that Job Type and enters job name redirect user to a 
new page -- that is added to project actions by the plugin.
3) Update Job configuration based on certain form values provided.

I m done with steps 1 and 3. 

I am stuck at Step 2.

Need input on that. To state it precisely,

As shown in the image below, I have added a link to the sidebar called 
Basic Configuration. As soon as the user clicks on the OK Button after 
specifying Job name and Job Type, the user should be navigated to this 
screen instead of Configure Screen. How is that possible?

https://lh5.googleusercontent.com/-Yarrt0aTvAo/U-Psw4Pac5I/GEg/0SE9HAWq_qs/s1600/Screen%2BShot%2B2014-08-07%2Bat%2B2.15.22%2BPM.png





















Thanks,
Karthik
---
On Thursday, 7 August 2014 11:49:18 UTC-7, Jesse Glick wrote:

 On Thu, Aug 7, 2014 at 10:42 AM, Karthik V S karthik...@gmail.com 
 javascript: wrote: 
  I know implementing TopLevelItem should solve my purpose, but by 
  implementing that there are a lot of methods for which I need to provide 
  definitions 

 Well FreeStyleProject for example implements TopLevelItem, which is 
 easy since this interface only adds one method. I guess what you are 
 asking is how you implement Item. But that is normally done via 
 AbstractItem. Anyway you asked about a “job type”, which means Job, 
 which is already an AbstractItem. So which methods are you missing 
 exactly? What is your proposed superclass? What is your plugin 
 supposed to do? 


-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Using JobConfigHistory Plugin

2014-08-05 Thread Karthik V S
Hi,

The Jenkins Plugin that I create updates a job by Job Configuration. When I 
use the JobConfigHistory Plugin to view the config changes, it throws an 
error as described below. Any pointers on where I am going wrong here?

404 Not Found

Stapler processed this HTTP request as follows, but couldn't find the 
resource to consume the request

- evaluate(hudson.model.Hudson@1ca83821 
:hudson.model.Hudson,/job/kshantaraman/jobConfigHistory)
- 
evaluate(((StaplerProxy)hudson.model.Hudson@1ca83821).getTarget(),/job/kshantaraman/jobConfigHistory)
- 
evaluate(hudson.model.Hudson@1ca83821.getJob(kshantaraman),/jobConfigHistory)
- evaluate(hudson.model.FreeStyleProject@22f7b6dc[kshantaraman] 
:hudson.model.FreeStyleProject,/jobConfigHistory)
- 
evaluate(hudson.model.FreeStyleProject@22f7b6dc[kshantaraman].getDynamic(jobConfigHistory,...),)

hudson.model.FreeStyleProject@22f7b6dc[kshantaraman].getDynamic(jobConfigHistory,...)==null.
 Back tracking.- No matching rule was found on 
hudson.model.FreeStyleProject@22f7b6dc[kshantaraman] for /jobConfigHistory

hudson.model.FreeStyleProject@22f7b6dc[kshantaraman] has the following 
URL mappings, in the order of preference:

   1. hudson.model.AbstractProject.doDoDelete(...) for url=/doDelete/...
   2. hudson.model.AbstractProject.doWs(...) for url=/ws/...
   3. hudson.model.AbstractProject.doCheckRetryCount(...) for 
   url=/checkRetryCount/...
   4. hudson.model.AbstractProject.doBuild(...) for url=/build/...
   5. hudson.model.AbstractProject.doBuild(...) for url=/build/...
   6. hudson.model.AbstractProject.doBuildWithParameters(...) for 
   url=/buildWithParameters/...
   7. hudson.model.AbstractProject.doBuildWithParameters(...) for 
   url=/buildWithParameters/...
   8. hudson.model.AbstractProject.doPolling(...) for url=/polling/...
   9. hudson.model.AbstractProject.doCancelQueue(...) for 
   url=/cancelQueue/...
   10. hudson.model.AbstractProject.doDoWipeOutWorkspace(...) for 
   url=/doWipeOutWorkspace/...
   11. hudson.model.AbstractProject.doDisable(...) for url=/disable/...
   12. hudson.model.AbstractProject.doEnable(...) for url=/enable/...
   13. hudson.model.AbstractProject.doRssChangelog(...) for 
   url=/rssChangelog/...
   14. hudson.model.AbstractProject.doConfigSubmit(...) for 
   url=/configSubmit/...
   15. hudson.model.Job.doRssAll(...) for url=/rssAll/...
   16. hudson.model.Job.doRssFailed(...) for url=/rssFailed/...
   17. hudson.model.Job.doBuildStatus(...) for url=/buildStatus/...
   18. hudson.model.Job.doDescription(...) for url=/description/...
   19. hudson.model.Job.doDoRename(...) for url=/doRename/...
   20. hudson.model.AbstractItem.doConfigDotXml(...) for url=/config.xml/...
   21. hudson.model.AbstractItem.doSubmitDescription(...) for 
   url=/submitDescription/...
   22. hudson.model.Actionable.doContextMenu(...) for url=/contextMenu/...
   23. TOKEN.groovy for url=/TOKEN
   24. VIEW.jelly for url=/VIEW
   25. hudson.model.FreeStyleProject.DESCRIPTOR for url=/DESCRIPTOR/...
   26. hudson.model.Item.PERMISSIONS for url=/PERMISSIONS/...
   27. hudson.model.Item.CREATE for url=/CREATE/...
   28. hudson.model.Item.DELETE for url=/DELETE/...
   29. hudson.model.Item.CONFIGURE for url=/CONFIGURE/...
   30. hudson.model.Item.READ for url=/READ/...
   31. hudson.model.Item.DISCOVER for url=/DISCOVER/...
   32. hudson.model.Item.EXTENDED_READ for url=/EXTENDED_READ/...
   33. hudson.model.Item.BUILD for url=/BUILD/...
   34. hudson.model.Item.WORKSPACE for url=/WORKSPACE/...
   35. hudson.model.Item.WIPEOUT for url=/WIPEOUT/...
   36. hudson.model.Item.CANCEL for url=/CANCEL/...
   37. hudson.model.Saveable.NOOP for url=/NOOP/...
   38. hudson.model.Item.PERMISSIONS for url=/PERMISSIONS/...
   39. hudson.model.Item.CREATE for url=/CREATE/...
   40. hudson.model.Item.DELETE for url=/DELETE/...
   41. hudson.model.Item.CONFIGURE for url=/CONFIGURE/...
   42. hudson.model.Item.READ for url=/READ/...
   43. hudson.model.Item.DISCOVER for url=/DISCOVER/...
   44. hudson.model.Item.EXTENDED_READ for url=/EXTENDED_READ/...
   45. hudson.model.Item.BUILD for url=/BUILD/...
   46. hudson.model.Item.WORKSPACE for url=/WORKSPACE/...
   47. hudson.model.Item.WIPEOUT for url=/WIPEOUT/...
   48. hudson.model.Item.CANCEL for url=/CANCEL/...
   49. hudson.model.Saveable.NOOP for url=/NOOP/...
   50. hudson.model.Saveable.NOOP for url=/NOOP/...
   51. hudson.model.AbstractProject.ABORT for url=/ABORT/...
   52. hudson.model.AbstractProject.BUILD_NOW_TEXT for 
   url=/BUILD_NOW_TEXT/...
   53. hudson.model.Item.PERMISSIONS for url=/PERMISSIONS/...
   54. hudson.model.Item.CREATE for url=/CREATE/...
   55. hudson.model.Item.DELETE for url=/DELETE/...
   56. hudson.model.Item.CONFIGURE for url=/CONFIGURE/...
   57. hudson.model.Item.READ for url=/READ/...
   58. hudson.model.Item.DISCOVER for url=/DISCOVER/...
   59. hudson.model.Item.EXTENDED_READ for url=/EXTENDED_READ/...
   60. hudson.model.Item.BUILD for url=/BUILD/...
   61. 

Plugin that generates Jobs based on a template

2014-07-31 Thread Karthik V S
Hi,

I would like to check whether there exists any plugin that matches the 
following use case

1) Create a parent Job that acts as the template with a specified set of 
User fields

2) On running the plugin, the plugin should spawn new job(child job) of the 
same template.

3) If the new job already exists, then when changing the values of the user 
fields in the parent template, should update the child jobs that were 
spawned by the parent job.


Could you please let me know if there is a plugin that already does this?

Thanks,
Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Adding Publisher to job thru Java Code

2014-07-25 Thread Karthik V S
Hi,

I have a list of publishers that I have to add to my Jenkins job thru Java 
Code and then create the job.

How is that possible? Any inputs would be greatly appreciated.

Thanks,
Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding Publisher to job thru Java Code

2014-07-25 Thread Karthik V S
Hi Oliver,

I was able to add the publishers successfully.

Similarily I want to add few other things to the project configuration like

1. BuildWrappers
2. Builders
3. Project Properties

I do not have the Job object captured. I have only an instance of 
AbstractProject. Hence I am unable to proceed furthur.

Can you please help me with this?

On Friday, 25 July 2014 14:55:04 UTC-7, ogondza wrote:

 On Fri, 25 Jul 2014 23:15:53 +0200, Karthik V S karthik...@gmail.com 
 javascript:   
 wrote: 
  I have a list of publishers that I have to add to my Jenkins job thru   
  Java 
  Code and then create the job. 
  
  How is that possible? Any inputs would be greatly appreciated. 

 Hi, 

 Create the job first, then add publishers. This is done routinely in   
 tests. See   

 https://github.com/jenkinsci/jenkins/blob/bfaab5118d079405b82b80301d90e19f39970366/test/src/test/java/hudson/tasks/test/AggregatedTestResultPublisherTest.java#L176-L177
  

 -- 
 oliver 


-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Loading Values to fields in an Action from config file

2014-07-24 Thread Karthik V S
Hi,

I have a Jelly form in my class, that is used to create an job using job's 
XML. The screenshot is attached.

Now my requirement is to populate values to the fields in the form from the 
corresponding entries in the config file of the job on Page Load.

Need to know how this can be done.




-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Are Environment Variables case sensitive?

2014-07-23 Thread Karthik V S
Hi,

If I have created the environment variable using the *This Build is 
parametrized option* and have added a variable Hostname

For checking the presence of the environment variable, if I use

if(envVars.containsKey(*hostname*)) 

instead of 

envVars.containsKey(*HostName*) will the behavior change?

Thanks,
Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Loading values into form fields from config.xml

2014-07-16 Thread Karthik V S
Hi,

I have a form that has been created by extending from Action class. This 
form has certain parameters useful in job configuration. I would like to 
know how to load values from the config file to the fields in that form?

Thanks.
Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Help file for form fields

2014-07-16 Thread Karthik V S
Hi Ullrich,

Thank you. Got it to work.

On Wednesday, 16 July 2014 00:46:32 UTC-7, Ullrich Hafner wrote:


 Am 16.07.2014 um 00:19 schrieb Karthik V S karthik...@gmail.com 
 javascript::

 Hi,

 I want to create help files for the fields in my plugin which extends from 
 Action.

 The folder structure for my jelly files are as such

 projectname/
 src/
   main/
  resources/  
com/
  mycompany/
plugin-name/
 MyAction/
config.jelly


 Where do I create the help file for the fields in this? under which path? 
 I tried creating under the same folder and specified path as 
  plugin-name/MyAction/help-file.html in jelly file but on rendering it I 
 got an error stating Help File not found.


 In the same directory where your config.jelly is located. The name is 
 help-[yourFieldName].html. Please make sure that the field is actually 
 marked in your jelly entry tag with field=„yourFieldName“.


 I am using netbeans IDE and there is no webapp folder present under 
 src/main/

 Any pointers to this?

 Many Thanks.


 -- 
 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 javascript:.
 For more options, visit https://groups.google.com/d/optout.




-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Preloading values to form from config.xml

2014-07-14 Thread Karthik V S
Hi,

I have a jelly form in my class. The handler for this form is a class 
extending from action. So essentially, the form appears after clicking on a 
link from the side bar. I need the form to retain values entered to its 
fields even after the user navigates from the page. How can I achieve that? 

Thanks,
Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Loading values to fields from Config file

2014-07-08 Thread Karthik V S
Hi,

I have a custom form in my Application and I would like to load values to 
its fields.

For this purpose I have a class that extends from ItemListener and have 
overriden the onUpdated method to read the updated config file and set 
values to the text box fields by creating an Action object,adding that 
action object to the project  and saving the project. For some reason this 
does not work. The code snippet is below!

*Action Class:*

public class MyActionT extends AbstractItem implements Action {

final private T item;
private String gitRepo;
private String gitBranch;
private String mavenGoals;
private String mavenPOM;
private String eMailRecipient;

public MyAction(T item, String gitRepo, String gitBranch, String 
mavenGoals, String mavenPOM, String eMailRecipient) {
this.item = item;
this.gitRepo = gitRepo;
this.gitBranch = gitBranch;
this.mavenGoals = mavenGoals;
this.mavenPOM = mavenPOM;
this.eMailRecipient = eMailRecipient;
}

public String getGitRepo() {
return gitRepo;
}

public String getGitBranch() {
return gitBranch;
}

public String getMavenGoals() {
return mavenGoals;
}

public String getMavenPOM() {
return mavenPOM;
}

public String geteMailRecipient() {
return eMailRecipient;
}

   public MyAction(T item) {
this.item = item;
}

public T getItem() {
return item;
}


*ItemListener Class*

@Extension
public class MyActionListener extends ItemListener{

@Override
public void onUpdated(Item item){
if(item instanceof AbstractItem)
{
for(Action action : Jenkins.getInstance().getActions())
if(action.getClass()==MyAction.class)
{
AbstractProject proj=(AbstractProject) item;
XmlFile projConfig=proj.getConfigFile();
String config=projConfig.toString();
String 
gitRepo=config.substring(config.indexOf(url)+5, 
config.indexOf(/url));
String 
branch=config.substring(config.indexOf(name)+6,config.indexOf(/name));
String 
mavengoals=config.substring(config.indexOf(target)+8,config.indexOf(target));
String 
mavenPom=config.substring(config.indexOf(pom)+5,config.indexOf(/pom));
String 
eMailReceipient=config.substring(config.indexOf(recipientList)+15,config.indexOf(recipientList));
Action newAction=new MyAction((AbstractItem) 
item,gitRepo,branch,mavengoals,mavenPom,eMailReceipient);
proj.addAction(newAction);
try {
proj.save();
} catch (IOException ex) {

Logger.getLogger(MyActionListener.class.getName()).log(Level.SEVERE, null, 
ex);
}
}
}
}
}

*Jelly File:*

f:form method=post name=config action=configSubmit
  f:block
f:section title=${%Job Configuration}
f:entry title=${%Job name}
f:textbox id=name name=name default=${it.ItemName}/
/f:entry
   /f:section
   f:section title=${%Source Code Management}
   f:entry title=${%Git Repo}
   f:textbox id=repo name=repo 
default=g...@github.scm.corp.mycompany.com:{Enter your git repo here} 
value=${it.GitRepo}/
   /f:entry
   f:entry title=${%Branch}
   f:textbox id=branch name=branch default=master 
value=${it.GitBranch}/
   /f:entry
   /f:section
   f:section title=${%Maven Targets}
   f:entry title=${%Goals}
   f:textbox id=goals name=goals default=-U clean 
install value=${it.MavenGoals}/
   /f:entry
   f:entry title=${%POM}
   f:textbox id=pom name=pom default=pom.xml 
value=${it.MavenPOM}/
   /f:entry
   /f:section
   f:section title=${%E-Mail Notification}
   f:entry title=${%Recipient}
   f:textbox id=emailrecipient name=emailrecipient 
default=QE DL For Notifying value=${it.eMailRecipient}/
   /f:entry
   /f:section
   f:section title=${%Assembler Postbuild}
f:entry title=${%Assembler Target POM.xml{relative path}}
f:textbox id=assemblerpom name=assemblerpom/
/f:entry
   /f:section
   /f:block
f:bottomButtonBar
f:submit value=${%Save} /
/f:bottomButtonBar
/f:form


What am i doing wrong here??

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Loading values to fields from Config file

2014-07-08 Thread Karthik V S
I have added @DataBoundConstructor annotation to the constructor too!

On Tuesday, 8 July 2014 10:04:07 UTC-7, Karthik V S wrote:

 Hi,

 I have a custom form in my Application and I would like to load values to 
 its fields.

 For this purpose I have a class that extends from ItemListener and have 
 overriden the onUpdated method to read the updated config file and set 
 values to the text box fields by creating an Action object,adding that 
 action object to the project  and saving the project. For some reason this 
 does not work. The code snippet is below!

 *Action Class:*

 public class MyActionT extends AbstractItem implements Action {

 final private T item;
 private String gitRepo;
 private String gitBranch;
 private String mavenGoals;
 private String mavenPOM;
 private String eMailRecipient;

 public MyAction(T item, String gitRepo, String gitBranch, String 
 mavenGoals, String mavenPOM, String eMailRecipient) {
 this.item = item;
 this.gitRepo = gitRepo;
 this.gitBranch = gitBranch;
 this.mavenGoals = mavenGoals;
 this.mavenPOM = mavenPOM;
 this.eMailRecipient = eMailRecipient;
 }

 public String getGitRepo() {
 return gitRepo;
 }

 public String getGitBranch() {
 return gitBranch;
 }

 public String getMavenGoals() {
 return mavenGoals;
 }

 public String getMavenPOM() {
 return mavenPOM;
 }

 public String geteMailRecipient() {
 return eMailRecipient;
 }
 
public MyAction(T item) {
 this.item = item;
 }

 public T getItem() {
 return item;
 }


 *ItemListener Class*

 @Extension
 public class MyActionListener extends ItemListener{
 
 @Override
 public void onUpdated(Item item){
 if(item instanceof AbstractItem)
 {
 for(Action action : Jenkins.getInstance().getActions())
 if(action.getClass()==MyAction.class)
 {
 AbstractProject proj=(AbstractProject) item;
 XmlFile projConfig=proj.getConfigFile();
 String config=projConfig.toString();
 String 
 gitRepo=config.substring(config.indexOf(url)+5, 
 config.indexOf(/url));
 String 
 branch=config.substring(config.indexOf(name)+6,config.indexOf(/name));
 String 
 mavengoals=config.substring(config.indexOf(target)+8,config.indexOf(target));
 String 
 mavenPom=config.substring(config.indexOf(pom)+5,config.indexOf(/pom));
 String 
 eMailReceipient=config.substring(config.indexOf(recipientList)+15,config.indexOf(recipientList));
 Action newAction=new MyAction((AbstractItem) 
 item,gitRepo,branch,mavengoals,mavenPom,eMailReceipient);
 proj.addAction(newAction);
 try {
 proj.save();
 } catch (IOException ex) {
 
 Logger.getLogger(MyActionListener.class.getName()).log(Level.SEVERE, null, 
 ex);
 }
 }
 }
 }
 }

 *Jelly File:*

 f:form method=post name=config action=configSubmit
   f:block
 f:section title=${%Job Configuration}
 f:entry title=${%Job name}
 f:textbox id=name name=name default=${it.ItemName}/
 /f:entry
/f:section
f:section title=${%Source Code Management}
f:entry title=${%Git Repo}
f:textbox id=repo name=repo 
 default=g...@github.scm.corp.mycompany.com:{Enter your git repo here} 
 value=${it.GitRepo}/
/f:entry
f:entry title=${%Branch}
f:textbox id=branch name=branch default=master 
 value=${it.GitBranch}/
/f:entry
/f:section
f:section title=${%Maven Targets}
f:entry title=${%Goals}
f:textbox id=goals name=goals default=-U clean 
 install value=${it.MavenGoals}/
/f:entry
f:entry title=${%POM}
f:textbox id=pom name=pom default=pom.xml 
 value=${it.MavenPOM}/
/f:entry
/f:section
f:section title=${%E-Mail Notification}
f:entry title=${%Recipient}
f:textbox id=emailrecipient name=emailrecipient 
 default=QE DL For Notifying value=${it.eMailRecipient}/
/f:entry
/f:section
f:section title=${%Assembler Postbuild}
 f:entry title=${%Assembler Target POM.xml{relative path}}
 f:textbox id=assemblerpom name=assemblerpom/
 /f:entry
/f:section
/f:block
 f:bottomButtonBar
 f:submit value=${%Save} /
 /f:bottomButtonBar
 /f:form


 What am i doing wrong here??


-- 
You received this message because you are subscribed to the Google Groups 
Jenkins Developers group.
To unsubscribe from this group and stop

Managing Plugin Dependencies in Jenkins Plugin

2014-07-03 Thread Karthik V S
Hi,

I am developing a plugin that has dependencies on various other plugins 
like GIT,FindBUGS,PMD etc.

I have added the following code into my pom.xml to resolve the dependencies

dependencies
dependency
groupIdorg.jenkins-ci.main/groupId
artifactIdmaven-plugin/artifactId
version2.3/version
typejar/type
/dependency
dependency
groupIdorg.jenkins-ci.plugins/groupId
artifactIdgithub-api/artifactId
version1.42/version
/depend
dependency
groupIdorg.jenkins-ci.plugins/groupId
artifactIdgit/artifactId
version2.0/version
/dependency
dependency
groupIdorg.jenkins-ci.plugins/groupId
artifactIdjavadoc/artifactId
version1.0/version
/dependency
dependency
groupIdorg.jvnet.hudson.plugins/groupId
artifactIdfindbugs/artifactId
version4.51/version
optionaltrue/optional
/dependency
dependency
groupIdorg.jvnet.hudson.plugins/groupId
artifactIdpmd/artifactId
version3.37/version
optionaltrue/optional
/dependency

My Query now is that when I install this plugin on my local Jenkins 
Instance, would these dependency plugin get installed by default on that 
instance?

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Looking for Jenkins contract instructor

2014-06-27 Thread Karthik V S
I am looking for instructors in Silicon Valley :). I am a developer new to 
Jenkins development. Any course or something that is already available?

On Thursday, 26 June 2014 16:27:25 UTC-7, Christopher wrote:

 On 06/26/2014 06:58 PM, jtodd wrote: 
  I am looking for an instructor who can teach Jenkins to a group of 
  developers just starting with Jenkins.  Any help would be appreciated. 

 Remotely?  On-site?  In Liechtenstein?  In Silicon Valley?  To hire for 
 a permanent position?  For a one-off event?  etc etc. :) 

 Regards, 
 Chris 



-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Calling servlets from jelly pages

2014-06-24 Thread Karthik V S
Hi,

I have a servlet that creates a new job by calling the Jenkins REST API.

How do i achieve this? Any feedback would be greatly appreciated. Thanks.

-Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Updating a config.xml file for a job through Java code

2014-06-23 Thread Karthik V S
Hi Ulli,

A custom job configuration page is very much a page inside the Jenkins Web
App. It consists of a subset of options for configuring a job that are
usually present when user clicks on Configure page in the side.

For updating the job configuration using the API should i do it in my
PluginImpl class that extends plugin or in a DescriptorImpl class that
extends from AbstractProjectDescriptor?


On Sat, Jun 21, 2014 at 1:27 AM, Ulli Hafner ullrich.haf...@gmail.com
wrote:

 Can you please explain in more detail? What is a custom job configuration
 page? A web page outside of the Jenkins web app?

 You can update the job configuration using the remote api.

 Am 21.06.2014 um 02:29 schrieb Karthik V S karthik.tec...@gmail.com:

 Hi,

 I have an custom job configuration page that is a subset of the options
 present in the main configuration page.

 My requirement is to persist the changes done in this page to the
 config.xml file of the project?

 Could anyone provide me valuable pointers on this?

 --
 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-dev+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.




-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Updating a config.xml file for a job through Java code

2014-06-23 Thread Karthik V S
Hi All,

I have got to know that calling the http://jenkins 
url/createitem/name=jobname will create a new job.

Is there any such api call to modify the existing job??

On Monday, 23 June 2014 10:05:45 UTC-7, Karthik V S wrote:

 Hi Ulli,

 A custom job configuration page is very much a page inside the Jenkins Web 
 App. It consists of a subset of options for configuring a job that are 
 usually present when user clicks on Configure page in the side. 

 For updating the job configuration using the API should i do it in my 
 PluginImpl class that extends plugin or in a DescriptorImpl class that 
 extends from AbstractProjectDescriptor?


 On Sat, Jun 21, 2014 at 1:27 AM, Ulli Hafner ullrich.haf...@gmail.com 
 wrote:

 Can you please explain in more detail? What is a custom job configuration 
 page? A web page outside of the Jenkins web app?

 You can update the job configuration using the remote api.

 Am 21.06.2014 um 02:29 schrieb Karthik V S karthik.tec...@gmail.com:

 Hi,

 I have an custom job configuration page that is a subset of the options 
 present in the main configuration page.

 My requirement is to persist the changes done in this page to the 
 config.xml file of the project?

 Could anyone provide me valuable pointers on this?

 -- 
 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-dev+unsubscr...@googlegroups.com.

 For more options, visit https://groups.google.com/d/optout.





-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Updating a config.xml file for a job through Java code

2014-06-20 Thread Karthik V S
Hi,

I have an custom job configuration page that is a subset of the options 
present in the main configuration page.

My requirement is to persist the changes done in this page to the 
config.xml file of the project?

Could anyone provide me valuable pointers on this?

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Retrieve current job name in Jenkins

2014-06-19 Thread Karthik V S
Hi,

I have a requirement to retrieve the current job name after configuring the 
job. Sending an api REQUEST gives me an XML using which i can retrieve all 
the current jobs that are being built?

Code Snippet:

import org.dom4j.io.*;

import org.dom4j.*;

import java.net.*;

import java.util.*;

public class Main {

public static void main(String[] args) throws Exception {

URL url = new 
URL(http://your-hudson-server.local/hudson/api/xml;);

Document dom = new SAXReader().read(url);

for( Element job : (ListElement)dom.getRootElement().elements(job)) {

System.out.println(String.format(Job %s has status %s,

job.elementText(name), job.elementText(color)));

}

}

}

How can i achieve my aim to get the current project name from the project 
configuration window via xml/json??

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Unable to compile the maven-project-plugin

2014-06-18 Thread Karthik V S
Hi,


I have Maven 3.0.5 installed on my MAC OS X with Oracle JDK 1.7. I
downloaded the source code of https://github.com/jenkinsci/maven-plugin and
attempted to compile the same on my machine through the command line using
mvm install.


When doing that I am getting the following errors :


[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1119,21]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1126,21]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1130,52]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1130,22]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1119,21]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1126,21]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1130,52]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1130,22]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1131,18]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1131,48]
error: package Queue does not exist

[ERROR]
/Users/kshantaraman/Documents/karthik/maven-plugin-master/src/main/java/hudson/maven/MavenModuleSet.java:[1132,18]
error: package Queue does not exist


Can anyone help me how to fix this? I have not done any changes to the code
till now.


Thanks and Regards,

Karthik

-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Problems building maven-plugin in Eclipse

2014-06-17 Thread Karthik V S
Hi,

I am getting the same error. Can anyone provide the solution for this? I am 
using Eclipse Kepler.

On Friday, 15 November 2013 10:29:28 UTC-8, kutzi wrote:

 Hi, 

 I had several problems with building Jenkins/maven-plugin in the past, 
 but the errors I'm getting now are especial nasty: 
 Eclipse e.g. complains that it cannot find hudson.model.Queue.Item (in 
 MavenModuleSet) and several other compile errors. 
 I checked the the Jenkins core jar is intact (building with mvn works) 
 and no amount of refreshing in Eclipse and the usual other tricks to get 
 it working again got me anywhere. 

 Did anyone have similar problems and maybe a solution? 
 Eclipse Kepler 4.3.1, M2e 1.4.0 

 - 
 Kutzi 



-- 
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-dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.