Some Beginners Questions

19 views
Skip to first unread message

Jochen Wiedmann

unread,
Oct 20, 2016, 11:13:43 AM10/20/16
to Jenkins Developers

Hi,

I am trying to create a builder plugin, which will basically work like the following:

  1.) Collect a few properties from the environment, the workspace, and possibly some other sources (In the end, there should be a minimal UI, but that's for the future.)
  2.) Create a very simple Ant script, which defines some properties, and invokes a more complex Ant script, which is located elsewhere.
       (That scripts location is one of the above properties.) The more complex Ant scripts purpose is to create a deliverable.

Now, I have a couple of beginners questions:

  a) I will require some temporary directory, or the like, in which to operate. Asssuming, that my workspace is checked out from Git, or Subversion, I want that directory to be located outside of the checked out tree. Can I ask Jenkins for a suitable location?
      How?
  b) To build my plugin, I can of course specify ant.jar as a Maven dependency. However, it seems to me that this is inappropriate within Jenkins. I'd expect, that there is some possibility to express something like "I want the Jenkins Ant plugin as a dependency on my class path", so that Ant is present, and usable. True, or false?

Thanks in advance,

Jochen

Daniel Beck

unread,
Oct 20, 2016, 11:32:26 AM10/20/16
to jenkin...@googlegroups.com

> On 20.10.2016, at 17:13, Jochen Wiedmann <jochen....@gmail.com> wrote:
>
> a) I will require some temporary directory, or the like, in which to operate. Asssuming, that my workspace is checked out from Git, or Subversion, I want that directory to be located outside of the checked out tree. Can I ask Jenkins for a suitable location?
> How?

hudson.FilePath is Jenkins' remoting-capable abstraction of File, and it has methods to create temporary files and directories.

> b) To build my plugin, I can of course specify ant.jar as a Maven dependency. However, it seems to me that this is inappropriate within Jenkins. I'd expect, that there is some possibility to express something like "I want the Jenkins Ant plugin as a dependency on my class path", so that Ant is present, and usable. True, or false?

https://wiki.jenkins-ci.org/display/JENKINS/Dependencies+among+plugins

Not sure you actually should have a dependency on the Ant _plugin_ for what you're doing, but depends on what exactly that would be.

Jochen Wiedmann

unread,
Oct 21, 2016, 2:53:27 AM10/21/16
to Jenkins Developers, m...@beckweb.net

Thanks very much, Daniel!
Reply all
Reply to author
Forward
0 new messages