On Thu, 15 Jan 2009, Kent Larsson wrote:
Hi again, It is solved now. I run Ubuntu and had defined CATALINA_HOME in etc/environment to get a system wide environment variable. I then used . /etc/environment to load the variable into the bash instance I used. Somehow ant could not pick up on this variable until after I rebooted. I'm sure there is some way to load it in, I'm just not proficient enough with Linux. Best regards, Kent On Thu, Jan 15, 2009 at 5:25 PM, Kent Larsson <[email protected]>wrote:Hi, I have a build.xml for my Ant build script and a build.properties file for easier configuration. $ ls build.* -rw-r--r-- 1 tnek tnek 29 2009-01-15 17:01 build.properties -rw-r--r-- 1 tnek tnek 270 2009-01-15 17:05 build.xml They are short and easy to understand: $ cat build.properties # Some comment hello=jejejej $ cat build.xml <?xml version="1.0"?> <project xmlns:ivy="antlib:org.apache.ivy.ant" name="testproject"> <property environment="env"/> <property file="build.properties"/> <echo message="hello = ${hello} and env.CATALINA_HOME = ${env.CATALINA_HOME} and path = ${env.PATH}"/> </project> The environment variable CATALINA_HOME is defined: $ echo $CATALINA_HOME /var/lib/tomcat5.5 Still only the environment variable PATH is echoed as it's supposed to: $ ant -v Apache Ant version 1.7.0 compiled on August 29 2007 Buildfile: build.xml Detected Java version: 1.6 in: /usr/lib/jvm/java-6-sun-1.6.0.07/jre Detected OS: Linux parsing buildfile /home/tnek/testproject/build.xml with URI = file:/home/tnek/testproject/build.xml Project base dir set to: /home/tnek/testproject [antlib:org.apache.tools.ant] Could not load definitions from resource org/apache/tools/ant/antlib.xml. It could not be found. [property] Loading Environment env. [property] Loading /home/tnek/testproject/build.properties Property "env.CATALINA_HOME" has not been set [echo] hello = jejejej and env.CATALINA_HOME = ${env.CATALINA_HOME} and path = /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games BUILD SUCCESSFUL Total time: 0 seconds Why isn't CATALINA_HOME echoed and how can I fix it?
Scot P. Floess 27 Lake Royale Louisburg, NC 27549 252-478-8087 (Home) 919-754-4592 (Work) Chief Architect JPlate http://sourceforge.net/projects/jplate Chief Architect JavaPIM http://sourceforge.net/projects/javapim Architect Keros http://sourceforge.net/projects/keros --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
