Plugins (1083)


Training and Consulting (44)



EPIC Poll

What is your favourite developer portal?

[ Results | Polls ]

Votes: 540
Comments: 0

Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Author Message
gugarthur
1 Post subject: Ant to Maven  PostPosted: Dec 06, 2007 - 02:33 PM



Joined: Dec 06, 2007
Posts: 1

I would like to know how can I transform the ant code below to a Maven code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="ac" default="help" basedir=".">

<description>
*******************************************************************
* AC application build script
*******************************************************************
</description>

<property environment="theEnv"/>
<property name="appserv.home" value="${theEnv.JBOSS_HOME}"/>
<property file="build.properties"/>

<target name="help">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<echo message="usage: ant -projecthelp"/>
</target>


<target name="value">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/value" debug="on">
<classpath path="${project.class.path}"/>
</javac>
</target>
<target name="aux">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src" debug="on">
<classpath path="${project.class.path}"/>
</javac>
</target>

<target name="compile">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<copy todir="${binary.dir}">
<fileset dir="properties" includes="**"/>
</copy>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src" debug="on">
<classpath path="${project.class.path}"/>
</javac>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/exception" debug="on">
<classpath path="${project.class.path}"/>
</javac>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/value" excludes="*Comparator*.java" debug="on">
<classpath path="${project.class.path}"/>
</javac>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/ejb/interfaces/remote" excludes="ACServicesSL*.java" debug="on">
<classpath path="${project.class.path}"/>
</javac>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/value" includes="*Comparator*.java" debug="on">
<classpath path="${project.class.path}"/>
</javac>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/ejb/interfaces/remote" includes="ACServicesSL*.java" debug="on">
<classpath path="${project.class.path}"/>
</javac>
<javac deprecation="on" destdir="${binary.dir}" srcdir="src/br/com/saiph/ac/ejb/beans" debug="on">
<classpath path="${project.class.path}"/>
</javac>
</target>

<target name="archive">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<jar jarfile="${deploy.dir}/ac.jar">
<fileset dir="src" includes="META-INF/**"/>
<fileset dir="src" includes="br/com/saiph/ac/ApplicationResources.properties"/>
<fileset dir="${binary.dir}" includes="br/**"/>
</jar>
<jar jarfile="${deploy.dir}/ac-client.jar">
<fileset dir="${binary.dir}" includes="br/com/saiph/ac/exception/**"/>
<fileset dir="${binary.dir}" includes="br/com/saiph/ac/value/**"/>
<fileset dir="${binary.dir}" includes="br/com/saiph/ac/ejb/interfaces/remote/**"/>
</jar>
</target>

<target name="build" description="build all">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<antcall target="compile"/>
<antcall target="archive"/>
</target>

<target name="deploy" description="install all binary files">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<copy file="${deploy.dir}/ac.jar" todir="${appserv.home}/server/default/deploy"/>
</target>

<target name="all" description="build all and deploy all">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<antcall target="build"/>
<antcall target="${deploy.dir}"/>
</target>

<target name="indent" description="indent all source, (read-only)">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<fail message="convention required, use: ant -Dconvention=convention.xml indent" unless="convention"/>
<delete dir="preview"/>
<taskdef name="jalopy" classname="de.hunsicker.jalopy.plugin.ant.AntPlugin">
<classpath>
<fileset dir="lib/jalopy">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<jalopy destdir="preview" convention="${convention}" classpathref="${project.class.path}">
<fileset dir="src">
<include name="**/*.java"/>
</fileset>
</jalopy>
</target>

<target name="scrub" description="scrub all source, (read-only)">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<delete dir="preview"/>
<copy todir="preview">
<fileset dir="src">
<include name="**/*.java"/>
</fileset>
</copy>
<taskdef name="scrub" classname="ImportNormalizerTask">
<classpath>
<fileset dir="lib/importscrubber">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<scrub root="preview" classRoot="${binary.dir}" format="nobreaks" recurse="true"/>
</target>

<target name="save" description="save source changes made by indent or scrub, (overwrite)">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<copy todir="src">
<fileset dir="preview"/>
</copy>
<delete dir="preview"/>
</target>

<target name="doc" description="generate javadoc">
<mkdir dir="${binary.dir}"/>
<mkdir dir="${deploy.dir}"/>
<delete dir="docs/javadocs"/>
<mkdir dir="docs/javadocs"/>
<javadoc destdir="docs/javadocs" sourcepath="src" packagenames="br.com.saiph.ac.exception,br.com.saiph.ac.value,br.com.saiph.ac.ejb.interfaces.remote,br.com.saiph.ac.ejb.beans">
<classpath path="${project.class.path}"/>
</javadoc>
</target>

<target name="clean" description="clean all output files">
<delete dir="${binary.dir}"/>
<delete dir="${deploy.dir}"/>
<delete dir="docs/javadocs"/>
</target>

<target name="test" description="Runs Junit's tests">

<mkdir dir="${binary.dir}"/>

<javac destdir="${binary.dir}" debug="on" deprecation="on">
<src path="src/${test.dir}"/>
<classpath path="${project.class.path}"/>
</javac>

<copy todir="${binary.dir}">
<fileset dir="properties" includes="**"/>
</copy>

<junit printsummary="yes" haltonfailure="no" haltonerror="no">
<jvmarg value="-Djava.naming.factory.initial=org.jnp.interfaces.NamingContextFactory"/>
<jvmarg value="-Djava.naming.provider.url=localhost:1098"/>
<classpath path="${project.class.path}"/>

<formatter type="plain" usefile="false"/>

<batchtest fork="yes">
<fileset dir="${binary.dir}">
<include name="${junit.test.set}"/>
<exclude name="${test.dir}/Base*.class"/>
</fileset>
</batchtest>
</junit>
</target>

<!-- ===============================================================
targets db-create and db-drop are used by the installer
=============================================================== -->
<property name="db.delimiter" value=";;"/>
<property name="db.user" value="DAFFODIL"/>
<property name="db.password" value="daffodil"/>
<property name="db.database" value="accesscontrol"/>
<property name="db.create" location="docs/SaiphACcreate_ant.SQL"/>
<property name="db.insert" location="docs/SaiphACinsert_ant.SQL"/>
<property name="db.drop" location="docs/SaiphACdrop_ant.SQL"/>
<property name="db.driver" value="in.co.daffodil.db.jdbc.DaffodilDBDriver"/>

<property name="db.url" value="jdbc:daffodilDB_embedded:${db.database};create=true;INITIALFILESIZE=6;INCREMENTFACTOR=12;path=${db.root}/acdb"/>

<target name="db-create" description="Create database tables and populate database.">
<sql driver="${db.driver}" url="${db.url}" userid="${db.user}"
password="${db.password}" delimiter="${db.delimiter}"
autocommit="true" onerror="abort" delimitertype="normal">
<classpath refid="db.classpath" />
<transaction src="${db.create}"/>
<transaction src="${db.insert}"/>
</sql>
</target>

<target name="db-drop" description="Drop schema AC">
<sql driver="${db.driver}" url="${db.url}" userid="${db.user}"
password="${db.password}" delimiter="${db.delimiter}"
autocommit="true" onerror="continue">
<classpath refid="db.classpath"/>
<transaction src="${db.drop}"/>
</sql>
</target>
</project>
 
 View user's profile Send private message  
Reply with quote Back to top
Display posts from previous:     
Jump to:  
All times are GMT - 6 Hours
Post new topic   Reply to topic
View previous topic Printable version Log in to check your private messages View next topic
Powered by PNphpBB2 © 2003-2004 The PNphpBB Group
Credits