This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
i need to send some parameters through command line and i have to read the parameters.depending on that value i have to read specific folder ...
could you please help me out
regards David
Rodrigo Tomita
Ranch Hand
Joined: Apr 28, 2008
Posts: 70
posted
0
Originally posted by John David:
i need to send some parameters through command line and i have to read the parameters.
Hi,
What exactly do you mean by "I have to read the parameters" ? Are you developing a maven plug-in? If so, I don't think you can read parameters from the command line.
However, you can accept parameters defined in your pom.xml descriptor. That is relatively simple, you can refer to the Maven site. Basically you just need to create an attribute and annotate it following some conventions.
Hope it helps.
John David
Greenhorn
Joined: Aug 17, 2006
Posts: 29
posted
0
Hi Rodrigo Tomita Thanks a lot for your reply. but im not going to create or write a plug in. but im trying to read the command ine parameter and based on that parameter i have to compile specific folders only and rest of them shoud be discarded...
You can use the -D option to pass a system property. To see all of the mvn options, enter: mvn -?
As far as using that information to determine which folders to compile, you are on your own. I would tackle something like that in Ant before I would even attempt it in Maven!
Originally posted by Peter Johnson: As far as using that information to determine which folders to compile, you are on your own.
I'm sorry but I agree with Peter... The best I can think of is organizing your code in a multi-module project (a parent pom and several modules, one for each portion of your code you want to compile separately).
That way you could control what will be built either with minimum parent pom.xml manipulation or by building the child modules in a shell script.