Java Reference
In-Depth Information
All of the people who've used Maven agree that it's easy to start up with it. And the
idea behind the project is amazing. But things seem to break when you need to do
some of the unconventional things.
What's great about Maven is that it will set up a frame for you and will constrain
you to think inside that frame—to think the Maven way and do things the Maven way.
When you work with Maven for a certain period of time, you'll inevitably need to copy
a file from one place to another. We think you'll be surprised to see that there's no
copy plug-in in Maven, in contrast with Ant, which has the copy task. You have to deal
with the situation, and if you investigate further and think “the Maven way,” it may
turn out that you never needed to copy that file.
In most cases Maven won't let you do any nonsense. It will restrict you and show
you the way things need to be done. Ant works the other way: it's a powerful tool, and
you can do whatever you need to do. But it can be dangerous in inappropriate hands.
And again, it's up to you to decide which of these tools you want to use. Some compa-
nies hire build engineers, who are considered to have the appropriate knowledge, so
for them Ant is no danger at all—it's just a powerful tool.
To finish this chapter we'll tell you a story. We have a friend who once had a job
interview.
“Well, is it possible for Ant to do …?” he was asked.
Without even letting the interviewer to finish his sentence, my friend replied,
“Yes, it is.”
We're not sure what his answer would have been if he'd been asked about Maven.
10.5
Summary
In this chapter we briefly introduced you to what Maven is and how to use it in a devel-
opment environment to build your source code. We discussed in detail all of the fea-
tures of Maven that make it unique compared to any other build system. We also
looked at two of Maven's plug-ins in detail: the Compiler plug-in and the Surefire
plug-in. With this information you should be able not only to start and execute your
tests but also to produce nice HTML reports of the test results.
In the next chapter we close the automation part of the topic, by introducing
different continuous integration build tools, such as CruiseControl and Hudson.
We show you the benefits of using such tools and also how to install and configure
these tools.
 
 
Search WWH ::




Custom Search