Monday, 1 November 2010

Open Source song :-)

The famous french singer jcfrog has made a nice song on Open Source :-)


Check out the other one on twitter : http://www.youtube.com/watch?v=oetmdgPRyqw

I hope we will have one for ASF

Have Fun !

-Olivier

Thursday, 21 October 2010

Apache Maven Site Plugin 3.0-beta-3 for maven 3

The Maven team is pleased to announce the release of the Maven Site Plugin, version 3.0-beta-3 for Maven 3.
This version is intended to be the version of the Maven Site Plugin for Maven 3.

The Site Plugin is used to generate a site for the project.

You should specify the version in the section of your project's POM:

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.0-beta-3</version>
</plugin>

Release Notes - Maven 3.x Site Plugin - Version 3.0-beta-3


Bug
  • [MSITE-500] - Warning message about missing report plugin version shows null instead of plugin groupId:aritfactId
  • [MSITE-504] - Maven site fails to run due to non-report goals
  • [MSITE-505] - Unable to use SVN SCM wagon to upload a site
  • [MSITE-506] - Maven3 conflict with plexus-archiver
  • [MSITE-507] - report plugin doesn't have dependencies section coming from build section configuration
  • [MSITE-508] - attach-descriptor goals leaks file handlers, causing sporadic build failures when gpg tries to sign descriptor during release
  • [MSITE-512] - [Regression] Configuration of m-javadoc-p at reportSet level is not taken into account

Task
  • [MSITE-513] - use release final maven 3.0 artifacts

Have Fun !
--
Olivier Lamy on behalf of the The Maven Team

Monday, 18 October 2010

Maven Selenium Plugin 1.1 (Maven 3 compatible)

Hi,
The Maven Selenium Plugin 1.1 version has been released.
The most important fix is the Maven 3 compatibility !

Improvement
Don't miss to update the version in your pom

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>1.1</version>
</plugin>

Have Fun !

Saturday, 9 October 2010

Tomcat Maven Plugin 1.1 Released

Tomcat Maven Plugin 1.1 has been released.
Site documentation : http://mojo.codehaus.org/tomcat-maven-plugin/.

Here the release notes :

Bug
  • [MTOMCAT-55] - Can't shutdown tomcat started with tomcat:run with fork=true
  • [MTOMCAT-57] - Secondary war files deployed with incorrect context path
Improvement
  • [MTOMCAT-63] - Make isWar() check consistent with MTOMCAT-23
  • [MTOMCAT-64] - Document how to change the Embedded Tomcat Version
  • [MTOMCAT-65] - Upgrade Tomcat to 6.0.29

Have Fun !

Sunday, 3 October 2010

Hudson Maven Dependency Update Trigger : First Hudson plugin with maven 3 apis

I have made the first release of the Maven Dependency Update Trigger hudson plugin.
Wiki page here : http://wiki.hudson-ci.org//x/jgfDAg
This plugin will check according to the cron expression if your SNAPSHOT dependencies has been updated and (optionnaly) check if your plugins SNAPSHOT has been updated too. And trigger a build if necessary.
This is usefull if you have project dependencies not in the same hudson instance or using an other continuous integration tool.
Note this plugin use maven 3 apis to build maven projects and check dependencies.
Hudson 1.379 is required to use this plugin.



So have fun and give me feedbacks.

Wednesday, 22 September 2010

Use maven 3 apis in a hudson plugin

Using maven 3 apis in a hudson needs to change classLoader hierarchy as hudson load some old maven artifacts in the parent classLoader.
So the solution is to use a child first classLoader.
This new classLoader has been introduced in hudson 1.378. (see HUDSON-5360).
So you can now use it to made your plugin dependencies win on hudson core classLoader.
Some steps are needed.
Configuring your hpi plugin

