As the most frequent author of the 2 comments mentioned below, I will agree and disagree with Curtis' observations.

He is right that Maven is very powerful and flexible.
It is possible to make it do all kinds of interesting and useful things.

However, it is also very easy when starting with Maven, to get into patterns based on experience with previous build tools, that make simple tasks much more difficult.

It frequently appears from the person's statement that they "are just starting with Maven" and from the brief description of their problem that they are building a fairly common type of application that can be built very easily by Maven with a relatively simple POM and project structure.

However, they have gotten off on the "wrong" foot and are trying to bend Maven to their will or as Curtis might say "exploit the full power and flexibility of Maven".

I usually quote the offending phrases around "fighting Maven" and "profiles are evil" in an attempt to get them to reexamine their strategy and see if their project does follow one of the more common patterns (webapp, standalone executable, etc.) that Maven can handle very simply.

I will admit that I am not often the source of detailed technical information in these cases since I do not usually know how to do what they are doing and I am also pretty suspicious that the help that they want is not in their best interest.

One of the dangers in this forum is that there are bunch of guys here who are very, very smart and very knowledgeable about Maven and can patch up a really bad Maven approach into something that will work. If you ask the wrong question, you may get the right answer which will help you get further out of your depth.

One of the problems with documentation is that it often describes everything that you can do without pointing out that some of these things should only be used in rare circumstances and should only be considered after you have exhausted the normal features and patterns. Sometimes the examples demonstrate the power of the feature rather than the most common use which is considered to be too simple to be worth showing and does not show the full elegnce of the feature.

Another problem that new users face is the reluctance to make big changes in their project structures or development methodology until they are sure that Maven is the way to go. This is understandable and my goal is to get them to understand that a little up front investment in conforming to convention may generate a short-term return when compared to trying to get a build process in place that follows their existing practice. I hope that my comments also give a sense of optimism that what they want to do is possible with Maven and that the forum is here to help them.

Ron


On 17/04/2012 12:48 PM, Curtis Rueden wrote:
Hi everyone,


Especially since the most valuable single
bit of advice one can give a new Maven user is:  "if you don't do
things Maven's way, Maven will fight you and Maven will win."

I disagree that it is the "most valuable single bit of advice." It is
repeated far too frequently, often in cases where there *is* a reasonable
technical answer to the question being asked.

Maven is much more flexible than many give it credit for. You can write
your own plugins to do nearly anything, or invoke Ant with AntRun if you
have existing Ant-based builds. Even conventions like "one project = one
JAR" are not universally true—the assembly plugin lets you do all kinds of
nifty stuff including building multiple artifacts as part of the same
project. People complain about the nested "src/main/java" directory
structure but you don't even need that; it is actually really easy to
override the source and resource directories in the great majority of
cases. People complain about profiles being "evil" but they are an
extremely powerful tool, and like any powerful tool are only as "good" or
"evil" as their use.

I think it is great to caution people against anti-patterns, etc., pointing
out how they could make their lives easier by structuring things
differently. But if we are not careful, such advice can degenerate into
nonconstructive criticism, as illustrated by the unfortunate saying: "Don't
fight against Maven, you'll loose [sic]." This attitude causes real
problems within the developer community: at least one of the teams with
which I collaborate dislikes Maven due to its "our way or the highway"
attitude.

Maven is an extremely powerful set of building blocks, and I think we
should be focusing on promoting that power and flexibility, rather than
criticizing anyone who tries to use Maven in an unconventional way. After
all, the beauty of "convention over configuration" is that you *can*
configure and override behavior as needed.


People extol the virtues of "convention over configuration", but where
is the compact definitive specification of The Conventions?

I think one major difficulty is that as Maven develops, there is an
evolving vision and understanding of what works well and what doesn't. And
that is OK, and will continue to be the case. That said, someone could
probably make some good money writing a book about the current vision and
understanding, as well as updating it with new editions over time. :-)

Regards,
Curtis


On Tue, Apr 17, 2012 at 11:12 AM, Mark H. Wood<mw...@iupui.edu>  wrote:

On Tue, Apr 17, 2012 at 07:12:26AM -0700, Eric Kolotyluk wrote:
I also recommend taking the Sonatype training courses - especially if
you are a software architect.

There is a lot to be said when you can ask question as the instructor is
going over the material.

However, you are right, if someone were to write a book called the "The
Maven Way" in the style you suggest, I would certainly be interested in
buying a copy.
You are not alone in that.  Especially since the most valuable single
bit of advice one can give a new Maven user is:  "if you don't do
things Maven's way, Maven will fight you and Maven will win."

People extol the virtues of "convention over configuration", but where
is the compact definitive specification of The Conventions?

--
Mark H. Wood, Lead System Programmer   mw...@iupui.edu
What is obvious to A may be not so obvious to B and downright
ridiculous to C. -- Asimov



--
Ron Wheeler
President
Artifact Software Inc
email: rwhee...@artifact-software.com
skype: ronaldmwheeler
phone: 866-970-2435, ext 102


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to