...
1. Add namespace declarations and attributes
Code Block |
---|
|
<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 |
---|
|
<groupId>org.sakaiproject.polls</groupId>
|
Define project base pom version explicitly (i.e., do not inherit version from <parent>).
Use project variables
Code Block |
---|
|
<groupId>${project.groupId}</groupId>
<version>${project.version}</version>
|
...
List <contributors>
Project base pom
Add
...
master <parent>
Code Block |
---|
|
<parent>
<groupId>org.sakaiproject.purepoms<sakaiproject</groupId>
<artifactId>sakai-standard-tool<<artifactId>master</artifactId>
<version>2.910-SNAPSHOT</version>
<relativePath>../master/pom.xml</relativePath>
</parent>
|
Define <scm> (Note - makes sure this points to your project!)
Code Block |
---|
|
<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 |
---|
|
<properties>
<url.localsite>scp://source.sakaiproject.org/var/www/html/release/basiclti/${project.version}</url.localsite>
</properties>
|
Define <distributionManagement>
Code Block |
---|
|
<distributionManagement>
<downloadUrl>http://source.sakaiproject.org/maven2/</downloadUrl>
<snapshotRepository>
<uniqueVersion>false</uniqueVersion>
<id>sakai-maven-snapshots-scp</id>
<name>Sakai snapshot Repo</name>
<url>scp://source.sakaiproject.org/var/www/html/maven2-snapshots</url>
<layout>default</layout>
</snapshotRepository>
<repository>
<uniqueVersion>false</uniqueVersion> <id>sakai-maven2-scp</id>
<name>Sakai maven2 repository</name>
<url>scp://source.sakaiproject.org/var/www/html/maven2</url>
<layout>default</layout>
</repository>
<site>
<id>sakai-site</id>
<name>Sakai release Site</name>
<url>${url.localsite}</url>
</site>
</distributionManagement>
|
Define <pluginRepositories>
Code Block |
---|
|
<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 |
---|
|
<repositories>
<repository>
<id>sakai-maven<<id>sonatype-nexus-snapshots</id>
<name>Sonatype <name>Sakai Maven Repo<Nexus Snapshots</name>
<layout>default</layout>
<url>http<url>https://sourceoss.sakaiprojectsonatype.org/maven2<content/repositories/snapshots</url>
<releases>
<enabled>true< <enabled>false</enabled>
</releases>
<snapshots>
<enabled>false< <enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>sakai-maven2-snapshots<maven</id>
<name>Sakai Maven Repo</name>
<layout>default</layout>
<url>http://source.sakaiproject.org/maven2-snapshots<maven2</url>
<releases>
<enabled>false<<enabled>true</enabled>
</releases>
<snapshots>
<enabled>true<<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 |
---|
|
<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 |
---|
|
<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/ | |