667514 members! Sign up to stay informed.

Sponsored Links


Resources

Enterprise Java
Research Library

Get Java white papers, product information, case studies and webcasts

News News News Messages: 18 Messages: 18 Messages: 18 Printer friendly Printer friendly Printer friendly Post reply Post reply Post reply XML XML XML

Fully Automate Build & Deployment using Ant

Posted by: Ludwin Barbin on September 18, 2009 DIGG
The technologies involved Ant, CVS, and WebSphere.

The scenario is you run the scripts from your pc client and it will do the build in your pc, distribute the artifacts to a remote Unix environment, deploy the artifacts in Unix, and install the war application in WebSphere. You can optionally backout the entire installation.

This is a complete working set of scripts. You can copy/paste the scripts literally or modify the application via properties to suit your needs.

The following files are used:
1. main.xml
2. build.xml
3. dist.xml
4. deploy.xml
5. install.xml
6. project.properties
7. deploy.properties

To execute, the first and the only step is:

ant -buildfile main.xml

The following shows the complete listing of the files:

=======================================================
main.xml
=======================================================
<?xml version="1.0"?>

<!-- Ludwin Barbin 2009-07-24 -->

<project name="Main" default="main">
<tstamp/>

<property file="project.properties"/>
<property file="deploy.properties"/>

<!-- Main delegator -->
<target name="main" depends="build, full.deploy"/>

<!-- Build application -->
<target name="build">
<ant antfile="build.xml" target="build"/>
</target>

<!-- Full deploy application -->
<target name="full.deploy" depends="dist, backup, deploy, install, cleanup"/>

<!-- Distribute Files -->
<target name="dist" depends="dist.web, dist.was"/>
<target name="dist.web">
<ant antfile="dist.xml" target="dist.web"/>
</target>
<target name="dist.was">
<ant antfile="dist.xml" target="dist.was"/>
</target>

<!-- Backup Files -->
<target name="backup" depends="backup.web, backup.was"/>
<target name="backup.web">
<sshexec host="${web.host}" username="${web.userId}" password="${web.password}" command="${web.ant.deploy} backup.web" trust="true"/>
</target>
<target name="backup.was">
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="${was.ant.deploy} backup.was" trust="true"/>
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="${was.ant.install} export.app" trust="true" />
</target>

<!-- Deploy Files -->
<target name="deploy" depends="deploy.web, deploy.was"/>
<target name="deploy.web">
<sshexec host="${web.host}" username="${web.userId}" password="${web.password}" command="${web.ant.deploy} deploy.web" trust="true"/>
</target>
<target name="deploy.was">
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="${was.ant.deploy} deploy.was" trust="true"/>
</target>

<!-- Install application to WebSphere -->
<target name="install">
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="${was.ant.install} install" trust="true" />
</target>

<!-- Cleanup Files -->
<target name="cleanup" depends="clean.unix, clean.loc" />
<target name="clean.unix">
<sshexec host="${web.host}" username="${web.userId}" password="${web.password}" command="rm -rf ${web.tmp.dir}" trust="true"/>
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="rm -rf ${was.tmp.dir}" trust="true"/>
</target>
<target name="clean.loc">
<delete dir="${src.dir}"/>
<delete dir="${classes.dir}"/>
<delete dir="${build.dir}"/>
</target>

<!-- Backout Files if deployment fails -->
<target name="backout" depends="backout.web, backout.was"/>
<target name="backout.web">
<sshexec host="${web.host}" username="${web.userId}" password="${web.password}" command="${web.ant.deploy} backout.web" trust="true"/>
</target>
<target name="backout.was">
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="${was.ant.deploy} backout.was" trust="true"/>
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" command="${was.ant.install} backout" trust="true" />
</target>

</project>
==========================================================
build.xml
==========================================================
<?xml version="1.0"?>

<!-- Ludwin Barbin 2009-07-24 -->

<project name="Build" default="build">
<tstamp/>

<property file="project.properties"/>

<path id="app.classpath">
<fileset dir="${lib.dir}"/>
<fileset dir="${web.dir}/WEB-INF/lib"/>
<dirset dir="${classes.dir}"/>
</path>

<!-- call the build steps -->
<target name="build" depends="clean, checkout, compile, package"/>

<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${src.dir}"/>
<delete dir="${classes.dir}"/>

<mkdir dir="${build.dir}"/>
<mkdir dir="${src.dir}"/>
<mkdir dir="${classes.dir}"/>
</target>

