HowTo access project version programmatically in application
Hi, HowTo access project version programmatically in application? At the moment we enter the version string manually in one of our classes. Is there a way to access the project version at runtime? One of my thoughts are to generate a Version class holding the version string, but is there a more convenient way? Thanks in advance Roland -- Roland Klein Tel: +49 40 65803 209 Fax: +49 40 65803 392 [EMAIL PROTECTED] MTG Marinetechnik GmbH - Wandsbeker Koenigstr. 62 - D 22041 Hamburg GF Dipl.-Ing. Ullrich Keil Handelsregister: Abt. B Nr. 11 500 - Amtsgericht Hamburg Abt. 66 USt.-IdNr.: DE 1186 70571 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HowTo access project version programmatically in application
Make your version a property, use the same property in your version element and when generating a manifest. Or, use maven-buildnumber-plugin. Kalle On 2/22/07, Roland Klein <[EMAIL PROTECTED]> wrote: Hi, HowTo access project version programmatically in application? At the moment we enter the version string manually in one of our classes. Is there a way to access the project version at runtime? One of my thoughts are to generate a Version class holding the version string, but is there a more convenient way? Thanks in advance Roland -- Roland Klein Tel: +49 40 65803 209 Fax: +49 40 65803 392 [EMAIL PROTECTED] MTG Marinetechnik GmbH - Wandsbeker Koenigstr. 62 - D 22041 Hamburg GF Dipl.-Ing. Ullrich Keil Handelsregister: Abt. B Nr. 11 500 - Amtsgericht Hamburg Abt. 66 USt.-IdNr.: DE 1186 70571 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: HowTo access project version programmatically in application
On 22 Feb 07, at 11:02 AM 22 Feb 07, Roland Klein wrote: Hi, HowTo access project version programmatically in application? Every JAR created with Maven embeds a properties which you can use to get the version from. This is what we do: http://svn.apache.org/repos/asf/maven/components/trunk/maven-core/src/ main/java/org/apache/maven/execution/DefaultRuntimeInformation.java Jason. At the moment we enter the version string manually in one of our classes. Is there a way to access the project version at runtime? One of my thoughts are to generate a Version class holding the version string, but is there a more convenient way? Thanks in advance Roland -- Roland Klein Tel: +49 40 65803 209 Fax: +49 40 65803 392 [EMAIL PROTECTED] MTG Marinetechnik GmbH - Wandsbeker Koenigstr. 62 - D 22041 Hamburg GF Dipl.-Ing. Ullrich Keil Handelsregister: Abt. B Nr. 11 500 - Amtsgericht Hamburg Abt. 66 USt.-IdNr.: DE 1186 70571 - 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]
Re: HowTo access project version programmatically in application
Thanks for Your reply, it works now Roland Jason van Zyl schrieb: On 22 Feb 07, at 11:02 AM 22 Feb 07, Roland Klein wrote: Hi, HowTo access project version programmatically in application? Every JAR created with Maven embeds a properties which you can use to get the version from. This is what we do: http://svn.apache.org/repos/asf/maven/components/trunk/maven-core/src/main/java/org/apache/maven/execution/DefaultRuntimeInformation.java Jason. At the moment we enter the version string manually in one of our classes. Is there a way to access the project version at runtime? One of my thoughts are to generate a Version class holding the version string, but is there a more convenient way? Thanks in advance Roland --Roland Klein Tel: +49 40 65803 209 Fax: +49 40 65803 392 [EMAIL PROTECTED] MTG Marinetechnik GmbH - Wandsbeker Koenigstr. 62 - D 22041 Hamburg GF Dipl.-Ing. Ullrich Keil Handelsregister: Abt. B Nr. 11 500 - Amtsgericht Hamburg Abt. 66 USt.-IdNr.: DE 1186 70571 - 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] -- Roland Klein Tel: +49 40 65803 209 Fax: +49 40 65803 392 [EMAIL PROTECTED] MTG Marinetechnik GmbH - Wandsbeker Koenigstr. 62 - D 22041 Hamburg GF Dipl.-Ing. Ullrich Keil Handelsregister: Abt. B Nr. 11 500 - Amtsgericht Hamburg Abt. 66 USt.-IdNr.: DE 1186 70571 - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]