Versions Compared

Key

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

Revisions

...

Wiki Markup
h3. Revisions

kernel trunk r57527 (1.1-SNAPSHOT refresh)

...


kernel-1.0.x r57597 (1.0.4, 1.0.4-SNAPSHOT)

...


sakai-2.6.x r57646 (testing against)

...



kernel-1.0.4 tag (r57597)

...

Current versions




h3. Current versions

Tag: 1.0.2

...


Branch: 1.0.4-SNAPSHOT

...


Trunk 1.1-SNAPSHOT

...

New versions



h3.  New versions
Tag: 1.0.4

...


Branch: 1.0.4-SNAPSHOT

...


Trunk 1.1-SNAPSHOT

...

Testing exceptions

When testing before generating the release, make sure you change the hard-coded kernel dependencies to <version>1.0.4-SNAPSHOT</version> in /master/pom.xml and gradebook/app/standalone-app/pom.xml. This will need to be updated to 1.0.4 in the 2.6.x branch after the release along with the /master/pom.xml. The old sections integration-support 1.0RC2 dependency is fixed and needs to be merged to 2.6.x

gradebook/app/standalone-app/pom.xml

No Format
<!-- This should be part of the test framework -->
    <dependency>
      <groupId>org.sakaiproject.kernel</groupId>
      <artifactId>sakai-kernel-private</artifactId>
      <version>1.0.4-SNAPSHOT</version>
      <scope>test</scope>
    </dependency>

h3.  Testing exceptions

None.  ${sakai.kernel.version} property added to gradebook/app/standalone-app/pom.xml and sections/sections-impl/integration-support/pom.xml

...

No Format

<!--
Binding directly to the kernel impl is not a good idea,
It is liable to change.
When a test harness becomes available this code should be ported.

Hard coding the version so that we dont forget.
-->
    <dependency>
      <groupId>org.sakaiproject.kernel.impl</groupId>
      <artifactId>sakai-util-impl</artifactId>
      <version>1.0RC2-SNAPSHOT</version>
    </dependency>

Performing the release

Copy Maven2 /kernel locally

Start now as this can take some time. Folder copy will later serve as target for deploying artifacts generated during the deploy phase.

No Format
 now binds to sakai-kernel-impl properly

h3. Performing the release

h4. Copy Maven2 /kernel locally

Start now as this can take some time.  Folder copy will later serve as target for deploying artifacts generated during the deploy phase.

{noformat}
copy http://source.sakaiproject.org/maven2/org/sakaiproject/kernel 
to 
/tmp/maven2/org/sakaiproject/kernel

Backup Sakai Maven2 Repo /kernel

Create a backup copy of /kernel.

No Format

{noformat}

h4. Backup Sakai Maven2 Repo /kernel

Create a backup copy of /kernel.

{noformat}
cd /var/www/html/maven2/org/sakaiproject
sudo cp -R kernel kernel-[current version]

Checkout the kernel project

Checkout a clean version of the project using SVN not git.

No Format
{noformat}

h4. Checkout the kernel project 

Checkout a clean version of the project using SVN not git.

{noformat}
svn co https://source.sakaiproject.org/svn/kernel/branches/kernel-1.0.x/ kernel-1.0.x

(warning) Avoid opening it in Eclipse; otherwise you will pollute the projects with Eclipse metadata files that will have to be deleted before performing the release. Checkout with svn (not git)

Clean out local repo

Verify that a clean build works ok with no external dependencies. Issuing mvn -o clean install ensures that .m2 repo is populated, a requirement for the assembly plugin. If the build fails because external dependencies are missing in .m2 run mvn clean install, then delete /kernel and run mvn -o clean install again.

No Format

{noformat}  

(!) Avoid opening it in Eclipse; otherwise you will pollute the projects with Eclipse metadata files that will have to be deleted before performing the release.  Checkout with svn (not git)

h4. Clean out local repo 

Verify that a clean build works ok with no external dependencies.  Issuing {{mvn -o clean install}} ensures that {{.m2}} repo is populated, a requirement for the assembly plugin.  If the build fails because external dependencies are missing in {{.m2}} run {{mvn clean install}}, then delete {{/kernel}} and run {{mvn -o clean install}} again.

{noformat}
rm -rf ~/.m2/repository/org/sakaiproject/kernel
mvn -o clean install
{noformat}

*Note:* check for Eclipse metadata files (.classpath, .project) and remove.  Uncommitted versions of these files will cause {{mvn release:prepare}} to fail.

