Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Especially the first time this is done, it may take quite a long time to bootstrap Maven.

Building Modules

The list of available modules is available from the Project Modules Webpage on the HPS Java site generated by Maven.

To build a single module, assuming you already have a local copy of the SVN trunk, you just need to go to its sub-directory and type the appropriate Maven command.

For instance, this command will build the tracking reconstruction module.

No Format
cd hps_trunk/tracking
mvn -DskipTests

This will install that module's jar into your local Maven repository.  In order to include these changes in the distribution jar, you also need to build the distribution module, also.

No Format
cd hps_trunk/distribution
mvn

Running the Distribution Jar

...

Now you can simply click on the "bin jar" link for the distribution version you want to download, save it to your machine, and run it using the previous instructions.

Subversion Credentials

HPS Java is publicly accessible as a read only download from the server.  But valid credentials must be supplied in order to commit your local source code changes to the repository.

Info
titleRequesting a Subversion Account

In order to request a username and password for the Subversion repository, please email <hps-software AT slac.stanford.edu> indicating your full name, desired username, and institutional affiliation.

To commit changes, the username and password must be supplied, or the command will fail:

No Format
svn commit --username [username] --password [password] -m "commit message goes here" the/file/to/commit

After the username and password have been supplied once, they can be cached automatically in the directory ~/.subversion if you select 'Y' when prompted whether to store them (unencrypted unfortunately!).  Then these two arguments can be omitted from subsequent commit commands.

Resolving Maven Dependencies

Maven is able to resolve project dependencies by downloading jar files from remote repositories.  In order to do this, it must know about the locations of these jars, or local builds can fail with errors about missing dependencies.

This should not be a problem when building the entire trunk  But errors may occur when building individual modules, if the parent POM has not already been installed locally beforehand.

There are several different ways to resolve these kinds of issues, and generally only one will be needed:

  1. Install the entire set of modules locally by building the trunk.
  2. Checkout and build the parent module at svn://svn.freehep.org/hps/java/trunk/parent which contains the remote repository locations.
  3. Add the remote repository to your global Maven settings file.

The third option entails adding the remote repository information to a local settings file that will apply to all your local Maven builds.

In order to do this, the following XML can be put into the file ~/.m2/settings.xml which you should create if it does not exist already:

No Format
<?xml version="1.0"?>
<settings>
    <profiles>
        <profile>
            <id>yourNameHere</id>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
                <repository>
                    <id>lcsim-maven</id>
                    <name>org.lcsim Maven Repository</name>
                    <url>http://srs.slac.stanford.edu/nexus/content/groups/lcsim-maven2-public/</url>
                </repository>
            </repositories>
        </profile>
    </profiles>
</settings>

The above configuration will allow Maven to check the repository used by HPS whenever it looks for dependencies during a build.