Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3
Note
titlelooking for help making or updating an indie release tool?

Maven release plugin cheat sheet

pom.xml cleanup

1. Add namespace declarations and attributes

Code Block
xml
xml
<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/maven-v4_0_0.xsd">

2. Delete commented out lines of code

General

<groupId> = org.sakaiproject.project name
Code Block
xml
xml
<groupId>org.sakaiproject.polls</groupId>
Define project base pom version explicitly (i.e., do not inherit version from <parent>).
Use project variables
Code Block
xml
xml
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
List <developers>
List <contributors>

Project base pom

Add master <parent>
Code Block
xml
xml
<parent>
  <groupId>org.sakaiproject</groupId>
  <artifactId>master</artifactId>
  <version>2.10-SNAPSHOT</version>
  <relativePath>../master/pom.xml</relativePath>
</parent>
Define <scm> (Note - makes sure this points to your project!)
Code Block
xml
xml
<scm>
  <connection>scm:svn:https://source.sakaiproject.org/svn/basiclti/trunk</connection>
  <developerConnection>scm:svn:https://source.sakaiproject.org/svn/basiclti/trunk</developerConnection>
  <url>https://source.sakaiproject.org/svn/basiclti/trunk</url>
</scm>
Add site property
Code Block
xml
xml
<properties>
  <url.localsite>scp://source.sakaiproject.org/var/www/html/release/basiclti/${project.version}</url.localsite>
</properties>
Define <distributionManagement>
Code Block
xml
xml
<distributionManagement>
        <site>
            <id>sakai-site</id>
            <name>Sakai release Site</name>
            <url>${url.localsite}</url>
        </site>
</distributionManagement>
Define <pluginRepositories>
Code Block
xml
xml
<pluginRepositories>
        <pluginRepository>
            <id>maven2-central-repo</id>
            <name>Maven2 Central Repo</name>
            <url>http://repo1.maven.org/maven2/</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
        <pluginRepository>
            <id>Sakai Plugin Repo</id>
            <url>http://source.sakaiproject.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>
Define <repositories>
Code Block
xml
xml
    <repositories>
	<repository>
	    <id>sonatype-nexus-snapshots</id>
	    <name>Sonatype Nexus Snapshots</name>
	    <url>https://oss.sonatype.org/content/repositories/snapshots</url>
	    <releases>
		<enabled>false</enabled>
	    </releases>
	    <snapshots>
        	<enabled>true</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>sakai-maven</id>
            <name>Sakai Maven Repo</name>
            <layout>default</layout>
            <url>http://source.sakaiproject.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
        <repository>
            <id>default</id>
            <name>Maven Repository Switchboard</name>
            <layout>default</layout>
            <url>http://repo1.maven.org/maven2</url>
            <releases>
                <enabled>true</enabled>
            </releases>
            <snapshots>
                <enabled>false</enabled>
            </snapshots>
        </repository>
    </repositories>
Add <reporting>
Code Block
xml
xml
<reporting>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-javadoc-plugin</artifactId>
                <version>2.7</version>
                <configuration>
                    <debug>true</debug>
                    <links>
                        <link>http://download.oracle.com/javase/1.5.0/docs/api/</link>
                        <link>http://download.oracle.com/javase/6/docs/api/</link>
                    </links>
                    <breakiterator>true</breakiterator>
                    <verbose>false</verbose>
                    <aggregate>true</aggregate>
                    <minmemory>168m</minmemory>
                    <maxmemory>1024m</maxmemory>
                    <additionalJOption>-J-Xms168m -J-Xmx1024m -J-XX:PermSize=128m -J-XX:NewSize=64m</additionalJOption>
                </configuration>
            </plugin>
        </plugins>
</reporting>

Gotchas

Beware of API jar scope

Sakai API jars are deployed to $CATALINA_HOME/shared/lib and are available on the classpath. If you declare a dependency on a Sakai API be sure to set it's <scope> to provided.

Code Block
xml
xml
<dependencyManagement>
  <dependencies>
    <dependency>
      <groupId>org.sakaiproject.courier</groupId>
      <artifactId>sakai-courier-api</artifactId>
      <version>2.9-SNAPSHOT</version>
      <scope>provided</scope>
    </dependency>
    . . .
  </dependencies>
</dependencyManagement>

Examples

Project

SVN

Notes

BasicLTI

https://source.sakaiproject.org/svn/basiclti/

 

Profile2

https://source.sakaiproject.org/svn/profile2/

 

Samigo

https://source.sakaiproject.org/svn/sam/

Uses a profile to sign it's audio jar; assembly deploys OSID jar to /shared

Sitestats

https://source.sakaiproject.org/svn/sitestats/