Re: Generate Version class

2007-08-20 Thread Michael McCallum
You can load the pom properties off the class path so every maven built artifact in your class path has version information. Don't copy and paste this but it gives you the idea... InputStream in getClass().getResourceAsStream("META-INF/maven/path/to/pom.properties"); Properties p = new Properti

Re: Generate Version class

2007-08-20 Thread Andrew Williams
Though it is not exactly a best practice it is possible to filter the source "in place" using just a configuration similar to that posted (referencing src/main/java) - this would not require the buildhelper plugin. Andy On 20 Aug 2007, at 12:09, Tim Kettler wrote: Create a new directory

Re: Generate Version class

2007-08-20 Thread Tim Kettler
Create a new directory (for example 'src/main/classtemplates') and put you class template under the correct package directory in there. Then declare a additional resource in your pom: [...] src/main/classtemplates true target/generated-sources [...] and us

Re: Generate Version class

2007-08-20 Thread bakito
--- >> 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: Generate Version class

2007-08-13 Thread Andrew Williams
You could configure the filtering to filter your java code as well as standard resources, though I don't know if that is what you want. Andy On 22 Jul 2007, at 22:56, Francois Fernandes wrote: Hi list, for some time now I've been looking for a easy way to generate a simple class containin

Re: Generate Version class

2007-07-24 Thread Markku Saarela
Java JDK has simple way to do this. If You know some class located in your jar file simple way to get implementation version from this jar's manifest file is to call this known <>.getPackage().*getImplementationVersion*(). rgds, Markku Francois Fernandes wrote: Yes, you're right. But the pro

Re: Generate Version class

2007-07-23 Thread Steven Rowe
Hi Francois, Francois Fernandes wrote: > for some time now I've been looking for a easy way to generate a simple > class containing version information of our artifact. I know that it is > possible to filter resources. But to avoid any resource loading issues I > would like maven to generate such

Re: Generate Version class

2007-07-23 Thread Mark Derricutt
I've used JRelease in the past under ant to do this sort of thing - it generates a class with your version info (can't seem to find a website for it now thou..) On 7/23/07, Dirk Olmes <[EMAIL PROTECTED]> wrote: Another idea would be to use the maven-exec-plugin as part of the build process to

Re: Generate Version class

2007-07-23 Thread Dirk Olmes
Francois Fernandes wrote: > Yes, you're right. But the problem is that our jar is not the only one > on the classpath. That means that it is hard to ensure that we're > loading the right manifest file to read the version. (btw. we're placing > version information already inside this jar.) > Loading

Re: Generate Version class

2007-07-23 Thread Francois Fernandes
Yes, you're right. But the problem is that our jar is not the only one on the classpath. That means that it is hard to ensure that we're loading the right manifest file to read the version. (btw. we're placing version information already inside this jar.) Loading resources even inside files caus

Re: Generate Version class

2007-07-22 Thread Kalle Korhonen
Or, just generate and use a manifest file in META-INF. The manifest is meant to be used exactly for that purpose (to hold the version etc. information). Kalle On 7/22/07, Dirk Olmes <[EMAIL PROTECTED]> wrote: Francois Fernandes wrote: > Hi list, > > for some time now I've been looking for a e

Re: Generate Version class

2007-07-22 Thread Dirk Olmes
Francois Fernandes wrote: > Hi list, > > for some time now I've been looking for a easy way to generate a simple > class containing version information of our artifact. I know that it is > possible to filter resources. But to avoid any resource loading issues I > would like maven to generate such

Generate Version class

2007-07-22 Thread Francois Fernandes
Hi list, for some time now I've been looking for a easy way to generate a simple class containing version information of our artifact. I know that it is possible to filter resources. But to avoid any resource loading issues I would like maven to generate such a class. Does anyone have a idea h