aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Commandline Interactive Mode Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Maven Commandline Interactive Mode" Watch "Maven Commandline Interactive Mode" New topic
Author

Maven Commandline Interactive Mode

Joe Harry
Ranch Hand

Joined: Sep 26, 2006
Posts: 9524
    
    2

Guys,

I would like to acheive something like the Maven archetype-generate plugin does. I have a Maven project and I have 3 different configurations for the project. When I build this project by calling mvn clean install, I want to show to the user 3 different configuration options namely. dev, test, reference and the user selects one of the option and hits enter. This should be then given as the input to the Maven pom file and Maven builds the project for that set of configuration values. Any suggestion on any plugin that would acheive this?


SCJP 1.4, SCWCD 1.4 - Hints for you, Certified Scrum Master
Did a rm -R / to find out that I lost my entire Linux installation!
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5843
    
    7

Would profiles do what you are looking for:
http://maven.apache.org/guides/introduction/introduction-to-profiles.html
http://www.sonatype.com/books/mvnref-book/reference/profiles.html


JBoss In Action
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16250
    
  21

As a general rule, it's not a good idea to make either Maven or Ant scripts conversational. It can cause the build process to hang if the building person/application doesn't know that it should be chatting with the build and furthermore if there's an emergency and/or the original authors have been laid off (not uncommon these days), it's possible that whoever's trying to do the build may not know the proper responses. Of course some people would argue that that's a fitting means of revenge.

Profiles are a good alternative, as they can be supplied on the Maven command line or in a script that runs the maven command line.

For webapps, I myself don't do alternative builds except in cases like where the development machine is Tomcat and the target is something like an IBM iSeries WebSphere server. For more generic environments such as Windows, Linux, and Solaris, I put the personality information on the target server itself and let the app pick it up from there.


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Maven Commandline Interactive Mode