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.