This document addresses users that either want to build the LLRPCommander from the source code or intend to extend the LLRPCommander. The document describes the basic steps to take to assemble the plugin automatically, to generate eclipse projects and to create the site-documentation. Please read all the steps carefully before you run the commands.
Maven uses a lot of heap space to compile and to assemble the llrp commander eclipse plugin. If your VM-restrictions are to strict, then Maven crashes and complains about missing heap space. You can increase the heap space available to Maven via the command line.
set MAVEN_OPTS=-Xmx1024m
To complete the guide you need some basic building blocks to be in place. You cannot proceed if you don't have those tools at hand!
# checkout the latest source trunk via subversion. mkdir ~/workspace-fosstrak && cd ~/workspace-fosstrak svn co https://svn.fosstrak.org/repos/llrp/trunk/ llrp
!!! NOTICE !!!: Currently we build against the Ganymede release SR2. So please retrieve a copy of Ganymede SR2 (otherwise you will have to adjust the version numbers for the eclipse dependencies). Download the J2EE edition (~163MB)!
example Windows: c:\tmp\eclipse example *nix: /tmp/eclipse
We use the maven eclipse plugin to store the eclipse dependencies to the local maven repository and to generate the eclipse projects from the maven project descriptors (pom.xml).
After you deployed eclipse to a folder of your choice open a console/terminal and deploy the eclipse installation into your local maven repository. Please ensure, that you specify the parameter -DstripQualifier=true!
example Windows: mvn eclipse:to-maven -DeclipseDir=c:\tmp\eclipse -DstripQualifier=true example *nix: mvn eclipse:to-maven -DeclipseDir=/tmp/eclipse -DstripQualifier=true
Unfortunately, SWT requires a dependency to the widget library depending on your operating system. Your locally deployed eclipse installation provides this dependency. By default, we specify the windows variant in the file llrp-commander/pom.xml. If you install the LLRP commander on a Windows operating system, you will not have to modify anything and you can proceed with the packaging step.
This step is only required, if you run an operating system other than Windows! Open the file llrp-commander/pom.xml with a text-editor of your choice. Search for the string org.eclipse.swt.win32. Comment the SWT dependency for Windows and activate the dependency for your operating system. In case your operating system is not in the examples list yet, navigate to your local maven repository and open the folder org/eclipse/swt. There should be another subfolder containing a pom.xml with the groupId of your SWT dependency.
<!-- Extract from the llrp-commander/pom.xml --> <!-- please set the swt dependency to the one of you OS. Notice: for the plugin runtime this dependency is not required, so the plugin will be plattform independant! --> <!-- linux 64bit --> <!--<dependency> <groupId>org.eclipse.swt.gtk.linux</groupId> <artifactId>x86_64</artifactId> <version>3.4.1</version> </dependency>--> <!-- linux 32bit --> <!-- <dependency> <groupId>org.eclipse.swt.gtk.linux</groupId> <artifactId>x86_64</artifactId> <version>3.4.1</version> </dependency> --> <!-- os x --> <!-- <dependency> <groupId>org.eclipse.swt.carbon</groupId> <artifactId>macosx</artifactId> <version>3.4.1</version> </dependency> --> <!-- windows --> <dependency> <groupId>org.eclipse.swt.win32.win32</groupId> <artifactId>x86</artifactId> <version>3.4.1</version> </dependency>
To generate the eclipse plugin automatically open a command shell and navigate to the folder where you have the source code installed.
example Windows: cd c:\workspace-fosstrak\llrp example *nix: cd ~/workspace-fosstrak/llrp
Run the command "mvn package". If you run the command for the first time, Maven will have to download and install all the missing dependencies for the plugin. This can take a while, so go and have a coffee-break.
You will find the assembled package in the folder llrp-commander/target.
Maven can generate eclipse projects for you from the maven project descriptor.
mvn eclipse:eclipse -DM2_REPO="<PATH_TO_MAVEN_REPO> example Windows: mvn eclipse:eclipse -DM2_REPO="~/.m2/repositories" example *nix: mvn eclipse:eclipse -DM2_REPO="c:\Users\example\.m2\repositories"
If you omit the directory directive you can always specify the global classpath variable in the eclipse preferences.
Import the generated project in eclipse project-navigator. If you want to start the plugin from within eclipse, you need to create a symbolic link from target/lib/ to the folder lib/ in the llrp-commander folder. For Windows a comprehensive guide can be found on Wikipedia.
example Windows (open command line as administrator): cd c:\workspace-fosstrak\llrp\llrp-commander mklink /D lib "target\lib" example *nix: cd ~/workspace-fosstrak/llrp/llrp-commander ln -sf target/lib .
Alternatively, you can copy the whole lib folder from the target folder into the folder llrp-commander. Notice, that you will have to update the folder, whenever you change the dependencies!
If you want to clean out the eclipse projects run:
mvn eclipse:clean
Maven can generate the documentation from the apt-files within the src/site folder together with a complete documentation of the java-source code (javadoc).
mvn site:stage -DstagingDirectory="<SOME_DIRECTORY>" example Windows: mvn site:stage -DstagingDirectory="c:\fosstrakSites" example *nix: mvn site:stage -DstagingDirectory="/tmp/fosstrakSites"
The LLRP Commander is split into two maven modules. llrp-adaptor containing the backend controlling the communication to the LLRP readers and llrp-commander implementing the GUI.
llrp LICENSE.txt pom.xml Top-level maven2 project descriptor. src main assembly src.xml Assembly constructor to generate the source archive. site apt APT-files providing the documentation. resources All resources/images for the website. site.xml Site generation XML. llrp-adaptor Backend controlling communication to the LLRP readers. LICENSE.txt NOTICE.txt pom.xml src assembly bin-with-dependencies.xml Assembly constructor to generate an archive containing all the dependencies changes changes.xml Changes report. main java Java source code. resources Resources folder (example: Properties files, runtime configurations, ...) site Sub-site generation. test JUnit tests. llrp-commander GUI frontend. build.properties LICENSE.txt NOTICE.txt plugin.xml pom.xml readerDefaultConfig.properties Default reader configuration file. Definitions LLRP XSD schema. features Eclipse feature project. icons META-INF Folder providing the MANIFEST for the eclipse plugin. sampleXML Sample llrp messages. src changes Changes report. main assembly bin.xml Eclipse plugin assembly constructor. rcp.xml Eclipse RCP assembly constructor. eclipseconfig Configuration files for the RCP standalone build. java Java source code. resources Resources folder (example: Properties files, runtime configurations, ...) site Sub-site generation. test JUnit tests. update Eclipse update site project.