Java – How to get system user in ant (within eclipse)

anteclipsejava

How can I access the name of the system user (which eclipse also uses for the javadoc
author tag) in my ant build file?

I'm trying to show some information about the current program version in my java application.
I decided to use jreleaseinfo which passes variables from my ant build script to my java classes (to show them in a window). With svnant I'm even capable of accessing the latest revision number and build date from svn within my build.xml.

Now: The last thing I need is to show who made that build!

Best Answer

This will work anywhere. It uses the java system property user.name.

<property environment="env" />
<echo message="user: ${user.name}" />