As you suggest you can also read them in from somewhere. Create a test resources property file that gets filtered and read that. Much simpler and easier to maintain when there's more than a few properties.
-----Original Message----- From: Dan Tran [mailto:[email protected]] Sent: Wednesday, December 02, 2009 9:25 AM To: Maven Users List Subject: Re: How to access Maven default properties from a Junit test? You need to pass them in explicitly using surefire plugin's properties configuration -D On Wed, Dec 2, 2009 at 4:55 AM, Costin Caraivan <[email protected]> wrote: > > Hello, > > Does Maven pass the default properties to a Junit test launched? If > so, how can I access them? > > For example I would like to know ${project.groupId} or ${project.version}. > Is there any way I can access these from the Junit tests? > > Thank you, > Costin. > > PS: What I really want to know if there is a mechanism in place, I > don't really want to fill the configuration with duplicate properties, > or make a temporary file which I read later. If there's no elegant > solution, I'll just read the from somewhere :) > -- > View this message in context: > http://old.nabble.com/How-to-access-Maven-default-properties-from-a-Ju > nit-test--tp26608418p26608418.html > Sent from the Maven - Users mailing list archive at Nabble.com. > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > > --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected] ------------------------------------------------------------------------------------------------------------------- CONFIDENTIALITY NOTICE: This e-mail and any files attached may contain confidential and proprietary information of Alcatel-Lucent and/or its affiliated entities. Access by the intended recipient only is authorized. Any liability arising from any party acting, or refraining from acting, on any information contained in this e-mail is hereby excluded. If you are not the intended recipient, please notify the sender immediately, destroy the original transmission and its attachments and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Copyright in this e-mail and any attachments belongs to Alcatel-Lucent and/or its affiliated entities. --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
