xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<!-- ============== -->
<!-- Identification -->
<!-- ============== -->
<groupId>net.enwoo</groupId>
<artifactId>bandeau_extension</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>uneAppli</name>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-antrun-plugin</artifactId>
<dependencies>
<dependency>
<groupId>ant</groupId>
<artifactId>ant-jsch</artifactId>
<version>1.6.5</version>
</dependency>
<dependency>
<groupId>jsch</groupId>
<artifactId>jsch</artifactId>
<version>0.1.25</version>
</dependency>
</dependencies>
<executions>
<execution>
<id>bandeau_extension</id>
<phase>package</phase>
<configuration>
<tasks>
<ant antfile="${basedir}/build.xml">
<target name="deploy" />
</ant>
</tasks>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
taches ANT de zip
<?xml version="1.0"?>
<project default="deploy" basedir=".">
<property name="zipDir" location="${basedir}\zip" />
<property name="user" value="monUser" />
<property name="password" value="*******" />
<!-- =================================
target: deploy
================================= -->
<target name="deploy" depends="zip" description="copie sur la bastion les zip">
<echo>debut transfert</echo>
<echo>${user}:${password}@uneMachineServeur:/home/${user}</echo>
<scp todir="${user}@uneMachineServeur:/home/${user}/MEP" failonerror="true" verbose="true" trust="true" password="${password}">
<fileset dir="${zipDir}">
<include name="**/*.zip" />
<include name="**/*.sh" />
</fileset>
</scp>
<echo>fin transfert</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: zip
- - - - - - - - - - - - - - - - - -->
<target name="zip" depends="clean,compressor, gestionVersion, zipWEB, zipMiddle">
<echo>fin packaging</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: clean
- - - - - - - - - - - - - - - - - -->
<target name="clean">
<echo>nettoyage [${zipDir}]</echo>
<delete includeemptydirs="true">
<fileset dir="${zipDir}" includes="**/*.zip" />
</delete>
<delete verbose="true">
<fileset dir="${basedir}/src/main/webapp/js/csr">
<include name="Services*.js" />
</fileset>
</delete>
<delete verbose="true">
<fileset dir="${basedir}/tmp">
<include name="**/*.js" />
</fileset>
</delete>
<echo>fin nettoyage [${zipDir}]</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: zipWEB
- - - - - - - - - - - - - - - - - -->
<target name="zipWEB">
<echo>creation du zip pour le web</echo>
<zip destfile="${zipDir}/WEBS.zip" basedir="${basedir}/src/main/webapp" />
<echo>fin creation du zip pour le web</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: zipMiddle
- - - - - - - - - - - - - - - - - -->
<target name="zipMiddle">
<echo>creation du zip pour les patchs sous forme de classes</echo>
<zip destfile="${zipDir}/middlePatch.zip" basedir="${basedir}/middle/classes" />
<echo>fin creation du zip pour les patchs sous forme de classes</echo>
</target>
<!-- - - - - - - - - - - - - - - - - -
target: compressor
- - - - - - - - - - - - - - - - - -->
<target name="compressor">
<ant antfile="compressor.xml" target="doCompress" />
</target>
<!-- - - - - - - - - - - - - - - - - -
target: gestionVersion
- - - - - - - - - - - - - - - - - -->
<target name="gestionVersion">
<tstamp>
<format property="buildDate" pattern="yyyyMMdd_HHmmss_SS" />
</tstamp>
<copy tofile="${basedir}/src/main/webapp/wacd/defaults/csr/Bandeau_CSR.html" file="${basedir}/src/main/webapp/wacd/defaults/csr/Bandeau_CSR_template.html" overwrite="true" verbose="true"/>
<replace file="${basedir}/src/main/webapp/wacd/defaults/csr/Bandeau_CSR.html" value="${buildDate}" summary="true">
<replacetoken>@version_build@</replacetoken>
</replace>
<copy tofile="${basedir}/src/main/webapp/js/csr/Services.js" file="${basedir}/tmp/min/Services.js" verbose="true"/>
<move tofile="${basedir}/src/main/webapp/js/csr/Services_${buildDate}.js" file="${basedir}/src/main/webapp/js/csr/Services.js" verbose="true"/>
</target>
</project>
taches de minimisation du JS par YUICompressor
<?xml version="1.0"?>
<project default="doCompress" basedir=".">
<property name="jsDir" location="${basedir}/src/main/webapp/js/csr" />
<property name="tmpDir" location="${basedir}/tmp" />
<property name="concatDir" location="${tmpDir}/concat" />
<property name="minDir" location="${tmpDir}/min" />
<!-- =================================
target: compression
================================= -->
<target name="doCompress" depends="doConcat" description="Compresse le js concatene">
<echo>Compression</echo>
<taskdef name="yuicompress" classname="com.yahoo.platform.yui.compressor.YUICompressTask">
<classpath>
<pathelement path="${basedir}/lib/YUIAnt.jar" />
<pathelement path="${basedir}/lib/yuicompressor-2.4.7.jar" />
<pathelement path="${basedir}/lib/rhino-1.6R7.jar" />
</classpath>
</taskdef>
<delete includeemptydirs="true">
<fileset dir="${minDir}" includes="Services.js"/>
</delete>
<yuicompress warn="false" munge="yes" preserveallsemicolons="true" outputfolder="${minDir}" >
<fileset dir="${concatDir}" >
<include name="**/Services.js" />
</fileset>
</yuicompress>
<echo>fin compression</echo>
</target>
<!-- =================================
target: concatenation
================================= -->
<target name="doConcat" description="Concatene les js">
<echo>Concatenation</echo>
<delete includeemptydirs="true">
<fileset dir="${concatDir}" includes="Services.js"/>
</delete>
<concat destfile="${concatDir}/Services.js" force="no">
<filelist dir="${jsDir}" files="Services.js,myload.js"/>
</concat>
<echo>Fin concatenation</echo>
</target>
</project>