<target name="checkout">
<cvs cvsRoot="${cvs.root}" package="${main.project}" dest="${src.dir}" reallyquiet="true" failonerror="true"/>
</target>

<target name="compile">
<javac srcdir ="${src.dir}/${main.project}" destdir ="${classes.dir}" classpathref="app.classpath"/>
</target>

<target name="package">

<!-- package war file -->
<war destfile="${build.dir}/${app.war}" webxml="${web.dir}/WEB-INF/web.xml">
<classes dir="${classes.dir}"/>
<fileset dir="${web.dir}"/>
</war>

<!-- package web files -->
<tar destfile="${build.dir}/${app.web.tar}">
<tarfileset dir="${web.root.dir}" />
</tar>

<!-- package was files -->
<tar destfile="${build.dir}/${app.was.tar}">
<tarfileset dir="${was.root.dir}"/>
</tar>
</target>

</project>
=======================================================
dist.xml
=======================================================
<?xml version="1.0"?>

<!-- Ludwin Barbin 2009-07-24 -->

<project name="Distribute">
<tstamp/>

<property file="project.properties"/>
<property file="deploy.properties"/>

<target name="dist.web">

<!-- create temp directory for distribution -->
<sshexec host="${web.host}" username="${web.userId}" password="${web.password}" trust="true"
command="rm -rf ${web.tmp.dir}; mkdir ${web.tmp.dir}"/>

<scp todir="${web.userId}:${web.password}@${web.host}:${web.tmp.dir}" trust="true">
<fileset dir="${build.dir}">
<include name="${app.web.tar}"/>
</fileset>
<fileset dir="${basedir}">
<include name="deploy.xml"/>
<include name="project.properties"/>
<include name="deploy.properties"/>
</fileset>
</scp>
</target>

<target name="dist.was">

<!-- create temp directory for distribution -->
<sshexec host="${was.host}" username="${was.userId}" password="${was.password}" trust="true"
command="rm -rf ${was.tmp.dir}; mkdir ${was.tmp.dir}"/>

<scp todir="${was.userId}:${was.password}@${was.host}:${was.tmp.dir}" trust="true" >
<fileset dir="${build.dir}">
<include name="${app.war}"/>
<include name="${app.was.tar}"/>
</fileset>
<fileset dir="${basedir}">
<include name="deploy.xml"/>
<include name="install.xml"/>
<include name="project.properties"/>
<include name="deploy.properties"/>
</fileset>
</scp>
</target>

</project>
=========================================================
deploy.xml
=========================================================
<?xml version="1.0"?>

<!-- Ludwin Barbin 2009-07-24 -->

<project name="Deploy">
<tstamp/>

<property file="project.properties"/>
<property file="deploy.properties"/>

<target name="backup.web">
<tar basedir="${web.app.dir}" destfile="${web.archive.dir}/${app.web.bkup.tar}" />
</target>

<target name="backup.was">
<tar basedir="${was.app.dir}" destfile="${was.archive.dir}/${app.was.bkup.tar}" />
</target>

<target name="deploy.web" depends="clean.web">
<untar src="${basedir}/${app.web.tar}" dest="${web.app.dir}"/>
</target>

<target name="deploy.was" depends="clean.was">
<untar src="${basedir}/${app.was.tar}" dest="${was.app.dir}"/>
</target>

<target name="backout.web" depends="clean.web">
<untar src="${web.archive.dir}/${app.web.bkup.tar}" dest="${web.app.dir}"/>
</target>

<target name="backout.was" depends="clean.was">
<untar src="${was.archive.dir}/${app.was.bkup.tar}" dest="${was.app.dir}"/>
</target>

<target name="clean.web">
<delete includeemptydirs="true"> <fileset dir="${web.app.dir}" includes="**/*"/> </delete>
</target>

<target name="clean.was">
<delete includeemptydirs="true"> <fileset dir="${was.app.dir}" includes="**/*"/> </delete>
</target>

</project>
==========================================================
install.xml
==========================================================
<?xml version="1.0"?>

<!-- Ludwin Barbin 2009-07-24 -->

<project name="Install" >
<tstamp/>

<property file="project.properties"/>
<property file="deploy.properties"/>

