If you're using nexus 2.x, you can try
This will give you an xml response listing relevant artifacts. You can use this to get the version you want
create a macro to fetch the latest version from nexus. you can do this by using groovy with ant.