YuGiOhJCJ Mailing-List | 31 Dec 00:17 2014

Execute the target only if source files have changed


I have a target that transforms files XCF into PNG by calling the "convert" command.
I would like that this target does not execute if source files (i.e., the XCF files ) have changed.
I have tried with the "uptodate" task but it does not work.
Each time I run ant, the "convert" command is called.

Any idea ?

Thank you.
Best regards.

This is my build.xml file:
<project name="xcf2png" default="png">
	<target name="png-check">
		<uptodate property="png-uptodate" targetfile="png/**.*.png">
			<srcfiles dir= "xcf" includes="**/*.xcf"/>
	<target name="png" depends="png-check" unless="png-uptodate">
		<mkdir dir="png"/>
		<exec executable="convert">
			<arg value="-verbose"/>
			<arg value="-alpha"/>
			<arg value="on"/>
			<arg value="-background"/>
			<arg value="none"/>
			<arg value="-layers"/>
			<arg value="merge"/>
			<arg value="xcf/icon.xcf"/>
(Continue reading)

Tanguy Thomas | 21 Dec 03:05 2014

New user (liferay), getting all the time BUILD FAILED message


I am not familiar anymore to Java, trying hard to self learn from a
Microsoft development background. I installed Apache Ant, following the
"Liferay in Action" manual. Everything worked fine up to the point of
setting up "hello-world" example with Apache Ant ...

Tomcat is installed (Liferay base portal is working) and Apache Ant is
installed but when I run the command

create.bat hello-world "Hello World"

It takes a lot of time and I get several errors about some of the servers
not available (but I see the ivy cache being loaded with some stuffs). I
tried with and without Windows Firewall turned on.
The output will always be BUILD FAILED:

hello-world "
Hello World"
Buildfile: F:\COEProjects\plugins\liferay-plugins-sdk-6.2\portlets\build.xml
[ivy:resolve] :: Apache Ivy 2.3.0 - 20130110142753 ::
[ivy:resolve] :: loading settings :: file =
[ivy:resolve] :: problems summary ::
[ivy:resolve] :::: WARNINGS
(Continue reading)

Matt Bertolini | 18 Dec 05:18 2014

Parse jar:file prefix to Resource


I am writing some custom ant tasks and I want to support files inside of
zip/jar files. I have noticed that some ant tasks use the
jar:file:/path/to/a.jar!/path/in/jar/file.xml syntax but I can't seem to
get it work. How do I use this pattern in my tasks and map them to a
Resource object like FileResource, URLResource, etc. Thanks.

Matt Bertolini
Eric Fetzer | 5 Dec 19:24 2014

<exec> kicking my butt with something very simple

I've tried all I can figure out to try on a simple unix command in redhat.  I can run the command line and it works
fine, but ant can't run it to save its life:
<exec executable="sort" dir=".">
  <arg value="-u"/>
  <arg value="existingFile"/>
  <arg value=">"/>
  <arg value="newFile"/>
I've tried putting all the args together, putting some of the args together...  If I run it like this, I get
"sort: stat failed: >: No such file or directory.  If I put the "existingFile > newFile" in the same arg, I get
"sort: stat failed existingFile > newFile: No such file or directory.  If I make the executable "bash" and
use "sort" as the first argument, I get:  [exec] /bin/sort: /bin/sort: cannot execute binary file.  If I run
it as bash and put all the arguments into a single arg value, I get: [exec] bash: sort -u existingFile >
newFile: No such file or directory.

This has got to be simple, please help!

Ryan Payton | 5 Dec 03:13 2014

Problems parsing <at> <at>


I am running into an issue using  <at>  <at>  in a .properties file. The variable is
a database password (I also tried using it in the username and still didn't
work), and fails our build since Ant is unable to connect to the database.
However, when I enter  <at>  <at>  <at>  in the .properties file, and leave the DB user's
password with  <at>  <at>  in it then everything works.

Has anyone encountered any issues like this? If so, what was your solution?
Also, would this be considered a bug, and should I file a bug report?

Thank you

This is a customer's issue, and we cannot change the password or use any
Alan Snyder | 10 Nov 22:24 2014

delete task and symlinks

I realize that I am late to the party and that there is an open RFE
<https://issues.apache.org/bugzilla/show_bug.cgi?id=56700> on this issue, but considering how
long this problem has been in existence, I want to make some comments (and maybe rant a bit, too).

First, I cannot tell you how surprised I was when I decided to add a symlink to a build product and suddenly my
build script tried to delete my installation of the JDK! Fortunately, it did not have permission to do so…

Then I checked the documentation. Sure enough, that is how delete works. I investigated alternatives, and
could not find a better one than exec rm. Sad, but true.

OK, so I solved my problem, but for the benefit of those who have not yet encountered this problem, I have to
say that having a delete operation that follows symlinks may be the most surprising and dumb and dangerous
thing I have ever encountered in software, and it is very hard to understand why after all these years it is
still that way. Is there anyone who actually wants this behavior? In other words, does it really need to be
an option or should it just be fixed to never follow symlinks? Even Unix rm does not have a follow-symlinks
option, and Unix was made for power users.