<!-- WebSphere tasks -->
<taskdef name="wsadmin" classname="com.ibm.websphere.ant.tasks.WsAdmin"/>
<taskdef name="wsStopServer" classname="com.ibm.websphere.ant.tasks.StopServer"/>
<taskdef name="wsStartServer" classname="com.ibm.websphere.ant.tasks.StartServer"/>
<taskdef name="wsStopApp" classname="com.ibm.websphere.ant.tasks.StopApplication"/>
<taskdef name="wsStartApp" classname="com.ibm.websphere.ant.tasks.StartApplication"/>
<taskdef name="wsUninstallApp" classname="com.ibm.websphere.ant.tasks.UninstallApplication"/>
<taskdef name="wsInstallApp" classname="com.ibm.websphere.ant.tasks.InstallApplication"/>

<!-- delegator -->
<target name="install" depends="stop.server, uninstall.app, install.app, start.server" />

<target name="stop.server"> <wsadmin command="$AdminControl stopServer ${was.server} ${was.node}"/> </target>
<target name="start.server"><wsadmin command="$AdminControl startServer ${was.server} ${was.node}" failonerror="true"/> </target>

<target name="start.app"> <wsStartApp server="${was.server}" application="${app.name}" failonerror="true"/> </target>
<target name="stop.app"> <wsStopApp server="${was.server}" application="${app.name}"/> </target>

<target name="install.app"> <wsInstallApp ear="${was.tmp.dir}/${app.war}" options="{${was.install.options}}" failonerror="true"/> </target>
<target name="uninstall.app"> <wsUninstallApp application="${app.name}"/> </target>

<target name="export.app">
<wsadmin command="$AdminApp export ${app.name} ${was.archive.dir}/${app.bkup.ear}" failonerror="true"/>
</target>

<target name="backout" depends="stop.server, uninstall.app, reinstall.app, start.server" />

<target name="reinstall.app"> <wsInstallApp ear="${was.archive.dir}/${app.bkup.ear}" options="{${was.install.options}}" failonerror="true"/> </target>

</project>
-------------------------------------------------------
project.properties
-------------------------------------------------------
# Ludwin Barbin 2009-07-24

# === CVS properties ================================

main.project =myproject
cvs.root =:pserver:anonymous:anonymous@my.cvs.com:/myrepository

# === directories ==================================

lib.dir =${basedir}/lib
src.dir =${basedir}/src
classes.dir =${basedir}/classes
build.dir =${basedir}/build
web.dir =${src.dir}/${main.project}/WebContent
web.root.dir =${src.dir}/${main.project}/web_root
was.root.dir =${src.dir}/${main.project}/was_root

# === archive filenames ===============================

app.war =app.war
app.web.tar =app-web.tar
app.was.tar =app-was.tar

app.web.bkup.tar =app-web-bkup-${DSTAMP}.tar
app.was.bkup.tar =app-was-bkup-${DSTAMP}.tar
app.bkup.ear =app-bkup-${DSTAMP}.ear

-------------------------------------------------------
deploy.properties
-------------------------------------------------------
# Ludwin Barbin 2009-07-24

# ============= UNIX directories =================

# In Web
web.app.dir =/apps/myapp
web.archive.dir =/apps/myapp-archive
web.tmp.dir =${web.archive.dir}/tmp

# In WAS
was.app.dir =/apps/myapp
was.archive.dir =/apps/myapp-archive
was.tmp.dir =${was.archive.dir}/tmp

was.bin.dir =/apps/WebSphere/bin

# ============= Login properties =================

web.host =mywebhost
web.userId =webid
web.password =web123

was.host =mywashost
was.userId =wasid
was.password =was123

# ============= Ant execution properties =================

web.ant.deploy =ant -buildfile ${web.tmp.dir}/deploy.xml
was.ant.deploy =ant -buildfile ${was.tmp.dir}/deploy.xml
was.ant.install =sudo -s ${was.bin.dir}/ws_ant.sh -buildfile ${was.tmp.dir}/install.xml

web.ant.version =ant -version
was.ant.version =ant -version
was.wsant.version =${was.bin.dir}/ws_ant.sh -version

# === WebSphere server properties ===============================

was.cell =mywascell
was.node =mywasnode
was.server =mywasserver

# ================ Installation options properties ========================

app.name =myapp
context.root =/myapp

was.install.options =-cell ${was.cell} -node ${was.node} -server ${was.server} -contextroot ${context.root} -appname ${app.name}

-- End of files --

