Olivier Lamy

Subscribe to Olivier Lamy feed
French OpenSource addict living @Melbourne, Australia. Apache committer/Member, Jenkins committer and others. Also the father of some :-) (four) beautiful kids and husband of a wonderful wife. Also a Running addict http://home.apache.org/~olamy/ http://twitter.com/olamy https://about.me/olamy A bit old and still no rolex (but a Suunto ;-) ) neither Champion of nothing neither traveling all around the world to talk about himself in conferences. But like helping Open Source users as much he can. Olivier Lamyhttps://plus.google.com/111268326109644121368noreply@blogger.comBlogger82125
Updated: 18 hours 32 min ago

Life is too short to waste time uploading a patch or Maven Patch Tracker plugin

Mon, 11/21/2011 - 21:33
Life is too short and you don't want to waste time contributing to a project (creating a patch, a entry in the jira issue tracker then upload the patch).
So the Maven Patch Tracker plugin is for you !



You will be able with a maven plugin to do all of this in one command line !
Without any configuration you have to write :

mvn patch-tracker:create
-Dpatch.summary="foo summary"
-Dpatch.serverUrl=http://localhost:8080/browse/MNG -B
-Dpatch.user=uid -Dpatch.password=pwd


If you find that boring or too long no problem, there is a solution for that (yes good developer are lasy developers they use tool to automate tasks :-) ).
So configure you pom, with the issue tracker id

<issueManagement>
<system>jira</system>
<url>http://host:ip/browse/projectKey</url>
</issueManagement>


Add a server entry in you settings.xml


<server>
<id>jira-maven</id>
<username>olamy</username>
<password>very complicated password for paranoiac security folks</password>
</server>


Reference this jira server in your pom:


<properties>
....
<patch.tracker.serverId>jira-maven</patch.tracker.serverId>
....
</properties>


Et voilà, just run and save fingers:

mvn patch-tracker:create -Dpatch.summary="foo summary" -B


NOTE: without -B the plugin will use a prompt mode to ask you confirmation on the values

An other mojo called update can add/update an issue with an other patch:

mvn patch-tracker:update -Dpatch.description="update of the issue with an other patch" -Dpatch.patchId=MNG-5203 -B

This command will update the issue MNG-5203 with an other patch.

NOTE: currently only jira is supported

The plugin will use the configured scm client configured tru your scm url to generate the patch/diff file.
So your project is configured with svn but for some reasons you use git svn.
No problem add the parameter: -Dscm.providerType=git

Other improvement I think: load the patch to review board.

Something else ?
Ideas and patches are welcome :-)

You can test it using the snapshot repo: https://repository.apache.org/content/groups/snapshots-group/ or build it yourself: http://svn.apache.org/repos/asf/maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/

Have Fun and good hacking!


Categories: Olivier Lamy

Archiva 1.4-M1 released

Wed, 10/26/2011 - 13:32
The Apache Archiva 1.4-M1 has been released.
Some nice features added:

  • It is now possible to create a staging repository for any managed repository and later merge the results.

  • You can now use REST services to control Archiva or search for artifacts. See REST Services for more information.

  • Database storage for repository metadata has been replaced with a JCR repository based on Apache Jackrabbit by default (other options such as a flat-file storage may be made available in the future).

  • The search interface provide now the capability to search on OSGI metadata (based on the update of the Apache Maven Indexer library).

  • You can now download Maven index content from remote repositories to include artifacts which are not present locally in your search results



Full release notes available here: http://archiva.apache.org/docs/1.4-M1/release-notes.html

Download page: http://archiva.apache.org/download.html

Have Fun and some nice new features will come soon :-)

Apache Archiva, Archiva, Apache Maven, Maven, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

Apache Tomcat Maven Plugin Features

Fri, 10/21/2011 - 09:31
Recently I posted some informations regarding the move from codehaus to ASF of the Tomcat Maven plugin and about the support of tomcat7 in trunk code.

So now in this post, I'd like to talk of the features I prefer.

Run goal in multi modules with Maven3
Usually with Apache Maven, your application code is splitted in some modules to respect the Separation Of Concern paradigm.
Something like :

root
pom.xml
foo-api
pom.xml
foo-impl
pom.xml
foo-webapp
pom.xml

So to test your webapp module you have to install all other modules first which is time/io consuming.
Now with Apache Maven 3 and the Tomcat Maven Plugin (from Codehaus version 1.1 or now the 2.0-SNAPSHOT from Apache), you can simple use the goal run from the root directory and the plugin will see various modules build output and include those automatically in the embeded tomcat in the webapp class loader.