I’ve seen some supposed explanations for this behavior, but they sound lame to me. Some say that Ant
cannot avoid following symlinks because Java doesn’t support them. Well, that’s not true any more.
But regardless, would it not be sufficient to call File.delete() first and only if it fails call
File.isDirectory() to see if iteration is required?

Other comments suggest the problem has to do with file sets and such. I guess I don’t see this. Deleting a
directory (or a symlink that happens to point at a directory) is not a matter of enumerating all the files in
the directory tree and then deleting them. From the point of view of Ant tasks, it should be an atomic
(meaning not composite) operation: call File.delete(), if that fails, check File.isDirectory() and if
true, iterate and recurse. If I tell Ant to delete a bunch of files, that operation should be applied to each
one. If I tell Ant to delete one directory, that operation should be applied to that one directory (or
symlink). If someone wants more control over what gets deleted in a directory, let them specify the set of
files to be deleted.
(Continue reading)

Stephen Connolly | 5 Nov 11:36 2014

[ANN] Animal Sniffer 1.12 Released


The Mojo team is pleased to announce the release of Animal Sniffer version

Animal Sniffer provides tools to assist verifying that classes
compiled with a newer JDK/API are compatible with an older JDK/API.

The following tools are provided by animal sniffer:

* A command line tool to dump the class file version number
This helps you track down the offending jar file when you see

* A set of ANT tasks
for verifying that your classes comply with an API signature as well
as tasks for creating API signatures from a JDK, or a collection or
jar and class files, or a collection of other API signature files, or
combination of these elements.

* A rule for use in the maven-enforcer-plugin
for verifying that your classes comply with an API signature .

* A maven plugin
(Continue reading)

KM | 24 Oct 16:43 2014

exception expanding war file

Task is expanding a war file.  this has worked for all of my tests but not working at customer site.  the OS is
Windows Server 2008 R2. the exception is:
Error while expanding S:\xxxxx\xxxxx\webapps\theservlets.war
Caused by: 
java.util.zip.ZipException: invalid stored block lengths
java.util.zip.InflaterInputStream.read(Unknown Source)
(Continue reading)

phoenix | 19 Oct 04:47 2014

Ant with -Xlint:unchecked

I use ant 1.9.4 and jdk1.8,my build.xml file is follows:

<?xml version="1.0" encoding="UTF-8" ?>

<project name="demo" default="run" basedir=".">

<property name="src" value="src"/>

<property name="lib" value="src/lib"/>

<property name="dest" value="WEB-INF/classes"/>

<property name="dest_lib" value="WEB-INF"/>

<path id="Third-Part Lib">

         <fileset dir="${lib}">

       <include name="*.jar" />



<target name="init">  

         <mkdir dir="${dest}"/>  


(Continue reading)

Erik Itter | 20 Sep 16:13 2014

move rename date pattern


I am trying to automate my environment a little more and thought to do 
the following:

In directory $foo$ take file [\d\d\d\d-\d\d-\d\d zzz_today.ico] and 
rename it to [yyyy-mm-dd zzz_today.ico] filling in the actual current 
date. Further I'd like to rename another file [\d\d\d\d-\d\d-\d\d 
zzz_one week.ico] to [yyyy-mm-dd zzz_one week.ico], obviously meaning 
the actual current date plus seven days.

Guess I should be able to do it with some form of

<move todir="$foo$"...>
     <mapper type="regexp" .../>

but I am somewhat lost. I'd like to do it with the tasks provided if 
possible instead of writing my own task. All kinds of help/ advice/ 
examples appreciated, of course.

thx, Erik
WebServices Development | 15 Sep 17:15 2014

Need help with ANT javac classpath

I have an old application which is using JAXB version 1.0.  When I pull in the projects in Eclipse, it compiles
fine because it references the jaxb jars from my web-inf/lib.

When I am defining an ANT javac task for it, I get compilation errors because the jaxb classes from rt.jar
take preference.  I have not included the jars from JAVA_HOME in my javac task's classpath.

How can I set-up my javac task such that my project will still compile with ANT as it does in Eclipse?

P.S - I tried adding includejavaruntime="false"   and    includeantruntime="false" attributes -  both
together as well as individually - to the javac task - but I still get the error.  The error is  - 
createBinder() in ObjectFactory cannot override createBinder() in JAXBContext

Because it seems that when compiling in Eclipse, it uses the JAXBContext from the jaxb-api.jar that is part
of the project whereas when running ANT javac, it uses the JAXBContext from rt.jar – which gets added to
the classpath when running ANT – not part of my classpath parameter to javac.

What do I need to do to get this fixed?

This email transmission and any accompanying attachments may contain CSX privileged and confidential
information intended only for the use of the intended addressee. Any dissemination, distribution,
(Continue reading)