Aktualisierungen Mai, 2009 Kommentarverlauf ein-/ausschalten | Tastaturkürzel

  • Andreas Höhmann 12:29 am Tuesday, 5. May 2009 Permalink |  

    Speedup Release for Multiprojects with Maven 

    In huge multi-module-projects the maven-release-process might have a long running time because there is a lot of site-content to generate and to deployed (Of course this depends on the used report-plugins, i.e. javadoc, findbugs,pmd, dashboard etc.)

    I noticed that the upload of the generated javadoc etc. uses a big amount of the deployment time. So how we can speedup this part of the deployment?

    We can deploy the generated site in a local directory and after the successful release we can upload the whole directory to the server, i.e. zip the content and unpack on the server, or use a smb-shared-directory … then the site-upload is much faster than with site:deploy and webdav.

    <?xml version="1.0" encoding="UTF-8"?>
    <project xmlns="http://maven.apache.org/POM/4.0.0"
     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">

    Try it :)

  • Andreas Höhmann 18:33 am Wednesday, 20. August 2008 Permalink
    Tags: Build, Continuous Integration, , , Site, , xdoc   

    Show TeamCity Buildstatus in Maven Projectsite 

    Today i will show you a little hack for TeamCity and Maven. At the end you will be able to show the last (live!) buildstatus of your artifact on the generate project-site.

    Lets define a new menu-item “status” in our project-site-descriptor (src/site/site.xml):

      <menu name="Overview" inherit="top">
      <item name="Introduction" href="index.html" />
      <item name="Status" href="status.html" />

    Hint: you can do this in your parent-project, so all subproject will inherit this menu.

    Now we must define the status.xml (src/site/xdoc/status.xml):

    <?xml version="1.0" encoding="UTF-8"?>
        <section name="Status">
          <div id="statuswidget"/>
        <script type="text/javascript">
          // url to the team-city-server
          // define HOST, PORT and BUILDID
          var url = 'http://HOST:PORT/externalStatus.html'
                   + '?buildTypeId=BUILDID'
                   + unescape( '%26' )   // "hide" amp
                   + 'withCss=true';
          var container = document.getElementById('statuswidget');
          var iframe = document.createElement('iframe');
          iframe.style.width  = '100%';
          iframe.style.height = '500px';
          iframe.style.border = 'none';
          iframe.doc = null;
            iframe.doc = iframe.contentDocument;
          else if(iframe.contentWindow)
            iframe.doc = iframe.contentWindow.document;
          else if(iframe.document)
            iframe.doc = iframe.document;

    Insert HOST and PORT. The BUILDID is the number of the build-configuration:

    Hint: The width of the iframe should be 100% but you can customize the height – so if you later click on the status-element you can show teamcity directly in you projectsite … cool :D

    Activate the status-widget for your build-configuration:

    Build the site:

    mvn clean site-deploy

    Now you have a new menu-item, click and you will see the TeamCity status for your artifact.

    The implementation details …

    The “normal” way to display the build-status (see TeamCity documentation) is shown here:

    <script type="text/javascript" src="<path_to_server>/externalStatus.html?js=1&amp;amp;buildTypeId=BUILDID">

    But it’s not possible to insert this code in maven’s xdoc-format (there is no javascript-tag allowed!).
    So i found a solution to insert the teamcity-url into a dynamic created iframe. The second trick is to encode the “&” in the url (unescape(‘%26’)).

    Try it!

Neuen Beitrag erstellen
nächster Beitrag/nächster Kommentar
vorheriger Beitrag/vorheriger Kommentar
zeige/verstecke Kommentare
Zum Anfang gehen
zum Login
Zeige/Verberge Hilfe
Shift + ESC

Erhalte jeden neuen Beitrag in deinen Posteingang.

Schließe dich 87 Followern an