Build a standalone executable war/jar
You can now build a standalone jar which will contains Apache Tomcat needed classes and your wars.
See documentation.
This will produce a similar jar as for the Jenkins distribution.
At the end you will be able to run the produced jar with a simple:

java -jar yourjar


And that's will start Apache Tomcat without need of any installations !

NOTE: it's very recent feature based on my need :-)
So all issues/feedback or some RFE are really welcome!

Have Fun!
--
Olivier



Apache Maven, Maven, Apache Tomcat, Tomcat, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

Tomcat Maven Plugin now supports tomcat7

Sun, 10/09/2011 - 14:06
Hello,
After moving the Tomcat Maven Plugin from Codehaus to Apache in the Tomcat land (see previous post), I have found some time to start hacking on it.
The first feature I wanted to add was support of Apache Tomcat 7.x. So it's now implemented in trunk.
You can test it see how to configure that in your poms: http://tomcat.apache.org/maven-plugin-2.0-SNAPSHOT/snapshot-test.html.

NOTE the important changes with the move to Apache and the support of Apache Tomcat 7.x:

  • You know have two "mojos": tomcat6:* and tomcat7:$

  • The groupId is now: org.apache.tomcat.maven

  • All goals are not supported: I will work on that :-)



So you can know use tomcat7 in embedded way within your Apache Maven build with: tomcat7:run.

Feel free to report any issues: https://issues.apache.org/jira/browse/MTOMCAT

Have Fun!

Apache Maven, Maven, Apache Tomcat, Tomcat, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

New default http(s) transport layer in maven core 3.x

Mon, 10/03/2011 - 10:29
In the current maven core dev trunk, we have recently replace the http(s) transport layer from lightweight wagon (based on default jdk http(s) mechanism) to the wagon http module based on Apache httpclient [1].

See related post.

This change include two improvements:
* connection pool mechanism (to avoid http(s) connection recreation for each artifacts download).
* preemptive authz mechanism which will prevent uploading artifacts twice.

As it's important change in the core distribution, we like to have some feedbacks from users a SNAPSHOT distribution (based on rev 1178324) is available here : http://people.apache.org/~olamy/core/maven-3-r1178324/

mvn -v display: Apache Maven 3.0.4-SNAPSHOT (r1178324; 2011-10-03 10:07:26+0200)

An other way to test it with maven3 is to download the shaded jar [2] and copy it in $M2_HOME/lib/ext.

Feel free to test it and report any issues you will have with this new default http(s) transport layer.


Thanks in advance for your testing time and have fun !
--
Olivier

[1] http://hc.apache.org/httpcomponents-client-ga/index.html
[2] http://repo1.maven.org/maven2/org/apache/maven/wagon/wagon-http/2.0/wagon-http-2.0-shaded.jar


Categories: Olivier Lamy

Apache Maven Wagon 2.0 released

Thu, 09/29/2011 - 21:57
Apache Maven Wagon 2.0 has been released with some nice fixes/features.
See full changelog

The most important features are :
* using http(s) connection pooling: see my previous post.
* support of preemptive authentication: yes this will prevent your artifacts to be uploaded twice (as it was done until this release)

You can test that now. Download the shaded jar: wagon-http-2.0-shaded.jar and put it in your $M2_HOME/lib/ext (for maven 3+)

Note this version will part of Apache Maven official distribution in the next 3.0.4 release.

Have Fun !
--
Olivier

Apache Maven, Maven, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

Maven Download time Improvement

Sat, 09/17/2011 - 18:47
While working a bit on wagon (the api used in Apache Maven to download/upload artifacts), I wanted to reduce the http(s) connection creation number (see WAGON-348).
The current embedded http wagon in Maven Core is the lightweight one based on standard java libraries, this means http(s) connection are created for each download requests. As you know this socket creation can be time and resources consuming.
So as we are working on wagon 2.0 version, I have added a connection pooling mechanism in the wagon http (which is now based on Apache Http Client).
To prevent some classloading issues, the wagon jar to used is a shaded one.
You can test that now (with a maven 3.x version) with adding the jar in $M2_HOME/lib/ext/ :

wget -O wagon-http-2.0-SNAPSHOT-shaded.jar "https://repository.apache.org/content/groups/snapshots-group/org/apache/maven/wagon/wagon-http/2.0-SNAPSHOT/wagon-http-2.0-20110917.172345-31-shaded.jar"
&& cp wagon-http-2.0-SNAPSHOT-shaded.jar $M2_HOME/lib/ext/


