Quick Start for a Standalone Project

Coming soon!

Quick Start for a SourceForge Project

The quick start follows the convention that the Maven artifactId will be the same as the SourceForge unix name. It describes only the bare minimum to get up and running with a new project. Refer to the configuration documentation for more detailed information on customizing the build.

At minimum, the pom.xml needs these steps completed:

  • Declare the sourceforge artifact to be the project parent.
  • Specify a value for the sourceforge-group property. This is the numeric id of the project on SourceForge.net. You can get this number from the project_id parameter in the URL after navigating to any of the project services.
  • Specify a value for the sourceforge-shellgroup property. This value is the first character of the project name followed by a forward slash and the first two characters of the project name. For example, the shell group for the project widget would be w/wi.

Below is a minimal pom.xml for a java project named widget that has been assigned the project id 123456 and uses the standard directory layout for a Maven project.

<?xml version="1.0" encoding="UTF-8"?>
<project>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>widget</artifactId>
   <parent>
      <groupId>net.sf.sweatsuite</groupId>
      <artifactId>sourceforge</artifactId>
      <version>1.0</version>
   </parent>
   <properties>
      <sourceforge-group>123456</sourceforge-group>
      <sourceforge-shellgroup>w/wi</sourceforge-shellgroup>
   </properties>
</project>

First Compile

Using this as a starting point, build the project using this command:

mvn compile

Next, you'll probably want to install a copy of the project build in the local Maven repository. Easy:

mvn install

Quality and Test Reports

To check out a fresh copy of the project, build it and run a complete set of unit tests and code quality reports, use the command:

mvn clean scm:update site -P reporting

Deploy to SourceForge.net

It's a lot easier to deploy if your settings.xml file already has your username, so start by either creating one or adding a few elements to an existing settings file. This file is kept in a subdirectory named .m2 in your home directory (~username on Unix-like systems). You'll need to add separate entries to deploy the project web site and the project snapshot repository, but if the project uses the default web space layout then both entries will have the same username. You can also put your password in this file, but that's not a good idea unless you are very certain of the security on your development machine and you have some reason not to type it in each time, such as for automatic uploads. The settings.xml contents should look something like this:

<settings 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/settings-1.0.0.xsd">
   <servers>
    <server>
      <id>[PROJECT NAME]-website</id>
      <username>[SOURCEFORGE USERNAME HERE]</username>
    </server>
    <server>
      <id>[PROJECT NAME]-snapshots</id>
      <username>[SOURCEFORGE USERNAME HERE]</username>
    </server>
  </servers>
</settings>

Deploy the Project Web Site

To deploy the site to SourceForge.net, use the command:

mvn site site:deploy

Deploy a Snapshot Build

To deploy a snapshot build to SourceForge.net, use the command:

mvn deploy

This may prompt for your password several times.

Five Minutes Are Up. Now What?