aspose file tools
The moose likes Ant, Maven and Other Build Tools and the fly likes Echoing all the environment properties Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Reply Bookmark "Echoing all the environment properties" Watch "Echoing all the environment properties" New topic
Author

Echoing all the environment properties

Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

Can this easily be done?



I've recently switched environments (Suse to Ubuntu) and now my env.HOSTNAME appears to be empty. The version.major property is there, it's being loaded from the SystemBuild.properties file.

At the command line, I type 'set', and within that listing, I see a HOSTNAME defined.

I'm just wondering if anyone's experienced this problem before on Ubuntu (or other platform)

Also: is it possible to have Ant iterate over all "env." properties ? That is: Find out what gets loaded by : property environment="env"


Thanks.
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 26496
    
  78

Mike,
Take a look at the echoproperties task. You can supply a prefix to get a subset of the properties - the env ones - or no prefix to get them all.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Mike Curwen
Ranch Hand

Joined: Feb 20, 2001
Posts: 3695

doh!

It never even occured to me to search the Ant docs directly.

One would *think* that googling for "ant echo properties", would have found this page

Thanks very much!
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Echoing all the environment properties
 
Similar Threads
How do I provide a default for an environment variable accessed via ${env.VAR_NAME} in build script?
ant exception
Opening .bat files from ant
How to print classpath using ant
package javax.ejb does not exist