Feel free to use the code in your project. This is especially useful in Development environment where a quick deployment is essential.

The benefits of having an automated build & deployment is very applicable when using Agile development. It allows you quickly see your changes, get feedback, and adapt accordingly.

If you have a way of improving the code, let me know. I am not an expert in Ant but I've used the above scripts in my projects and it helped our development team a lot.

Threaded replies

·  Fully Automate Build & Deployment using Ant by Ludwin Barbin on Fri Sep 18 08:16:51 EDT 2009
  ·  Step back into the time we recorded c64 programs from radio by Marc de Kwant on Fri Sep 18 09:47:23 EDT 2009
    ·  Says... by Erik Larsson on Fri Sep 18 10:19:26 EDT 2009
      ·  Re: Says... by Anoop Kumar on Fri Sep 18 12:00:04 EDT 2009
        ·  Re: Says... by andy fakename on Fri Sep 18 13:51:18 EDT 2009
        ·  Re: Says... by Tomi Tuomainen on Sat Sep 19 04:15:06 EDT 2009
          ·  Re: Says... by Marc de Kwant on Mon Sep 21 03:22:31 EDT 2009
            ·  Re: Says... by Tomi Tuomainen on Mon Sep 21 04:42:06 EDT 2009
            ·  Currently using maven+ant is most satisfactory for us by Dmitry Zemnitskiy on Mon Sep 21 04:56:51 EDT 2009
    ·  Entropy kills.... by Karl Banke on Sat Sep 19 09:12:32 EDT 2009
      ·  Re: Entropy kills.... by Marc de Kwant on Mon Sep 21 03:14:03 EDT 2009
        ·  Re: Entropy kills.... by Erik Larsson on Mon Sep 21 05:13:09 EDT 2009
          ·  Re: Entropy kills.... by Grzegorz Grzybek on Mon Sep 21 05:40:01 EDT 2009
            ·  Re: by Erik Larsson on Mon Sep 21 06:14:48 EDT 2009
        ·  Re: Entropy kills.... by Saulius Sinkunas on Tue Sep 22 16:43:00 EDT 2009
    ·  correct by alan buchanan on Thu Nov 05 11:38:31 EST 2009
  ·  Re: Fully Automate Build & Deployment using Ant by Phil Swenson on Sat Sep 19 19:24:03 EDT 2009
    ·  Re: Fully Automate Build & Deployment using Ant by David Palmer on Sun Sep 20 21:18:32 EDT 2009
    ·  The best build system by Mark Muster on Tue Sep 22 07:58:52 EDT 2009
  Message #322230 Post reply Post reply Post reply Go to top Go to top Go to top

Step back into the time we recorded c64 programs from radio

Posted by: Marc de Kwant on September 18, 2009 in response to Message #322135
It is nice to see that someone lists a piece of code, that we all coded about 5-10 years ago before modern lifecycle tools were available.

Maybe a look at something like maven (I am talking about lifecycle management and not dependency management ) would be advisable.

Ant is somewhat outdated nowadays in this usage pattern.

  Message #322232 Post reply Post reply Post reply Go to top Go to top Go to top

Says...

Posted by: Erik Larsson on September 18, 2009 in response to Message #322230
...someone who is using a build system that in any other community than the Java one would cause a reaction along the lines of "what the hell is this?"

Maven is possibly the worst piece of software I've ever had the non-pleasure of using. Two full years I had to endure the pain. The horror...

  Message #322236 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Says...

Posted by: Anoop Kumar on September 18, 2009 in response to Message #322232
...someone who is using a build system that in any other community than the Java one would cause a reaction along the lines of "what the hell is this?"

Maven is possibly the worst piece of software I've ever had the non-pleasure of using. Two full years I had to endure the pain. The horror...


I am in the java community and I did initially just say that.

While it is nice to see the entire code, but this brings back memories of having an entire application in one file or just one do-all class.

Apart from tools like maven, we should be looking at CI tools, Cruise Control, Continuum, Hudson, TeamMate etc can help a lot in this.

  Message #322240 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Says...

Posted by: andy fakename on September 18, 2009 in response to Message #322236
maven 1.0 was hell.

i like ant too. but having had to dig through some absolutely unintelligible builds with ant, maven 2.x has grown a lot on me. although i really would like to see improvements to nested project structures, and it drives me crazy having to have an application running to host jar files (hello javax.*).

  Message #322282 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Says...

