hyde
hyde

Reputation: 62906

How to add a file to download into Jenkins/Hudson plugin

I need to add a file for downloading to a plugin, which provides a build step. I want to put link to it into a HTML help file for a build step field, and also be able to paste the link to e-mails etc.

Let's assume this is just a simple, plain plugin project, with pom.xml having this:

<groupId>my.jenkins.plugins</groupId>
<artifactId>my-special-plugin</artifactId>
<name>My Special Plugin</name>

Name of the downloadable is myspecialtool.exe

Question:

  1. Where to put the file under the plugin project source

  2. What is the download URL, assuming Jenkins is at http://ciserver:8080

  3. What to write to a help HTML file to link to it "properly" (if different from above)

Hoping to get a good reference answer: clear, short and to-the-point.

Upvotes: 2

Views: 1420

Answers (1)

Simon Groenewolt
Simon Groenewolt

Reputation: 10665

Store data that you want to be able to address as 'web data' in src/main/webapp in your plugin project.

That directory should be addressable as /plugin/<name of your plugin> (from 'Jenkins Continuous Integration Cookbook')


Answers to the enumerated questions:

  1. Put file under src/main/webapp, perhaps in a sub-folder, so:
    src/main/webapp/download/myspecialtool.exe

  2. URL to that is is then:
    http://ciserver:8080/plugin/my-special-plugin/download/myspecialtool.exe

  3. Link to put to help HTML files:
    /plugin/my-special-plugin/download/myspecialtool.exe

Upvotes: 2

Related Questions