Saturday 26 November 2011

From a pull request to a jira issue

After the generate a patch and attach it to a jira issue, it's now the time to have a tool to create an issue from a patch request (the current implementation works only for github pull request).

So the Patch Tracker plugin has now a new goal called to-issue. This goal will read a github pull request and create an issue in your issue tracker (currently only supported for jira).

It's simple :-).
As sample see pull request : https://github.com/jenkinsci/jenkins/pull/320 and the created issue in jira: https://issues.jenkins-ci.org/browse/JENKINS-11883
I have just used the cli:

mvn patch-tracker:to-issue -Dpatch.request.id=320 -B

For easy configuration see the properties in the jenkins pom.

<project.patchManagement.system>github</project.patchManagement.system>
<patch.request.organisation>jenkinsci</patch.request.organisation>
<patch.request.repository>jenkins</patch.request.repository>
<project.patchManagement.url>https://api.github.com</project.patchManagement.url>

<patch.tracker.serverId>jenkins-jira</patch.tracker.serverId>


entry in settings:

<server>
<id>jenkins-jira</id>
<username>uid</username>
<password>password</password>
</server>


And that's it :-).

BTW if you need more features, patch (or pull requests) are welcome.

This maven plugin is in the maven sandbox @asf and not released, so if you want to try it you must have asf maven snapshot repo in your settings or buid it manually.
Sources are here:

  • https://github.com/apache/maven-sandbox (path plugins/maven-patch-tracker-plugin) yup no sparse checkout with git :P

  • http://svn.apache.org/repos/asf/maven/sandbox/trunk/plugins/maven-patch-tracker-plugin/



Some docs has been started here http://maven.apache.org/plugins/maven-patch-tracker-plugin (maybe not yet in sync so wait a bit)

Have fun !

Monday 21 November 2011

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

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!

Wednesday 26 October 2011

Archiva 1.4-M1 released

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.

Friday 21 October 2011

Apache Tomcat Maven Plugin Features

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.

Sunday 9 October 2011

Tomcat Maven Plugin now supports tomcat7

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.

Monday 3 October 2011

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

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

Thursday 29 September 2011

Apache Maven Wagon 2.0 released

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.

Saturday 17 September 2011

Maven Download time Improvement

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.

Thursday 8 September 2011

Tomcat Maven Plugin New Home at Apache Software Foundation

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.

Sunday 4 September 2011

Maven Archetype Plugin 2.1 very useful feature

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.

Friday 17 June 2011

Selenium Maven Plugin upgrade to Selenium Server 2.x

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.

Wednesday 13 April 2011

Deploying in cloudbees @RUN with a Jenkins Plugin

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 ! :-)

Friday 25 March 2011

Maven buildnumber plugin will support other scm : git mercurial

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

Thursday 24 February 2011

Maven Surefire executing only one test method in a test class

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

Wednesday 2 February 2011

Sonar Instance @ASF

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 !