On Wed, Dec 17, 2008 at 11:17 AM, Trevor Harmon <[email protected]> wrote:

> No, it doesn't fit my needs because it always prints both "hello" and
> "goodbye". I want to print either "hello" or "goodbye".
>
> For example, in the scenario I mentioned earlier, I want to launch a
> desktop application with one particular command-line configuration. With
> your solution, I'd be launching the app multiple times. That's certainly not
> what I want.
>
> I've attached a rewrite of your code that uses profiles to select which
> configuration is run. For instance:
>
> mvn -Phello clean
> mvn -Pgoodbye clean
>
> Or I can do both at once:
>
> mvn -Phello,goodbye clean
>
> Is there a way to accomplish this without profiles?
>

In some of the examples you used previously (installer, docbook), I'd
probably be inclined to make each of these modules if I were trying to
follow "The Maven Way."  Then again, you can certainly do what you're
currently doing, if it works for you.  Finally, you could use a tool that's
intended to accomplish relatively arbitrary tasks, like Ant.

All of those will work, and it's up to you decide what makes sense for you.

All I'm really trying to say (and I suspect what others are trying to say)
is that the answer to your original question, "Are profiles intended to play
the same role as Ant targets?" is "No.  They aren't."  Doesn't mean you
can't use 'em that way, but if you're trying to understand the Maven
approach to accomplishing what you're going for, I'd say that using profiles
this way is not really the intent.

  - Geoffrey
-- 
Geoffrey Wiseman
http://www.geoffreywiseman.ca/

Reply via email to