Replacing characters in Ant property

Here is the solution without scripting and no external jars like ant-conrib: The trick is to use ANT’s resources: There is one resource type called “propertyresource” which is like a source file, but provides an stream from the string value of this resource. So you can load it and use it in any task like … Read more

Ant: How to execute a command for each file in directory?

Use the <apply> task. It executes a command once for each file. Specify the files by means of filesets or any other resource. <apply> is built-in; no additional dependency needed; no custom task implementation needed. It’s also possible to run the command only once, appending all files as arguments in one go. Use the parallel … Read more

How to copy a directory using Ant

Copy contents including the directory itself. <copy todir=”${dest.dir}” > <fileset dir=”${src.dir.parent}”> <include name=”${src.dir}/**”/> </fileset> </copy> Note: ${src.dir} is relative to ${src.dir.parent}, and not a full path

How do I use Nant/Ant naming patterns?

The rules are: a single star (*) matches zero or more characters within a path name a double star (**) matches zero or more characters across directory levels a question mark (?) matches exactly one character within a path name Another way to think about it is double star (**) matches slash (/) but single … Read more

Should JAVA_HOME point to JDK or JRE?

If you’re doing any sort of development, or building with Maven or Ant, you need to point to the JDK (Java Development Kit) where utilities such as javac (the Java Compiler) reside. Otherwise, you can point to the JRE (Java Runtime Environment). The JDK contains everything the JRE has and more. If you’re just executing … Read more

Error executing command ‘ant’ on Mac OS X 10.9 Mavericks when building for Android with PhoneGap/Cordova

The error message proved to be true as Apache Ant isn’t in the path of Mac OS X Mavericks anymore. Bulletproof solution: Download and install Homebrew by executing following command in terminal: ruby -e “$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)” Install Apache Ant via Homebrew by executing brew install ant Run the PhoneGap build again and it should … Read more

Ant path style patterns

Ant-style path patterns matching in spring-framework: The mapping matches URLs using the following rules: ? matches one character * matches zero or more characters ** matches zero or more ‘directories’ in a path {spring:[a-z]+} matches the regexp [a-z]+ as a path variable named “spring” Some examples: com/t?st.jsp – matches com/test.jsp but also com/tast.jsp or com/txst.jsp … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)