Webstart/JNLP artifact

One of our builds produces a Swing GUI in the form of a ZIP.  I'm trying to make it accessible from the TeamCity build artifacts page as a webstart application.  I've got the JNLP and build process setup and I've tested the application deployed via Webstart.
However, I'm running in to a problem when trying to have TeamCity automatically put it on the artifacts page of each build - the JNLP file needs to provide a "codebase" attribute which defines where all the various JARs are stored on the server -  I dont know this path at build time since TeamCity generates it.

Has anyone got an example of a JNLP file as a TeamCity build artifact that can be clicked on to load the a Swing app directly from the artifacts tab of each build.  If not, any suggestions (other than copying the JNLP layout to a separate location (outside of TeamCity's control) with a custom generated JNLP file for each build)?

Nick

4 comments
Comment actions Permalink

If you know build number you can use the following URL for codebase:

http://your.server.hostname/repository/download/BUILD_TYPE_ID/BUILD_NUMBER


Where BUILD_TYPE_ID is build configuration id which can be seen in the URL when you are opening build configuration home page.

Build number can be obtained from system property build.number (for runners supporting properties) or from environment variable BUILD_NUMBER

0
Comment actions Permalink

Great, thanks!

Can I just publish the .jnlp file as an artifact, or do I have to publish all of the JARs in the application?

Thanks again

Nick

0
Comment actions Permalink

I beleive you will need to publish all jar files. Although I did not try to publish WebStart applications to TeamCity by myself.

0
Comment actions Permalink

Some insights on making a Java WebStart/JNLP application deployable directly from TeamCity's artifacts page:

I encountered one problem involving the artifacts bundling (I had configured 'gui/build.jnlp.staging=>GUI_WebStart' in the artifacts output configuration), so I had to append this to the URL:
codebase="http://1.2.3.4/repository/download/bt3/${build.number}/GUI_WebStart"

I also had to enable Guest Auth under the server settings, and alter the codebase URL slightly to be:
codebase="http://1.2.3.4/guestAuth/repository/download/bt3/${build.number}/GUI_WebStart"
since WebStart accesses the JARs without any credentials.

I used the Orangevolt JNLP Ant task to generate the JNLP from my Ant build file, with the following codebase line:

     <jnlp tofile="build.jnlp/GUI.jnlp"
          codebase="http://1.2.3.4/guestAuth/repository/download/bt3/${build.number}/GUI_WebStart">
          ...
     </jnlp>

Finally, I changed the hard coded build ID ('bt3') to reference the TeamCity property ${teamcity.buildType.id}

     <jnlp tofile="build.jnlp/GUI.jnlp"
          codebase="http://1.2.3.4/guestAuth/repository/download/${teamcity.buildType.id}/${build.number}/GUI_WebStart">


It would be nice if I could reference the TeamCity Server IP Address as a build time property, so that I didnt have to hard code that information in.


Nick

0

Please sign in to leave a comment.