Test build available here : http://people.apache.org/~olamy/maven/.

So a little improvement, don't be afraid you still will have time to drink one or two coffee when building a maven project :-).
Note download time will be improved if you use more than one repositories and especially https repositories.

Vote here if you want to have this in next maven core release : http://jira.codehaus.org/browse/MNG-5175.

And all feedbacks will be appreciate :-) (even if it's an issue :-) )

Have Fun !
--
Olivier

Apache Maven, Maven, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

Tomcat Maven Plugin New Home at Apache Software Foundation

Thu, 09/08/2011 - 15:50
The Tomcat Maven Plugin has now a new Home at Apache Software Foundation.
The home is located here .
You will find some details on :

  • Sources location

  • Bug Tracker location



Some more cleanups need to be done to finish the Apache Branding.
Next steps (new features) will be :

  • Support of Apache Tomcat7 trough a new mojo : tomcat7:*

  • New mojo to be able to build an executable war with an embedded tomcat inside to be able to do : java -jar mywar.war



All feedbacks will be appreciate.
Have Fun.

Apache Maven, Maven, Apache Tomcat, Tomcat, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

Maven Archetype Plugin 2.1 very useful feature

Mon, 09/05/2011 - 08:59
Maven Archetype Plugin 2.1 has just been released and contains a very (IMHO) useful feature.
Usually when you use this plugin with generate goal, you have a very huge list of available archetypes (a non human readable list :-) ).

mvn archetype:generate
here the output :
.....
444: remote -> se.vgregion.javg.maven.archetypes:javg-minimal-archetype (-)

Yes around 450 possible archetypes. Do you have configured enough scrolling in your console to review all ?: -).
So now with 2.1 release it's possible to apply some filtering :

  • with a mojo parameter

  • in the prompt


You can filter on the groupId and/or the artifactId.
The documentation is available here.
My bad !. The official documentation has a typo.
You must read : mvn archetype:generate -Dfilter=org.apache:struts (and not mvn archetype:generate -Dorg.apache:struts).
So this feature is pretty cool to reduce the archetypes list when you know a part of what type of project type you want to create.
A sample, you want to create a gwt project.
So simply use :

mvn archetype:generate -Dfilter=:gwt
The output list is reduce :
Choose archetype:
1: remote -> net.kindleit:gae-archetype-gwt (-)
2: remote -> net.sf.mgp:maven-archetype-gwt (An archetype which contains a sample Maven GWT project.)
3: remote -> org.codehaus.mojo:gwt-maven-plugin (Maven plugin for the Google Web Toolkit.)
4: remote -> org.codehaus.sonar.archetypes:sonar-gwt-plugin-archetype (-)
5: remote -> org.geomajas:geomajas-gwt-archetype (-)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :

Note you can enter an other filter to reduce the list

Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): : maven
Choose archetype:
1: remote -> net.sf.mgp:maven-archetype-gwt (An archetype which contains a sample Maven GWT project.)
2: remote -> org.codehaus.mojo:gwt-maven-plugin (Maven plugin for the Google Web Toolkit.)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): :


You can filtering on groupId.
I want an artifact with gwt coming from codehaus :

mvn archetype:generate -Dfilter=org.codehaus:gwt
The output list :
Choose archetype:
1: remote -> org.codehaus.mojo:gwt-maven-plugin (Maven plugin for the Google Web Toolkit.)
2: remote -> org.codehaus.sonar.archetypes:sonar-gwt-plugin-archetype (-)


Have Fun !

Apache Maven, Maven, Apache are trademarks of The Apache Software Foundation.


Categories: Olivier Lamy

Selenium Maven Plugin upgrade to Selenium Server 2.x

Fri, 06/17/2011 - 10:50
The current selenium-maven-plugin from Codehaus Mojo has been updated to use selenium server 2.0rc2. So you will be able to use now selenium 2.x feature.
The Mojo version has been upgraded to 2.0-SNAPSHOT.
So feel free to test and report any issue.
To test it :
Add the codehaus snapshot repo in your pom :

<pluginRepositories>
<pluginRepository>
<id>codehaus.snapshots</id>
<url>https://nexus.codehaus.org/content/repositories/snapshots/</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>

Configure the mojo version

<pluginManagement>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>selenium-maven-plugin</artifactId>
<version>${seleniumPluginVersion}</version>
</plugin>
</plugins>
</pluginManagement>


