[gatein-dev] Tomcat build

Dimitri dbaeli at gmail.com
Tue Oct 26 02:37:41 EDT 2010


Great news !

Dimitri BAELI
VP Quality -- eXo Platform

Le 26 oct. 2010 à 07:09, Julien Viet <julien at julienviet.com> a écrit :

> the new build coupled with Maven 3 parallel build activated shows  
> significant improvement when building GateIn.
>
> Maven 2
> mvn -o -Dmaven.test.skip=true -Ppkg-tomcat-legacy package
> [INFO] Total time: 3 minutes 1 second
>
> Maven 3
> mvn -o -T 4 -Ppkg-tomcat -Dmaven.test.skip=true package
> [INFO] Total time: 2:03.338s (Wall Clock)
>
> note that I disabled unit tests as I don't know how they would  
> behave in parallel build.
>
> On Oct 26, 2010, at 5:34 AM, Julien Viet wrote:
>
>> we are now able to build the Tomcat package with a build 100% based  
>> on Maven (and a bit of Ant) with the following benefits:
>>
>> - packaging is slightly faster (15s instead of 25s on my machine)
>> - the build can be executed fully by Maven 3 (although it warns a  
>> bit on some stuff that he does not like)
>> - a more lightweight build (67m instead of 74m according to Arnaud).
>>
>> This is based on the initial work provided by Martin Podolski, some  
>> ideas borrowed from Dimitri, useful help from Arnaud.
>>
>> The list of dependencies is now fully declared in a pom (which  
>> takes version from the parent pom and add some version for runtime  
>> specific libraries, we will see how to properly address that later  
>> with Thomas).
>>
>> Initially I used the assembly plugin as done initially by Martin  
>> but this has no-go flaws:
>>
>> - major drain to productivity: 2 minutes to assemble the Tomcat  
>> version. (exobuild was 25s)
>> - no real control over the libraries we want in /libs
>> - plugin version quirks 2.1 / 2.2beta / 2.2 have differences
>>
>> So I went for an Ant solution that is better, it uses several trick  
>> to assemble the /libs and /webapps.
>>
>> First of all it uses XSLT to transform the initial pom.xml into an  
>> Ant script (code generation basically), for instance:
>>
>>   <dependency>
>>     <groupId>org.slf4j</groupId>
>>     <artifactId>slf4j-api</artifactId>
>>   </dependency>
>>
>> becomes
>>
>> <copy todir="target/tomcat/lib">
>> <fileset refid="org.slf4j:slf4j-api:jar"/>
>> </copy>
>>
>> which means that we copy exactly what we want.
>>
>> The second trick is to use XSLT processing instructions to define  
>> metadata for the Ant script, in our case for now the main usage is  
>> the renaming of the war file so a dependency like:
>>
>>   <dependency>
>>     <?rename portal.war?>
>>     <groupId>org.exoplatform.portal</groupId>
>>     <artifactId>exo.portal.web.portal</artifactId>
>>     <type>war</type>
>>   </dependency>
>>
>> becomes
>>
>> <copy tofile="target/tomcat/webapps/portal.war">
>> <fileset refid="org.exoplatform.portal:exo.portal.web.portal:war"/>
>> </copy>
>>
>> The activation is exactly the same as before, the -Ppkg-tomcat is  
>> used and replace the previous one. However I understand it may  
>> cause unexpected issues so there will be a transition where you can  
>> still use the previous packaging with -Ppkg-tomcat-legacy.
>>
>> The new packaging now is in the folder packaging/tomcat and the  
>> generated tomcat is in packaging/tomcat/pkg/target/tomcat .
>>
>> cheers
>>
>> Julien
>
>
> _______________________________________________
> gatein-dev mailing list
> gatein-dev at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/gatein-dev



More information about the gatein-dev mailing list