Create jfreechart-1.5.3 JAR from source code

As illustrated here, you can clone the repository, check out the branch with the desired tag and use maven to build the release JARs. See also Migration from JFreeChart 1.0.x $ git clone jfreechart $ pushd jfreechart $ git fetch –tags $ git tag –list … v1.5.3 $ git checkout v1.5.3 Note: switching to … Read more

How to pull out a substring in Ant

I use scriptdef to create a javascript tag to substring, for exemple: <project> <scriptdef name=”substring” language=”javascript”> <attribute name=”text” /> <attribute name=”start” /> <attribute name=”end” /> <attribute name=”property” /> <![CDATA[ var text = attributes.get(“text”); var start = attributes.get(“start”); var end = attributes.get(“end”) || text.length(); project.setProperty(attributes.get(“property”), text.substring(start, end)); ]]> </scriptdef> …….. <target …> <substring text=”asdfasdfasdf” start=”2″ end=”10″ … Read more

CreateProcess error=206, The filename or extension is too long

I had the same problem. I used <fileset dir=”${basedir}/build”> <include name=”**/*.class”/> </fileset> inside findbugs target and it seems that there is too much .class files to be passed to findbug (?via command line?) because when I used <fileset dir=”${basedir}/build/com/domain/package”> <include name=”**/*.class”/> </fileset> that had low number of classes, the error was gone. So, I solved … Read more

Using ant to detect os and set property

Move your condition out of the <target />, as your target probably isn’t invoked. <condition property=”isWindows”> <os family=”windows” /> </condition> <condition property=”isLinux”> <os family=”unix” /> </condition>

Ant, download fileset from remote machine

Since you haven’t specified I’ll assume that your local and remote systems are unix based and therefore support rsync and ssh. A more cross-platform solution is challenging… Example Configure SSH Generate an SSH key (specify an empty passphrase): ssh-keygen -f rsync This will generate 2 files, corresponding to the private and public keys: |– rsync … Read more

How to include ant-contrib.jar dynamically in Ant

The best way is to put the Ant-Contrib jarfile inside you project. For example, let’s say the build.xml is in the root of your project. Create a directory called ant.lib\ant-contrib inside your project, then put the ant-contrib*.jar in this folder. You can use this method for other optional Ant tasks that you might need (for … Read more

Ant – how to get all files’ name in a specific folder

You’re on the right track, use manifestclasspath task. The jarfile attribute is used to create relative links to the jars contained in the fileset. <manifestclasspath property=”jar.classpath” jarfile=”${client_work_dir}/HelloWorld.jar”> <classpath> <fileset name=”” dir=”${client_work_dir}/lib” includes=”*.jar”/> </classpath> </manifestclasspath> <jar jarfile=”${client_deploy_dir}/HelloWorld.jar” basedir=”${client_work_dir}/compiled”> <manifest> <attribute name=”Main-Class” value=”HelloWorld.Main”/> <attribute name=”Class-Path” value=””${jar.classpath}”/> </manifest> </jar>

integrating JaCoCo in sonar using Ant

The following is an ANT build that is configured to run a junit unit test and use jacoco for code coverage reporting. The results are uploaded to Sonar and finally ivy is used to download 3rd party jars and manage classpaths. Example ├── ├── build.xml ├── ivy.xml └── src ├── main │   └── java … Read more