So have Fun.


Categories: Olivier Lamy

Deploying in cloudbees @RUN with a Jenkins Plugin

Wed, 04/13/2011 - 18:23
Currently the way to deploy your application in cloudbees @RUN was trough the cloudbees sdk or a maven plugin.

Now you will be able to do it with a Jenkins Plugin configured in your Jenkins job.
Currently it's not yet released but a build version is available here.

Have a look at this movie. Note it's a huge movie with some suspens : so take a pop corn box and be patient :-).

Sources are available here : https://github.com/olamy/cloudbees-deployer-plugin.

The plugin uses the cloudbess client api available here : https://github.com/cloudbees/cloudbees-api-client

Feel free to test it and report any issues or new features you'd like to see.

Thanks to cloudbees for the sponsorship of this developpement.


Have Fun and onward ! :-)


Categories: Olivier Lamy

Maven buildnumber plugin will support other scm : git mercurial

Fri, 03/25/2011 - 12:00
Some of you are probably using the buildnumber-maven-plugin from codehaus to get a scm id.
The current released version 1.0-beta-4 is very svn centric.
So the current trunk has been improved to be able to support more scm : git, hg (mercurial).
The info command (yes an another svn centric name :-) ) has been implemented in Apache Maven Scm. Sure all scms are not supported but having at least svn, git and hg is a good start.

So you can test this new feature with a snapshot version : 1.0-beta-5-SNAPSHOT.

Note : to test this, you must be able to download some snapshots from various places (yes Apache Maven download the whole internet :P ).
So if you use a repo manager, you must add the following repositories :
* https://repository.apache.org/content/groups/snapshots-group/ (for maven scm snapshots)
* https://nexus.codehaus.org/content/repositories/snapshots (for the buildnumber plugin snapshot)
* https://oss.sonatype.org/content/repositories/snapshots (for maven-scm-provider-svnjava )

Update 11 April 2011 : version 1.0 released and available in central repo.

So have Fun and do not hesitate to report any issues :-)
--
Olivier


Categories: Olivier Lamy

Maven Surefire executing only one test method in a test class

Thu, 02/24/2011 - 11:13
I have just worked on a improvement in Apache Maven Surefire Plugin.
Most of the time you have a test class which contains a lot of test methods.
When only one failed you have to execute all methods of the class (with -Dtest=MyClass)
This can be long and boring :-).

So now (see [1]), you will be able to use -Dtest=MyClass#myMethod to execute only the method called myMethod from the test class MyClass.

The feature has been pushed in a github fork [2].
Why in a github fork : I'd like to have feedback fast :-)

So how to test it ? :

Get the sources :

git clone git://github.com/olamy/maven-surefire.git
cd maven-surefire
mvn clean install (add -DskipTests if you don't want to execute all integration tests).

Update you pom :

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.7.3-SNAPSHOT</version>
</plugin>

And now test it :-)

-Dtest=MyTestClass#myMethod (note the support of * : -Dtest=MyTestClass#*Method )

NOTE : supported only for junit 4.x

Update : now supported for testng too.

Update 25 Feb : merged in ASF svn repo http://svn.apache.org/viewvc?view=revision&revision=1074633

Update 12 March : released in surefire 2.8 (Yeahhh :-) )

