Print Classpath in Ant Build File []

Moved to the page http://3rdstage.wikia.com/wiki/On_Ant in my wiki as of 6th Aug. 2012.
Sometimes, it can be convenient to print out classpath to console to confirm it is correctly setup in Ant build file. For this, you can use the expression ${toString:pathreference} like the following example
<?xml version="1.0" encoding="UTF-8"?>
<project name="shop1-hibernate-export" default="echo-env" basedir="."


 <!-- Get Maven Dependency -->
 <artifact:pom id="project.pom" file="${project.home}/pom.xml"/>
 <artifact:dependencies pomRefId="project.pom" pathId="dependency.classpath"/>
 <!-- Ant4Eclipse Tasks Definitions -->
 <taskdef resource="net/sf/ant4eclipse/antlib.xml" /> 
 <getEclipseClasspath pathId="eclipse.classpath" project="../../../../../.."/>

 <path id="project.classpath">
  <path refid="dependency.classpath"/>
  <path refid="eclipse.classpath"/>

 <target name="echo-env">

 <target name="generate-ddl">




Post a Comment