Posted by: Tomi Tuomainen on September 19, 2009 in response to Message #322236
Yes, it is quite funny to see posts like this nowaways (when Maven is the mainstream tool).

Still, I am using using ant+ivy with a customer. We have common build scripts, that are used in projects (and distributed via ivy). A project build script is generally then very simple, about 50 lines.

We have all the control for builds in our hands. Time spent on maintaining common ant scripts is not much, probably less than struggling with Maven to support our project structure.

Creating clean ant scripts is actually easy and fast(think about the time spent on project code). Of course, this is not very sexy in 2009, but it works.

  Message #322288 Post reply Post reply Post reply Go to top Go to top Go to top

Entropy kills....

Posted by: Karl Banke on September 19, 2009 in response to Message #322230
...never forget - A tool is only worth using if the effort of learning and supporting a new technolody plus the new problems it creates are outweighs its disadvantages....Strangely the "Keep Things Simple" Evangelists gave us some of the most cumbersome tools like Maven with its incredible inflexibility, XML Configuration Hell and Annotation Spaghetti with DI Tools and so on....

  Message #322294 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Fully Automate Build & Deployment using Ant

Posted by: Phil Swenson on September 19, 2009 in response to Message #322135
dead god. ever hear of a scripting language?

check out gradle/gant or buildr. please.

  Message #322305 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Fully Automate Build & Deployment using Ant

Posted by: David Palmer on September 20, 2009 in response to Message #322294
dead god. ever hear of a scripting language?

check out gradle/gant or buildr. please.


huh? if the solution works for the original poster, then it works for them. projecting your own preferences on someone else is really not helpful.

  Message #322308 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Entropy kills....

Posted by: Marc de Kwant on September 21, 2009 in response to Message #322288
Maven is all about keep it simple.
a simple pom (and if you do not know how to handle xml then you have all kinds of problems these days) With next to no code in it what so ever.
And you can build test compile package deploy etc..
For a simple java app. about 10 lines of code in my pom. And I can do alot (compile/test/package/install/deploy/documentation/site).

With ant I need the hell script in this article to do the same.
ivy.. euuuhh thats no build tool. Only a small part of the solution.

There is no strict structure in maven, just a SUGGESTED one. You can define whatever structure you like and tell maven how to handle it, just like you need to tell ant how to handle your structure.

I have build lots of projects is it single project or multiproject, weird folder structures, Flex projects with java. Big and small.
Any place that I see that uses ant it is a xml hell. scripts break (because it is c/p from project to project). To complex too understand etc.
Where maven is used, initially some resistance, but when they see how easy it it to use, they do not want anything else.

If you have a project structure that is weird/complex/out of the ordinary, you should start thinking if you did not build your system overly complex.

But I like just to put my effort in creating business code and keep my customer happy, while you type and debug your ant script which is of no use to the customer :):)

  Message #322309 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Says...

Posted by: Marc de Kwant on September 21, 2009 in response to Message #322282
If you are struggle every time with your project structure, you have not understand maven.
make your pom.xml (build file) once. Then create something like an Archetype (look it up :):)
and then do not ever worry about your project structure, but be awed :):) by the power of our god maven :):)

(a bit joking with you and ridiculing maven)

  Message #322310 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Says...

Posted by: Tomi Tuomainen on September 21, 2009 in response to Message #322309
If you are struggle every time with your project structure, you have not understand maven.


Don't get me wrong. We are not struggling with Maven with every project. For a customer, we once evaluated it (when buggy 2.0 was just out), but it didn't make sense to switch to it. We resolved dependency management with Ivy and stick to our current ant scripts. It worked and still works fine.

For another customer, Maven is used with its goods and bads.

What I'm saying is that there is still not ultimate build tool, that I could happily recommend for all environments. But I would hope that tool will be something like Gradle instead of Maven.

If Maven works in all cases for you, then use it. I won't.

  Message #322311 Post reply Post reply Post reply Go to top Go to top Go to top

Currently using maven+ant is most satisfactory for us

Posted by: Dmitry Zemnitskiy on September 21, 2009 in response to Message #322309
Hello Gentlemen

Maven has very right idea of artifacts, transitive dependencies and repositories. POM shines as a descriptor of
artifact's dependencies.

