You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Murray, Mike" <mb...@ptc.com> on 2006/12/04 19:02:10 UTC

ANT_ARGS=-noclasspath -logger -cp

This looks like a bug to me, but am I overlooking some other way to
accomplish this, besides setting the env classpath to the one jar that
contains the custom logger class?  (I've used a modified ant.bat for
years to work around this, and I'm trying to get rid of my hacks.)
 
When defining -noclasspath and -cp for the -logger class (see ANT_ARGS
below), it fails with "The -cp argument must not be repeated". Since the
-noclasspath is not processed by ant.bat, two -cp arguments are passed,
as can be seen at the bottom.
 
(Seems to me the best way to get rid of the problem would be to
implement the enhancement requested by bug 36958
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36958> .)
 
Thanks, Mike
 
--- Ant Environment Variables ---
ANT_ARGS=-noclasspath -logger com.ptc.tools.build.PTCLogger -cp
L:/tools_vs/lib/BuildSupport-ant.jar
ANT_HOME=D:\Programs\apache-ant-1.7.0RC1
ANT_OPTS=-Xmx1024M
 
--- Command executed ---
ant -f build_at_desktop.xml clean
 
--- Selected output from ant.bat ---
set _USE_CLASSPATH=yes
 
if "L:\Windchill\codebase;D:\Programs\jdk1.5.0_06\jre\lib\rt.ja
r;D:\Programs\jdk1.5.0_06\lib\tools.jar;T:\sde\classes\junit.jar" == ""
set _USE_CLASSPATH=no
 
if ""build_at_desktop.xml"" == ""-noclasspath"" goto clearclasspath
 
if ""clean"" == ""-noclasspath"" goto clearclasspath
 
set ANT_CMD_LINE_ARGS=-f build_at_desktop.xml clean
 
if _USE_CLASSPATH == no goto findAntHome
 
if not _r == _\ goto findAntHome
 
if "yes" == "no" goto runAntNoClasspath
 
"D:\Programs\jdk1.5.0_06\bin\java.exe" -Xmx1024M -classpath
"D:\Programs\apache-ant-1.7.0RC1\lib\ant-launcher.jar" 
"-Dant.home=D:\Programs\apache-ant-1.7.0RC1"
org.apache.tools.ant.launch.Launcher -noclasspath -logger
com.ptc.tools.build.PTCLogger -cp L:/tools_vs/lib/BuildSupport-ant.jar
-cp
"L:\Windchill\codebase;D:\Programs\jdk1.5.0_06\jre\lib\rt.jar;D:\Program
s\jdk1.5.0_06\lib\tools.jar;T:\sde\classes\junit.jar" -f
build_at_desktop.xml clean
The -cp argument must not be repeated

RE: ANT_ARGS=-noclasspath -logger -cp

Posted by "Murray, Mike" <mb...@ptc.com>.
Resolved:

I just stumbled across the "other way" I was seeking, which is to use
-lib, instead of -cp.

ANT_ARGS=-noclasspath -logger com.ptc.tools.build.PTCLogger -lib
L:/tools_vs/lib/BuildSupport-ant.jar

-----Original Message-----
From: Murray, Mike [mailto:mbm@ptc.com] 
Sent: Monday, December 04, 2006 12:02 PM
To: user@ant.apache.org
Subject: ANT_ARGS=-noclasspath -logger -cp

This looks like a bug to me, but am I overlooking some other way to
accomplish this, besides setting the env classpath to the one jar that
contains the custom logger class?  (I've used a modified ant.bat for
years to work around this, and I'm trying to get rid of my hacks.)
 
When defining -noclasspath and -cp for the -logger class (see ANT_ARGS
below), it fails with "The -cp argument must not be repeated". Since the
-noclasspath is not processed by ant.bat, two -cp arguments are passed,
as can be seen at the bottom.
 
(Seems to me the best way to get rid of the problem would be to
implement the enhancement requested by bug 36958
<http://issues.apache.org/bugzilla/show_bug.cgi?id=36958> .)
 
Thanks, Mike
 
--- Ant Environment Variables ---
ANT_ARGS=-noclasspath -logger com.ptc.tools.build.PTCLogger -cp
L:/tools_vs/lib/BuildSupport-ant.jar
ANT_HOME=D:\Programs\apache-ant-1.7.0RC1
ANT_OPTS=-Xmx1024M
 
--- Command executed ---
ant -f build_at_desktop.xml clean
 
--- Selected output from ant.bat ---
set _USE_CLASSPATH=yes
 
if "L:\Windchill\codebase;D:\Programs\jdk1.5.0_06\jre\lib\rt.ja
r;D:\Programs\jdk1.5.0_06\lib\tools.jar;T:\sde\classes\junit.jar" == ""
set _USE_CLASSPATH=no
 
if ""build_at_desktop.xml"" == ""-noclasspath"" goto clearclasspath
 
if ""clean"" == ""-noclasspath"" goto clearclasspath
 
set ANT_CMD_LINE_ARGS=-f build_at_desktop.xml clean
 
if _USE_CLASSPATH == no goto findAntHome
 
if not _r == _\ goto findAntHome
 
if "yes" == "no" goto runAntNoClasspath
 
"D:\Programs\jdk1.5.0_06\bin\java.exe" -Xmx1024M -classpath
"D:\Programs\apache-ant-1.7.0RC1\lib\ant-launcher.jar" 
"-Dant.home=D:\Programs\apache-ant-1.7.0RC1"
org.apache.tools.ant.launch.Launcher -noclasspath -logger
com.ptc.tools.build.PTCLogger -cp L:/tools_vs/lib/BuildSupport-ant.jar
-cp
"L:\Windchill\codebase;D:\Programs\jdk1.5.0_06\jre\lib\rt.jar;D:\Program
s\jdk1.5.0_06\lib\tools.jar;T:\sde\classes\junit.jar" -f
build_at_desktop.xml clean The -cp argument must not be repeated

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org