Release

Liferay Birthday List portlet

cake

Just wanted to let you guys know that our very basic version of Liferay Birthday List portlet is now available for FREE on Liferay Marketplace.

You can download and install it straight from the Marketplace.
liferay birthday list portlet

The portlet relies on the Liferay’s internal user database and displays the birthdays of Yesterdays, Todays and Tomorrows birthdays.

Can’t really say that’s an achievement, but at least it’s our first Portlet on the Marketplace.
We plan to start publishing many useful Portlets to make the Liferay Ecosystem a little bit friendlier to people who don’t have development teams just hanging around, waiting for work…

We will probably publish a more feature-rich Liferay Birthday List portlet that would also show Work Anniversaries and allow sending quick Congratulations using Liferay Notifications.

Jenkins and Maven Release plugin

OK, So here’s a quick tutorial on how to make a Jenkins and Maven Release plugin build that automatically creates a release build using Jenkins and we are assuming your code is in Git.

Step 1 is easy, get your code from Git. You just configure the Jenkins build as always.

Now, We need one additional plugin for Jenkins which is “Workspace Cleanup Plugin”. This allows us to enable
“Delete workspace before build starts” in Build Environment section.

Now the tricky part: Under Pre Steps you must add a new shell command:

git checkout master

This is because otherwise your git is checked out without a specific branch and maven release plugin will fail.

Build command

-B -Dusername=jenkins -Dpassword=JenkinsPasswordForGit release:prepare release:perform

Important notice – you can configure jenkins user to have automatic access to git in other ways also, but I decided to keep this info in the build.

Once you start releasing your project with Jenkins, you quickly discover that manually managing the version numbers inside your own multi-module project will become a hassle. Simple solution would be to configure Jenkins to upgrade your own dependencies to the latest releases (requires you to limit versions plugin to your own packages):

-B versions:use-latest-releases scm:checkin -Dmessage=$BUILD_NUMBER -Dusername=jenkins -Dpassword=JenkinsPasswordForGit release:prepare release:perform

Now we might want to limit versions plugin to our own com.codeyouneed package since having it upgrade ALL dependencies all the time is really bad.

<build>
    <pluginManagement>
        <plugins>
	        <plugin>
	            <groupId>org.codehaus.mojo</groupId>
	            <artifactId>versions-maven-plugin</artifactId>
	            <version>2.1</version>
	            <configuration>
	                <includesList>com.codeyouneed</includesList>
	                <generateBackupPoms>false</generateBackupPoms>
	                <allowSnapshots>true</allowSnapshots>
	            </configuration>
	        </plugin>
		</plugins>
	</pluginManagement>
</build>

Now that’s pretty much it. That git checkout master command took me a while to figure out.

Of course, for maven release plugin to work you actually need to add some stuff to your pom.xml also:


	<properties>
		<scm.url>scm:git:https://git.codeyouneed.com/git/test/repo</scm.url>
	</properties>
	
	<distributionManagement>
		<repository>
			<id>codeyouneed</id>
			<url>https://codeyouneed/artifactory/libs-releases-local/</url>
		</repository>
	</distributionManagement>

	<scm>
		<url>${scm.url}</url>
		<connection>${scm.url}</connection>
		<developerConnection>${scm.url}</developerConnection>
		<tag>HEAD</tag>
	</scm>

Important notice if you are dealing with multi-module maven projects – Submodules have to leave out their name from scm.url since release plugin will add the name by itself into the end of the URL.

    <scm.url>scm:git:https://git.codeyouneed.com/git/test[/submodulename]</scm.url>

So you should leave out the “/submodulename”.

Special thanks to a blog post that lead me to the right path: http://labs.bsb.com/2014/02/better-maven-releases-with-jenkins/

Jenkins Logo