This week's book giveaway is in the Testing forum.
We're giving away four copies of Practical Unit Testing with TestNG and Mockito and have Tomek Kaczanowski on-line!
See this thread for details.
The moose likes Ant, Maven and Other Build Tools and the fly likes Maven Command Line arguments Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Maven Command Line arguments" Watch "Maven Command Line arguments" New topic
Author

Maven Command Line arguments

Paul Connolly
Greenhorn

Joined: Aug 03, 2004
Posts: 2
Is it possible to pass in command line arguments to Maven?

In my build process, I call my goal overnightBuild which performs the entire process. I want to change the process that you can pass in an argument that specifies which branch the build is to be run off. So is it possible to pass in something like
"maven overnightBuild betaBranch" or an equivalent? Looking at their documentation and don't see anything about it or anything similar...
Jon Strayer
Ranch Hand

Joined: Dec 04, 2002
Posts: 133
Originally posted by Paul Connolly:
Is it possible to pass in command line arguments to Maven?

In my build process, I call my goal overnightBuild which performs the entire process. I want to change the process that you can pass in an argument that specifies which branch the build is to be run off. So is it possible to pass in something like
"maven overnightBuild betaBranch" or an equivalent? Looking at their documentation and don't see anything about it or anything similar...


You would have to do some work on overnightBuild to have it use some property (for example buildBranch) and then call it like this:

maven overnightBuild -DbuildBranch=betaBranch


Jon
 
 
subject: Maven Command Line arguments
 
Threads others viewed
Printing "Hi Hello Bye!!"
Passing arguments through the command line
Maven Commandline Interactive Mode
Examples of ant command line arguments
Running a .bat/ .cmd file from Java
developer file tools