UDK extension packages

This page describes what is considered best practice. It was written for Pogamut 3.2.5, but should apply seamlessly to future versions. While this approach could be extended to all pogamut variants, it is currently fully implemented only for UDK.

This article was written by Martin Černý

In most cases your Pogamut-UDK project depends on some extension to the UDK, at least on Gamebots for UDK. It is desirable for your Java project to reflect this dependency and allow to install such extensions upon building the project. To achieve this we introduce the concept of UDK extension packages.

UDK extension package is simply a zip-packaged Maven artifact, that contains files for the extension, such that they may be extracted directly into the UDK folder. Best practices for installing extensions upon build of your project may be found at Gamebots - Maven article.

The benefit of this packaging is that you may declare explicit dependency of your project on a concrete version of GameBots or other extension package and let Maven manage such a dependency for you.

Creating packages

Packages are created as pom-packaged artifacts that employ maven-assembly-plugin to build the zip file. They follow typical maven project directory structure:

      |-assembly   //contains the assembly descriptor
      |-udk  //contains the actual UDK files
  |-target   //compilation output

In order to take advantage of all Maven capabilities (filtering, adding version numbers,…), udk resources are copied to target directory before being added to assembly.

Here is an example of a pom.xml for UDK extension for project SpyVsSpy:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <name>SpyVsSpy UDK package</name>
        <resources> <!-- Declares the UDK resource directory to be copied to output -->
            <!-- The project is pom packaged in order to get rid of JAR output. But we need to 
            explicitly call resources plugin-->
            <!-- Create the zip package -->           

Note that if you inherit from amis-pom, you need to add empyt files called : skip.default-jar and skip.source-jars, otherwise amis-pom will force the creation of binary and source JARS eventhough this is a POM. Project.

A typical content of /src/main/assembly/assembly.xml follows:

<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
LDAP: couldn't connect to LDAP server
guidelines/udk_extension_packages.txt · Last modified: 2012/02/08 12:04 by martin.cerny