ant

How can I get the name of the last folder in my basedir path in Ant?

独自空忆成欢 提交于 2019-12-22 03:09:58
问题 Let's say my basedir = c:/projects/myapp/1.2 How can I get "1.2" in a property? 回答1: Check this out. <basename property="property.for.dirname" file="${basedir}"/> 来源: https://stackoverflow.com/questions/1178462/how-can-i-get-the-name-of-the-last-folder-in-my-basedir-path-in-ant

How to rename n files with ANT? (Batch Job)

旧街凉风 提交于 2019-12-22 01:38:11
问题 How can I rename 1..n file with ANT? I would like to rename any files with xxxx.default.properties to xxxx.local.properties . Thank you. 回答1: Using the move task you could do something like this: <move todir="my/src/dir" includeemptydirs="false"> <fileset dir="my/src/dir"/> <mapper type="glob" from="*.default.properties" to="*.local.properties"/> </move> Give it a try and let us know. 回答2: Use the move-task. There is also an example how to rename a set of files (last examples). 来源: https:/

How can I avoid this Ant Build error?

末鹿安然 提交于 2019-12-22 01:22:04
问题 What is this ant build error in eclipse? When I click the Ant Build I have the error message shown below. Build failed Reason: Unable to find an Ant file to run. Could you please help me solve it? 回答1: Quoting from here Create a new project in Eclipse After the project is created, look in the package explorer window pane on the left and right click on the src folder. There are two methods for the next step, you could either add a New > Class, and then copy and paste everything from your old

wsgen ant task ignore @webMethod(exclude=true) annotation

删除回忆录丶 提交于 2019-12-21 23:02:05
问题 I Have a web service implementation class in java and I use wsgen to generate the service end point classes. There is a public method in my SEI that I want to exclude from the web-service interface. It seems that the annotation @WebMethod (exclude=true) is meant to do that but it does not seem to work with the wsgen ant task. 回答1: This sounds like Issue #789 (bug in wsgen). Maye give the suggested workaround a try: As a temporary workaround with old impl, you can try removing the @WebMethod

How to make a property in Ant as mutable

坚强是说给别人听的谎言 提交于 2019-12-21 22:10:22
问题 I'm using ant condition task to check a file existence and directory existence and below is my code <project name="makeitmutable" basedir="." default="main"> <target name="main"> <condition property="folderexists?" value="Yeah" else="Nope"> <and> <available file="folderexistance" type="dir"/> <available file="a.zip" type="file"/> </and> </condition> <echo>before deleting "folderexistance" folder property folderexists?=${folderexists?}</echo> <delete dir="folderexistance"/> <!--after delete-->

Iterating over all filenames in a directory in Ant

徘徊边缘 提交于 2019-12-21 21:44:23
问题 I need to iterate over all files in a directory. But I need just the name of each file, not absolute paths. Here's my attempt using ant-contrib: <target name="store"> <for param="file"> <path> <fileset dir="." includes="*.xqm"/> </path> <sequential> <basename file="@{file}" property="name" /> <echo message="@{file}, ${name}"/> </sequential> </for> </target> The problem is that ${name} expression gets evaluated only once. Is there another approach to this problem? 回答1: From ant manual basename

How to emulate if-elseif-else in Ant without using Ant-contrib?

☆樱花仙子☆ 提交于 2019-12-21 21:44:05
问题 I need an if-elseif-else conditional statement in Ant. I do not want to use Ant-contrib. I tried the solution here <target name="condition.check"> <input message="Please enter something: " addproperty="somethingProp"/> <condition property="allIsWellBool"> <not> <equals arg1="${somethingProp}" arg2="" trim="true"/> </not> </condition> </target> <target name="if" depends="condition.check, else" if="allIsWellBool"> <echo message="if condition executes here"/> </target> <target name="else"

How can I get Ant to load and check a URL resource in a 'waitfor' task?

孤街浪徒 提交于 2019-12-21 21:38:52
问题 I am working on an Ant target for running tests, and I need to have an app server up and running before the tests start. I'm using the waitFor task to ping a URL until it gets a response. This works, except that I need to not only make sure the URL is simply accessible, but also check that a particular status string is present. This second requirement is simple on its own, with a get or telnet task, followed by a substring search. But the 'waitfor' task doesn't accept any nested elements

How can I make Ant use JAXB 2.2.x instead of Java 6 SE JAXB classes in javac?

谁说胖子不能爱 提交于 2019-12-21 21:37:12
问题 I'm in the process of updating a legacy application to use Java 6 SE instead of Java 5 SE. The app uses JAXB, and under Java 5 SE it have the JAXB reference implementation jars on the classpath. When I moved to Java 6 SE (update 38), I hit a few bumps (see linked Stackoverflow question) that I resolved with some help. So the next thing that is causing trouble is the project Ant build script. When the Ant compile task executes, it picks up the embedded version of JAXB that comes with Java 6 SE

Ant Zip Extracted Parent Directory

拈花ヽ惹草 提交于 2019-12-21 20:38:00
问题 I have several zip files that I need to unzip within an Ant target. All the zip files are in the same directory, and have the same internal directory and file structure. So I am using the following snippet to unzip all the zip files in the directory, but each zip file does not contain a parent folder at the root, so each successive zip file is unzipped and overwrites the previous files. <unzip dest="C:/Program Files/Samsung/Samsung TV Apps SDK/Apps"> <fileset dir="."> <include name="**/*.zip"