Menu

JavaWebStartWithGroovyExample

Mark

Hit the ground running with a deployed instance

Get the release

  • Download from here ci-monitor-jws.zip
  • Extract secure https url location (Apache httpd - /servers/www/secure/).
  • This should output files similar to that shown below.
\+ ci-monitor-jws
\+ -- /lib
\+ -- -- *.jar
\+ -- ci-monitor-jws.jar
\+ -- CiMonitorView.groovy
\+ -- instance.properties
\+ -- launch.html
\+ -- launch.jnlp
\+ -- ...

Update the Java Web Start file (launch.jnlp)

Modify launch.jnlp replacing the url location with the expected address (eg.. There should be NO "localhost" values mentioned below).

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jnlp codebase="https://localhost/ci-monitor-jws/" href="launch.jnlp" spec="1.0+">
    <information>
        <title>ci-monitor-jws</title>
        <vendor>anonymous</vendor>
        <homepage href="http://sourceforge.net/projects/ci-monitor-lib"/>
        <description>ci-monitor-jws</description>
        <description kind="short">ci-monitor-jws</description>
    <offline-allowed/>
</information>
<security>
<all-permissions/>
</security>
    <resources>
<j2se version="1.5+"/>
<jar eager="true" href="ci-monitor-jws.jar" main="true"/>
<jar href="lib/groovy-all.jar"/>
<jar href="lib/commons-httpclient-3.1.jar"/>
<jar href="lib/jakarta-commons-codec-1.3.jar"/>
<jar href="lib/ci-monitor-lib-0.0.2.jar"/>
<jar href="lib/jakarta-commons-logging-1.0.4.jar"/>
<jar href="lib/jakarta-commons-logging-api-1.0.4.jar"/>
<jar href="lib/log4j-1.2.8.jar"/>
<property name="groovyClassUrl" value="https://localhost/ci-monitor-jws/CiMonitorView.groovy" />
<property name="build.host.update.interval" value="20000" />
</resources>
    <application-desc main-class="ci.monitor.jws.Main">
    </application-desc>
</jnlp>

Update the Display Instance (CiMonitorView.groovy)

  • Update the CiMonitorView.groovy file to suite your Continuous Integration Instances.
import ci.monitor.display.BuildDisplay;
import ci.monitor.display.DisplayPanel;
import ci.monitor.display.StatusPanel;
import javax.swing.JFrame;
import java.awt.Font;
import java.awt.Dimension;
import ci.monitor.display.StatusPanelBasicSkinOptions;
import ci.monitor.display.StatusTitlePanel;
import ci.monitor.display.StatusPanelForCruiseControlServer;
import ci.monitor.display.StatusPanelForHudsonServer;
import javax.swing.*;
import javax.swing.border.*;
import ci.monitor.display.HeaderPanel

public class CiMonitorView extends BuildDisplay {

    public static void main(String[] args) throws Exception {
        new CiMonitorView().start();
    }

    protected void createAndShowGui(){

        frame = new JFrame("Build Display");

        int xCount = 2;
        int yCount = 3;

        displayPanels = new DisplayPanel[xCount][yCount];

        StatusPanelBasicSkinOptions titleDisplayOptions = new StatusPanelBasicSkinOptions();
        titleDisplayOptions.setFont(new Font("SansSerif", Font.BOLD, 20));
        titleDisplayOptions.setSize(new Dimension(100, 100));
        titleDisplayOptions.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));

        StatusPanelBasicSkinOptions buildDisplayOptions = new StatusPanelBasicSkinOptions();
        buildDisplayOptions.setFont(new Font("SansSerif", Font.BOLD, 256));
        buildDisplayOptions.setBorder(BorderFactory.createEtchedBorder(EtchedBorder.LOWERED));

        displayPanels[0][0] = new StatusTitlePanel("", titleDisplayOptions);
        displayPanels[0][1] = new StatusTitlePanel("CruiseControl", titleDisplayOptions);
        displayPanels[0][2] = new StatusTitlePanel("Hudson", titleDisplayOptions);

        displayPanels[1][0] = new StatusTitlePanel("Builds", titleDisplayOptions);

    displayPanels[1][1] = new StatusPanelForCruiseControlServer(
            "http://localhost:8000",
            null,
            buildDisplayOptions);

        displayPanels[1][2] = new StatusPanelForHudsonServer(
            "http://localhost:8080",
            null,
            null,
            buildDisplayOptions);

        setDefaultFrameLayoutForDisplayPanels(frame, displayPanels);

        setDefaultFrameDisplayBehaviour(frame);

        frame.setVisible(true);

    }
}

Run Monitor Screen via Java Web Start

Launch via a browser


Related

Wiki: ProjectHome

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.