Unfortunately as a build system maven has lot of drawbacks.
Most questionnable is pollution of POM with plugin-specific details, which leads to bloated poms, and actually has no any relation to dependency resolution.
Moreover, maven support is very terrific as compared to ant, there's no single place in internet to collect useful information about maven plugins, lot of them are still of alpha/beta quality. Moreover, maven support in IDEs (at least eclipse plugin I tried), is far not as convenient to use as ant support.

We in our company use very satisfactory solution, which uses
ant (reusable modular build files for build) and maven (using maven ant tasks) for dependency resolution and artifact tracking.

Our typical project build system consists of conventional directory structure (similar to maven, but easier), pom file containing dependency information only,
one build file which overrides and declares dependencies to standard ant tasks located in reusable build files. Thats all. In fact this is quite similar to ivy,
but easier, because it does not require ivy file in addition to pom.

btw Phil, thank you for pointing to gant/buildr, I think scripting could really bring benefits to build systems,
at leas maybe DSLs based on scripting languages. I though
see some mismatch between procedural approach provided
by scripting languages and declarative approach used in
most build systems I know (make, ant, maven..)

Regards,
Dmitry V. Zemnitskiy,
CEO, pragmasoft.com.ua

  Message #322312 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Entropy kills....

Posted by: Erik Larsson on September 21, 2009 in response to Message #322308
Maven is not in any way about keeping it simple. Maven is about someone getting the idea "hey, I can pull things automatically of the Internet" a long long time ago.

A build system that has a default folder structure that is "src/main/java" has obviously never worked in the real world.

  Message #322314 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Entropy kills....

Posted by: Grzegorz Grzybek on September 21, 2009 in response to Message #322312
A build system that has a default folder structure that is "src/main/java" has obviously never worked in the real world.
For me it works every time. With Ant I had to read someone's "clever" ideas of how project should be organized and built. With Maven I just type
mvn source:jar install eclipse:m2eclipse
and it works. Just look at some Apache projects...

Sure there are some quirks when you have non-standard project organization - with Ant there are always quirks.

And one more thing - there is a myth with products advertising themsleves as "start in 10 minutes" - this slogan is really catchy for non-experienced developers. I don't want to start in 10 minutes - I want to change something in 10 minutes 2 years (or even 2 months) after project's start...

  Message #322315 Post reply Post reply Post reply Go to top Go to top Go to top

Re:

Posted by: Erik Larsson on September 21, 2009 in response to Message #322314
The meaning was meant to be:

"Someone developing a build system that has a default folder structure that is "src/main/java" and think that is normal has obviously never worked in the real world."

  Message #322412 Post reply Post reply Post reply Go to top Go to top Go to top

The best build system

Posted by: Mark Muster on September 22, 2009 in response to Message #322294
dead god. ever hear of a scripting language?

check out gradle/gant or buildr. please.

If it is the better build environment, you could show us your build system based on gradle/gant or buildr. That us give it a try.

  Message #322431 Post reply Post reply Post reply Go to top Go to top Go to top

Re: Entropy kills....

Posted by: Saulius Sinkunas on September 22, 2009 in response to Message #322308
Maven is all about keep it simple.
For a simple java app. about 10 lines of code in my pom.


That's true. But in long term or more complex project 10 lines are not enough. Maven for me looks like a candy for child - at first it looks very sexy, it does everything for you with ~10 lines of pom file. You are involved and happy for a while. But when your needs grow, when you want to do more complex actions (automatically create distros, tag/copy versions in Subversion) then you are really getting into troubles. OK - there are plugins. But all we know how they work. If something doesn't work - it's your problem.

In one medium project (containing >10 subprojects) we used Maven for ~2 years. During that time we spent about 2 weeks fighting with Maven (every 'change' took about 2-3 days to complete). And finally we moved to Ant+Ivy (we did it 2 days). In result we have clear, permanent build system, build scripts contains less code, build process completes in several seconds (in Maven it took several times longer).

So my opinion is: Maven is OK for startup, demo tool, some simple open source project. But for real projects it's better to avoid it.

  Message #328888 Post reply Post reply Post reply Go to top Go to top Go to top

correct

Posted by: alan buchanan on November 05, 2009 in response to Message #322230
your right, Its good to see some old skool stuff.

Keep it up.
Bucky
yournetbiz

New content on TheServerSide.comNew content on TheServerSide.comNew content on TheServerSide.com

Dependency Injection in Java EE 6 - Part 1

Reza Rahman explores the features of the proposed JSR 299, Contexts and Dependency Injection for Java EE (CDI). When approved, it promises to be a key feature of Java EE 6. (November 2, Article)

