ant

Running a .cmd file from Ant

▼魔方 西西 提交于 2019-12-19 07:30:10
问题 Is it possible to run a command (.cmd file) from Ant? Would I need to write Java code for this? 回答1: <exec executable="cmd" os="Windows XP"> <arg value="/C"/> <arg value="command to run"/> </exec> 回答2: You can do this by using the exec task. From the ant exec documentation: Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd using the /c switch. So you would need to do something like: <exec executable="cmd"> <arg value="

Running a .cmd file from Ant

瘦欲@ 提交于 2019-12-19 07:30:08
问题 Is it possible to run a command (.cmd file) from Ant? Would I need to write Java code for this? 回答1: <exec executable="cmd" os="Windows XP"> <arg value="/C"/> <arg value="command to run"/> </exec> 回答2: You can do this by using the exec task. From the ant exec documentation: Note that .bat files cannot in general by executed directly. One normally needs to execute the command shell executable cmd using the /c switch. So you would need to do something like: <exec executable="cmd"> <arg value="

Upload file via Ant FTP task in Maven

筅森魡賤 提交于 2019-12-19 07:28:12
问题 I'm trying to upload a file using an Ant task. If I use Ant directly the file is uploaded, but if I call the ant task via Maven (using the maven-antrun-plugin ) I get the following error: An Ant BuildException has occured: The following error occurred while executing this line: /home/me/proj/build.xml:15: Problem: failed to create task or type ftp Cause: the class org.apache.tools.ant.taskdefs.optional.net.FTP was not found. This looks like one of Ant's optional components. Action: Check that

New to Ant, ClassNotFoundException with JUnit

帅比萌擦擦* 提交于 2019-12-19 07:23:26
问题 I've been scratching my head over this for a while now (Googled a bunch, looked through other related SO posts to no avail). I have a Java program comprised of two files, Logic and Tests . Tests contains about a hundred JUnit tests, and I've gotten 100% success rate with said tests by calling javac *.java followed by java org.junit.runner.JUnitCore Tests . However when I run my build.xml with a simple ant -verbose test (in order to follow the output since I'm new to all this), I get the

Ant and Eclipse

被刻印的时光 ゝ 提交于 2019-12-19 07:20:22
问题 Hi I am a beginner java programmer and recently I've started reading Thinking in Java 4th edition to consolidate my knoledge of java after I read Head first Java.Problem is that this book has it's own library and I can't seem to make it work in eclipse even after I did everything it said on the website guide.I instaled ant acordinly with this video guide http://www.youtube.com/watch?v=XJmndRfb1TU and i'm getting this error: "Unable to locate tools.jar.Expected to find it in C:\Program files

Eclipse v4.7.1a: ant build broken: Launch configuration <build.file> references non-existing project <container project>

假装没事ソ 提交于 2019-12-19 06:41:10
问题 It seems that since eclipse v4.7.1a (fresh install), it is no more possible to execute any ant build. Each time it fails with the following message: Launch configuration <name of build file> references non-existing project <name of the containing project> We have tested it with many different configuration (eclipse-jee, eclipse-rcp ...), each time with a fresh eclipse v4.7.1a install. After further investigation, this occurs only if the build.xml file in not under a "java" kind of project,

Eclipse v4.7.1a: ant build broken: Launch configuration <build.file> references non-existing project <container project>

我的未来我决定 提交于 2019-12-19 06:41:08
问题 It seems that since eclipse v4.7.1a (fresh install), it is no more possible to execute any ant build. Each time it fails with the following message: Launch configuration <name of build file> references non-existing project <name of the containing project> We have tested it with many different configuration (eclipse-jee, eclipse-rcp ...), each time with a fresh eclipse v4.7.1a install. After further investigation, this occurs only if the build.xml file in not under a "java" kind of project,

Ant conditional if within a macrodef

爷,独闯天下 提交于 2019-12-19 05:22:07
问题 Within ant, I have a macrodef. Assuming I have to use this macrodef, and there is a item inside said macrodef that I want to run if the property special.property exists and is true, what do I do? I currently have <macrodef name="someName"> <sequential> <someMacroDefThatSetsTheProerty /> <some:thingHereThatDependsOn if="special.property" /> <sequential> </macrodef> Which doesn't work - the some:thingHereThatDependsOn doesnt have an "if" attribute, and I cannot add one to it. antcontrib is not

Ant conditional if within a macrodef

泪湿孤枕 提交于 2019-12-19 05:20:12
问题 Within ant, I have a macrodef. Assuming I have to use this macrodef, and there is a item inside said macrodef that I want to run if the property special.property exists and is true, what do I do? I currently have <macrodef name="someName"> <sequential> <someMacroDefThatSetsTheProerty /> <some:thingHereThatDependsOn if="special.property" /> <sequential> </macrodef> Which doesn't work - the some:thingHereThatDependsOn doesnt have an "if" attribute, and I cannot add one to it. antcontrib is not

iterate int xml file using ant

筅森魡賤 提交于 2019-12-19 04:46:45
问题 I´ve a Xml file with the struct below. I want to read the nod by node and call a specific task with the values without commom separator.In Ant this is possible ? <projects> <!-- first node --> <project> <name> </name> <url> </url> <package> </package> </project> <!-- Second node --> <project> <name> </name> <url> </url> <package> </package> </project> <projects> thanks! 回答1: Use the XSLT task to process the input XML file into an ANT script that is subsequently executed. Example |-- build.xml