<plugin>
<groupid>org.jvnet.hudson.tools</groupid>
<artifactid>maven-hpi-plugin</artifactid>
<version>1.54</version>
<configuration>
<pluginFirstClassLoader>true</pluginFirstClassLoader>
</configuration>
</plugin>

So now your pluginWrapper.classLoader will be of type PluginFirstClassLoader.

// pluginId is project.artifactId from your plugin pom
PluginWrapper pluginWrapper = Hudson.getInstance().getPluginManager().getPlugin( pluginId );
PluginFirstClassLoader pluginFirstClassLoader = (PluginFirstClassLoader) pluginWrapper.classLoader;


Now everthing is ready but some other tricks are needed :-)

Create a PlexusContainer (note you must use the new "plexus-guice" bridge).
This means you need the following dependency :

<dependency>
<groupId>org.sonatype.sisu</groupId>
<artifactId>sisu-inject-plexus</artifactId>
<version>1.4.1</version>
</dependency>

And very important you must exclude dependencies from the original plexus-container

<dependency>
<groupId>org.sonatype.aether</groupId>
<artifactId>aether-connector-wagon</artifactId>
<version>${aetherVersion}</version>
<exclusions>
<exclusion>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-container-default</artifactId>
</exclusion>
</exclusions>
</dependency>


To prevent this you can add an enforcer rule which will chech plexus-container-default inclusion

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-enforcer-plugin</artifactId>
<version>1.0-beta-1</version>
<executions>
<execution>
<goals>
<goal>enforce</goal>
</goals>
<phase>validate</phase>
<id>ensure-no-plexus-container</id>
<configuration>
<rules>
<bannedDependencies>
<excludes>
<exclude>org.codehaus.plexus:plexus-container-default</exclude>
</excludes>
<message>
ensure-no-plexus-container doesn't work anymore with maven 3 librairies. you have to add some exclusions.
</message>
</bannedDependencies>
</rules>
<fail>true</fail>
</configuration>
</execution>
</executions>
</plugin>


How to create the PlexusContainer from the PluginFirstClassLoader :

private PlexusContainer getPlexusContainer(PluginFirstClassLoader pluginFirstClassLoader) throws PlexusContainerException {
DefaultContainerConfiguration conf = new DefaultContainerConfiguration();
ClassWorld world = new ClassWorld();
ClassRealm classRealm = new ClassRealm( world, "project-building", pluginFirstClassLoader );
// olamy yup hackish but it's needed for plexus-shim which needs a URLClassLoader and PluginFirstClassLoader is not
for ( URL url : pluginFirstClassLoader.getURLs() )
{
classRealm.addURL( url );
LOGGER.fine( "add url " + url.toExternalForm() );
}
conf.setRealm( classRealm );

return new DefaultPlexusContainer( conf );
}


Then set the current Thread classLoader (don't miss to restore the original one in a finally statement

PlexusContainer plexusContainer = getPlexusContainer( pluginFirstClassLoader );

Thread.currentThread().setContextClassLoader( plexusContainer.getContainerRealm() );


Now you can play with maven 3 apis

ProjectBuilder projectBuilder = plexusContainer.lookup( ProjectBuilder.class );


A first sample is the plugin called : maven-dependency-update-trigger
: sources and Wiki Page (under construction :-) )
You must have a look at the dependencies used.

The plugin will check your project according to a cron expression and schedule a build if a snapshot dependency has changed (dependency and plugin).

It will be released as son as hudson 1.378 will be released.

Note : hpi:run doesn't work yet for this plugin as it needs some changes in the hpi mojo to handle the new PluginFirstClassLoader.

Thursday, 9 September 2010

Searching new challenge

Hi,
I'm currently searching new challenge for my work life.
And why not a kind of new life.
If you don't know me : my work or my opensource life.
You will find a resume here http://people.apache.org/~olamy/resume/.
Note as I'm a opensource/maven addict it's in a maven format.
The license is very flexible.
So feel free to fork or distribute this resume :-).

--
Olivier