tags:

views:

664

answers:

2

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!

+2  A: 

this will work anywhere, uses java system property user.name. This should be xml of course, sorry about formatting, I still dont know how to insert xml here

property environment="env"

echo message="user: ${user.name}"

raticulin
yes - sometimes it can be that easy...I just found it myself. All the system-variables you can use are explained here: http://java.sun.com/j2se/1.3/docs/api/java/lang/System.html#getProperties()
räph
+1  A: 

user.name can be used:

<echo>User is: ${user.name}</echo>

Results in:

[echo] User is: coobird
coobird