====== Installing gamebots as a part of Maven build ====== Following procedure is considered best practice to deploy Gamebots and other extensions to UDK along with your project. This article was written for PogamutUDK version 3.2.5. It should seamlessly apply to future versions and with further modifications it is applicable to Pogamut for other versions of unreal. This article was written by Martin Černý. The idea: * User specifies path to UDK in his/her settings.xml * You add a profile to you project's pom, that unpacks Gamebots, and/or other UDK packages to UDK home directory and then executs "udk make" * Whenever the user wants to install/build/rebuild Gamebots, he/she activates the profile as part of the build ===== Setting UDK home in settings.xml ===== As a convention the property for UDK installation dir is called udk.home. Since UDK installation dir is different on every system, it is a good idea to set it in your [[http://maven.apache.org/ref/3.0.4/maven-settings/settings.html|settings.xml]]. (in NetBeans you usually find your settings.xml under "Project files" folder of any Maven project). Although specifying a property in your settings.xml is not the most straightforward thing, it is not such a hassle - you only need to declare a custom profile. Example follows: inject-udk-home D:/Games/UDK-2011-05 inject-udk-home ===== Unpacking and compiling GameBots ===== The default GameBots package is distributed as a zip artifact in our repository. The easiest way to unpack it is to use maven-dependency-plugin. Next you run the compile command with maven-exec-plugin. Note that UDK spawns a separate process for the compilation and the executable we run terminates immediately - Your build will not fail if build of the gamebots fail - Your build will likely finish before the scripts are actually compiled, so it is not a good idea to run a bot in the same build Since UDK supports only Windows, build will fail on any other platform than Windows. Here is an example of how such a profile looks in your pom.xml installGameBots org.apache.maven.plugins maven-dependency-plugin unpack-gamebots generate-resources unpack cz.cuni.amis.pogamut gamebots-udk zip ${udk.home} true org.codehaus.mojo exec-maven-plugin 1.2.1 build-udk compile exec ${udk.home}/Binaries/UDKLift.exe make cz.cuni.amis.pogamut gamebots-udk 3.2.5-SNAPSHOT zip ===== Unpacking additional gamebots packages ===== You might want to add some extensions to the gamebots package or UDK in general, that are not part of the gamebots core (something project-specific). In such a case, you simply add a dependency on the desired UDK extension package to the same profile and add a new artifactItem in the configuration of maven-dependency plugin. For more information on design and creation of UDK extension packages see [[UDK extension packages]]