...



h4. Create tag

...



Issue the following release plugin goals:

...



{noformat
}
mvn release:prepare -DdryRun=true
mvn release:clean release:prepare
mvn release:perform
{noformat}

When prompted for new versions:

...


 
#set the released version to 1.0.4

...


#set the tag to kernel-1.0.4

...

 
#set the the new version to 1.0.4-SNAPSHOT

...

 

Should the build fail rerun the following mvn goals to restart the build:

...



{noformat
}
mvn clean install 
mvn release:prepare
{noformat}

to restart the build.

...



*Note:* Beware opening the kernel in Eclipse. If you do you will have to delete Eclipse metadata files (.classpath, .project) before running {{mvn release:prepare

...

Trunk vs Branch releases

When releasing from trunk, issue the branch goal to create a new branch:

No Format
}}.

h3. Trunk vs Branch releases

When releasing from trunk, issue the branch goal to create a new branch:

{noformat}
mvn release:clean  (clean up release)  
mvn release:branch -DbranchName=kernel-1.1.x

...

{noformat} 

The release plugin will then branch the current trunk to branches/kernel-1.1.x.

...


Edit the poms to 1.2-SNAPSHOT and commit.

...

Finis

...



Finis

h4. Check 1.0.4 tag

...



The release plugin will generate a 1.0.4 tag.  Check it out and make sure it works.

...



h4. Refresh Maven Repo with 1.0.4, 1.0.4-SNAPSHOT and 1.1-SNAPSHOT artifacts

...



Each new release will require placement of corresponding kernel artifacts in the Maven2 repo.

...


Steps:

...



1. Check out 1.0.x branch (1.0.4-SNAPSHOT) and perform

...



{noformat
}
mvn deploy
{noformat}

2. Check out kernel trunk (1.1-SHAPSHOT) and perform

...



{noformat
}
mvn deploy
{noformat}

For each new version (tag, SNAPSHOT) issue the following command from the root folder:

...



If a release:

...



{{mvn -Prelease clean install deploy -DupdateReleaseInfo=true

...

}}

if a SNAPSHOT

...



{{mvn deploy

...

}}

Maven will populate /tmp/maven2/org/sakaiproject/kernel with updated

...

SNAPSHOT refreshes

When refreshing SNAPSHOT artifacts, delete the existing artifact folder and contents before running mvn deploy.

...

 artifacts 

h4.  SNAPSHOT refreshes

When refreshing SNAPSHOT artifacts, delete the existing artifact folder and contents before running {{mvn deploy}}.

{{bash deletesakaiartifact.bash 1.1-SNAPSHOT /tmp/maven2/org/sakaiproject/kernel

...

No Format
}}

{noformat}
#!/bin/sh
# Delete artifact folders prior to deploying Maven snapshot artifacts.
# This is necessary as Maven does not update it's metadata files correctly when an old artifact exists in the repo.
# bash deletesakaiartifact.bash [TARGET FOLDER NAME] (e.g., 1.1-SNAPSHOT) [LOCATION] (e.g. /tmp/maven2/org/sakaiproject/kernel)
# author=Anthony Whyte, arwhyte@umich.edu

TARGET=$1
LOCATION=$2

cd $LOCATION
echo "Removing ${TARGET} folders and content recursively from ${LOCATION}"
rm -rf `find . -type d -name ${TARGET}`

Populate Maven Repo

...

{noformat}

h4. Populate Maven Repo

Tar up kernel artifacts.  Copy to source.sakaiproject.org.  Make sure backup of existing /kernel directory is in place.  Explode tar file.

...



{noformat
}
tar -cvzf  kernelrepo.tgz /tmp/maven2/org/sakaiproject/kernel}}

copy kernelrepo.tgz to Maven2 repo

cd /var/www/maven2/org/sakaiproject
tar xvzf kernelrepo.tgz

Repo permissions

Make sure repo permissions are correct

sudo chown -R apache:apache kernel

References

Maven Release Plugin
Maven mini-guide

...

{noformat} 

h4. Repo permissions

Make sure repo permissions are correct

sudo chown -R apache:apache kernel


h3.  References

[Maven Release Plugin|http://maven.apache.org/plugins/maven-release-plugin/]
[Maven mini-guide|http://maven.apache.org/guides/mini/guide-releasing.html]

J. Ferguson, ["Using the Maven Release Plugin"|http://weblogs.java.net/blog/johnsmart/archive/2008/08/using_the_maven.html]