• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

A layman's doubt on build

 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dear all,
I'm a novice coming to java.
I want to know why instead of following the simple compiling process in real-time projects they are using build tools like ant or maven, which doesn't make any sense to novice like me(atleast their terrorising xml files)
Regards.

Note: Atleast I understand it gives some benefits over simple-compile , that's why they are using it in all real-projects, but don't know how they are benefitable.
 
Vijitha Kumara
Bartender
Posts: 3913
9
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You will find this Ranch artical explains specifically about ant build tool, And Ranch FAQ for Build Tools very much helpfull.
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's highly technical with so many complex jargons.
Can anybody brief about why we use build tools instead of simple compile?
Regards.
 
rakesh sugirtharaj
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your doubt is because you think build is just another way to compile. Its much more (but also includes compiling). One scenario - you can configure builds to run at a specific time(usually done at night and called 'nightly builds'). Yes, you can do this by putting a person incharge to compile and package your code every night at 12 but build seems to be easier.
And also running Unit tests(also generate pretty reports)! You can run your tests from ant/maven. Typically programmers are lazy. They want to get the jar/war with minimum effort. So they dont want to 'right click' and compile then right click and jar or run tests. Write a build(with some effort upfront) and just type 'ant' everytime. (I m tired of typing this much text - i m a good programmer )
[ November 12, 2008: Message edited by: rakesh sugirtharaj ]
 
ramya narayanan
Ranch Hand
Posts: 338
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<macrodef name="setclasspath">
<attribute default=""
name="prepend.classpath"/>
<attribute default="" name="append.classpath"/>
<sequential>
<path id="build.classpath">
<pathelement path="@{prepend.classpath}"/>
<path refid="default.classpath"/>
<pathelement
path="@{append.classpath}"/>
</path>
<pathconvert dirsep="/" property="build.classpath.property" refid="build.classpath"/>
</sequential>
</macrodef>

When you see code like this, you will certainly get terror?
Right.
Regards.
 
rakesh sugirtharaj
Ranch Hand
Posts: 151
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes. Terrorizing enough for a programmer. But many projects have 'Build Managers' whose job is to deal with this sort of terror.
 
Gregg Bolinger
GenRocket Founder
Ranch Hand
Posts: 15302
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not all build tools use that kind of syntax. Gradle for example uses Groovy scripts for builds. There are many others like Gant and Builr.

I'm going to move this to the Ant, Maven, and Other Build Tools forum where build tools are generally discussed.
[ November 12, 2008: Message edited by: Gregg Bolinger ]
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ramya,

You'll find that Ant and Maven are pretty much default industry build tools. Although their XML configuration files can get pretty complex, you'll be surprised at how quickly you can set up a simple build, test, deploy cycle in either of those to technologies. I recommend you visit their web sites and go through the starting tutorials.

The benefits of using these tools are enormous, you're able to environmentalise builds, test builds, deploy builds and a host of other things (such as running reports on code quality).

It really will improve your development life!
 
Peter Johnson
author
Bartender
Posts: 5852
7
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree that looking at existing build scripts, especially complicated ones such as those generated by NetBeans, can terrorize you. It is probably better to ignore such scripts and start out simply. For that you will need either a tutorial or a book. Ant in Action is a good book for Ant (I have the prior version and found it indispensable). For Maven there is Better Builds with Maven, a free PDF you can download. In addition, the Maven project has a web page listing various resources.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Peter Johnson:
For Maven there is Better Builds with Maven, a free PDF you can download.[/URL]


Great links Peter, this PDF in particular is fantastic and the cornerstone document of how we moved to Maven on our current project. In particular it covers why Maven isn't just a build tool, it's a way of structuring your development as well.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic