You're insane ;)
How much work for the jbossas packaging ?
On 10/26/2010 05: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(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/gatein-dev