Have Fun ! (and don't miss to put feedback in case of issues)
--
Olivier

[1] http://jira.codehaus.org/browse/SUREFIRE-577
[2] https://github.com/olamy/maven-surefire


Categories: Olivier Lamy

Sonar Instance @ASF

Wed, 02/02/2011 - 22:30
A Sonar instance is now available at ASF http://analysis.apache.org/.

Builds are provided by Jenkins : http://analysis.apache.org/jenkins/ (yes I couldn't resist to use it even before the first official release :-) ).

If you want to add your project see : http://wiki.apache.org/general/SonarInstance

Have Fun and Thanks ASF INFRA !


Categories: Olivier Lamy

XMas for hudson users

Fri, 12/24/2010 - 14:00
Done maven3 support branch in hudson has been merged in master : https://github.com/hudson/hudson .
The maven native plugin will now supports maven 3 builds too.

It will be part of the next release 1.392.

Until it's released you will find a build here : http://people.apache.org/~olamy/hudson/main-maven3-support/hudson.war
To test it it's as simple as :
wget http://people.apache.org/~olamy/hudson/main-maven3-support/hudson.war -O hudson.war

So have Fun and nice XMas !!
--
Olivier


Categories: Olivier Lamy

Using gwt sdk 2.1.1 with Gwt Maven Plugin 2.1.0-1

Mon, 12/20/2010 - 11:44
In the last Gwt Maven Plugin, the gwt sdk used is now the one defined in the Maven plugin dependencies.
This means only update your pom dependencies to gwt 2.1.1 won't be enough to compile your project with the last Gwt Sdk version.
To override the Gwt Sdk version used by the Maven plugin, you must add the following configuration :
I'm sure you follow good pratices and have put the version in a property :P

<project>
....
<properties>
<gwt.version>2.1.1</gwt.version>
</properties>
...
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.1.0-1</version>
.....
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-user</artifactId>
<version>${gwt.version}</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>${gwt.version}</version>
</dependency>
</dependencies>
.....
</project>


Have Fun !


Categories: Olivier Lamy

Fast update with groovy to use maven 3.0 in Hudson

Wed, 12/15/2010 - 15:18
As you are an early adopter and want to try the maven3 native support branch in hudson.
See previous blog entry Maven 3 support in Hudson Maven Plugin
If you have a maven installation called maven-3.0, just run the simple groovy script in your console :

prjs = hudson.model.Hudson.getInstance().getItems( hudson.maven.MavenModuleSet.class );
prjs.each{module -> println(module.maven= "maven-3.0")}

And that's it all your maven native plugin hudson jobs will use your maven installation called maven-3.0 .


Categories: Olivier Lamy

Maven 3 support in Hudson Maven Plugin

Mon, 12/13/2010 - 23:39
You have developped hudson plugins using the maven-plugin or you are an early adopter user : so this blog entry is for you !

Some stuff has been done in a branch called main-maven3-support [1] in github to support maven 3 in the Hudson native maven plugin.
The plugin now supports both maven 2 and maven 3.
Note the pom parsing to detect modules now use the maven 3 apis. (ProjectBuilder maven component [2])
You don't have something to install (just choose the maven version for your maven build) the plugin will detect which maven version is used for the maven build and use differents implementation to "listen" the build.

To test it, you can build it .
First build the embedder (note this will move to github soon)

svn co https://svn.java.net/svn/hudson~svn/trunk/hudson/lib/hudson-maven-embedder
cd hudson-maven-embedder
mvn clean install -DskipTests

Then build hudson from the branch

git clone https://github.com/hudson/hudson.git
git checkout main-maven3-support
mvn clean install -DskipTests

And hudson.war is in war/target/hudson.war

I have pushed builds here : http://olamy.googlecode.com/files/hudson.war

Currently : maven2 build on master node doesn't work (under work !)

We need you for more testing and nice feedback (before merging this to master)

You can follow what's happened in the dedicated jira entry : http://issues.hudson-ci.org/browse/HUDSON-4988

Have Fun !
--
Olivier

[1] https://github.com/hudson/hudson/commits/main-maven3-support
[2] http://maven.apache.org/ref/3.0.1/maven-core/apidocs/org/apache/maven/project/ProjectBuilder.html


Categories: Olivier Lamy

Gwt Maven Plugin 2.1.0-1 Released

Mon, 12/06/2010 - 21:31
The Gwt Maven Plugin 2.1.0-1 has been released.

38 issues has been fixed (full changelog).

New features :

* AppEngine Launch
* Css Interface Generator
* More Gwt compiler options : -compileReport, -optimize, -XsoycDetailed, -strict (see the mojo Compile Mojo)
* Compiler Report
* @RemoteServiceRelativePath annotation processing

To use it :

<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
<version>2.1.0-1</version>
</plugin>


Web Site : http://mojo.codehaus.org/gwt-maven-plugin/

Have Fun !
--
Olivier


Categories: Olivier Lamy

Gwt Maven Plugin 2.1.0-1 Staged

Fri, 12/03/2010 - 16:19
Yeah ! The Gwt Maven Plugin 2.1.0-1 has been staged (and release vote started [1] )

Release Notes : http://jira.codehaus.org/secure/ReleaseNote.jspa?projectId=11860&version=16878

Staging repo : https://nexus.codehaus.org/content/repositories/orgcodehausmojo-047/

Documentation site : http://mojo.codehaus.org/gwt-maven-plugin

What's new in this release : http://mojo.codehaus.org/gwt-maven-plugin/whats_new.html

If you have any trouble please load an issue in jira : http://jira.codehaus.org/browse/MGWT .

Have Fun and push a +1 !

[1] http://goo.gl/DeJue


Categories: Olivier Lamy

Pages