SAML: It's Not just for Web services

SAML is an XML-based standard for exchanging authentication and authorization data between security domains. The single most important problem that SAML was created to solve is the Web browser Single Sign-On problem. Many organizations are debating whether to stay with version 1.1 or move to 2.0. This article makes observations about both options. (September 28, Article)

Programming is Also Teaching Your Team

Joe Ottinger takes a look at how people learn, and applies it to the practice of programming. He notes that understanding how people learn is an essential part of working in a programming team. (September 22, Article)

Can Java EE Deliver The Asynchronous Web?

Stephen Maryka gave us an article about the Asynchronous Web and posed a number of questions that get examined like an approach to delivering Asynchronous Web capabilities through extensions to existing Java EE technologies. (July 14, Article)

JSF Flex

JavaServer Faces Flex goal is to provide users capability in creating standard Flex components, part of flexSDK which is open sourced through MPL license, as normal JSF components. This article by Ji Hoon Kim will provide an overview of creating a simple multilingual JSF page consisting of JSF Flex tags. (June 29, Article)

The Rules of SOA - A Road to a Successful SOA Implementation

In this session Jeff explores the key characteristics of successful SOA projects. He covers some of the patterns, and anti-patterns, tool sets, and strategies that he himself learned the hard way. Last, he provides a strategy and blueprint for achieving a high likelihood of success in your SOA project. (June 23, Tech Talk)

Ari Zilka Talks About Terracotta 3.1

Ari Zilka, CTO of Terracotta, Inc., talks about the new features in Terracotta 3.1, announced during JavaOne and available now. (June 15, Tech Talk)

Enterprise Application Integration, and Spring

In this Tech Talk, Josh Long explores an integration challenge using Spring Integration and walks through the implementation, employing and expanding on the basic patterns of Enterprise Application Integration to tie together components into a function integration solution, and then demonstrates how Spring Integration helps address the integration requirements. (June 15, Tech Talk)

Google Web Toolkit: An Introduction

In this Tech Talk, David Geary teaches you: The basics of Google Web Toolkit; How to implement Ajax-enabled applications in Java; Internationalization; Hooking into the browser history mechanism; Remote procedure calls. (June 4, Tech Talk)

Just Enough Early Architecture to Guide Development

Jon Kern discusses the best architecture/technical solutions and ensure that they are repeated by all developers. By tackling the architecture up-front in a serial manner, subsequent parallel development will be much more manageable and predictable. (May 28, Tech Talk)

Productive Programmer: On the Lam from the Furniture Police

This keynote describes the frustrations of modern knowledge workers in their quest to actually get some work done, and solutions for how to guard yourself against all those distractions. Neal Ford talks about environments, coding, acceleration, automation, and avoiding repetition as ways to defeat the misguided attempts to sap your ability to produce good work. (May 26, Tech Talk)

Auto-Scaling Your Existing Web Application

Gil demonstrates how new, aggressive uses of already abundant compute capacity by common applications offer competitive value for application designers. (May 21, Tech Talk)

Automating Hibernate Mapping and Queries For Java Web Development

Chris Keene introduces WaveMaker as a new way to automate the ability to generate Hibernate classes in order to more quickly bring OR mapping into an application. (May 19, Article)

Auto-Scaling Your Existing Web Application

In this session Nati Shalom demonstrates how to take a standard Java EE web application and scale it out or down dynamically without changes to the application code. Seeing as most web applications are over-provisioned to meet infrequent peak loads, this is a dramatic change because it enables growing your application as needed, when needed, without paying for unutilized resources. (May 19, Tech Talk)

Free Book PDF Download: Mastering EJB Third Edition

Mastering EJB was one of the original and most influential EJB books in the industry. Mastering EJB III now returns with two new expert co-authors, updated for EJB 2.1 and 30% new chapters including security, integration, best practices, open source, and more.
(Book PDF Download)

Application Server Matrix

The Application Server Matrix is a detailed listing of J2EE vendors and their application server products, with information on latest version numbers, J2EE spec support and licensing, pricing, platform support, and links to product downloads and reviews.
(Application Server Comparison Matrix)

News | Blogs | Discussions | Tech talks | Patterns | Reviews | White Papers | Downloads | Articles | Media kit | About
Java Solutions
All Content Copyright ©2007 TheServerSide Privacy Policy
Site Map