Is there a way to programmatically get the version of Guice?

28 views
Skip to first unread message

Ramon Santiago

unread,
Mar 21, 2012, 12:48:40 PM3/21/12
to google...@googlegroups.com
Is this a getVersion() for Guice?

TJ Rothwell

unread,
Mar 22, 2012, 8:16:31 AM3/22/12
to google...@googlegroups.com
That could lead to some fragile and very difficult to test code. What's the use case?

-- TJ

On Wed, Mar 21, 2012 at 11:48 AM, Ramon Santiago <ramonjs...@gmail.com> wrote:
Is this a getVersion() for Guice?

--
You received this message because you are subscribed to the Google Groups "google-guice" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-guice/-/8BDM2uwVXDsJ.
To post to this group, send email to google...@googlegroups.com.
To unsubscribe from this group, send email to google-guice...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-guice?hl=en.

Thomas Darimont

unread,
Mar 22, 2012, 8:45:57 AM3/22/12
to google...@googlegroups.com
One way would be:

Open the file (guice-xxxx.jar) with JarFile (http://docs.oracle.com/javase/7/docs/api/java/util/jar/JarFile.html
and then call getManifest() to get the Manifest (http://docs.oracle.com/javase/6/docs/api/java/util/jar/Manifest.html) . 
After that you can access the attributes (via getAttributes()) appropriately.

Look at guice-xxxx.jar/ META-INF/MANIFEST.MF for properties of interest (e.g. Bundle-Version)

Best regards,
Thomas

Brian Pontarelli

unread,
Mar 22, 2012, 9:17:53 AM3/22/12
to google...@googlegroups.com
java.lang.Package might work if the manifest has useful information in it. 

Sent from my iPhone
--
You received this message because you are subscribed to the Google Groups "google-guice" group.
Reply all
Reply to author
Forward
0 new messages