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
Picon

[ANN] Animal Sniffer 1.12 Released

Hi,

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

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
(http://mojo.codehaus.org/animal-sniffer/animal-sniffer/index.html).
This helps you track down the offending jar file when you see
UnsupportedClassVersionError.

* A set of ANT tasks
(http://mojo.codehaus.org/animal-sniffer/animal-sniffer-ant-tasks/index.html
)
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
(
http://mojo.codehaus.org/animal-sniffer/animal-sniffer-enforcer-rule/index.html
)
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:
BUILD FAILED
file:S:/xxxxx/xxxxxx/nftempdir/servletswar.xml:5: 
Error while expanding S:\xxxxx\xxxxx\webapps\theservlets.war
        at 
org.apache.tools.ant.taskdefs.Expand.expandFile(Expand.java:164)
        at 
org.apache.tools.ant.taskdefs.Expand.execute(Expand.java:127)
        at 
org.apache.tools.ant.Task.perform(Task.java:341)
        at 
org.apache.tools.ant.Target.execute(Target.java:309)
        at 
org.apache.tools.ant.Target.performTasks(Target.java:336)
        at 
org.apache.tools.ant.Project.executeTarget(Project.java:1339)
        at 
org.apache.tools.ant.Project.executeTargets(Project.java:1255)
        at 
org.apache.tools.ant.Main.runBuild(Main.java:609)
        at 
org.apache.tools.ant.Main.start(Main.java:196)
        at 
org.apache.tools.ant.Main.main(Main.java:235)
Caused by: 
java.util.zip.ZipException: invalid stored block lengths
        at 
java.util.zip.InflaterInputStream.read(Unknown Source)
        at 
(Continue reading)

phoenix | 19 Oct 04:47 2014
Picon

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" />

         </fileset>

</path>

<target name="init">  

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

</target>

(Continue reading)

Erik Itter | 20 Sep 16:13 2014
Picon

move rename date pattern

Hello,

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" .../>
</move>

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)

WebServices Development | 13 Sep 00:08 2014

How to use a variable value in ANT refid

I am trying to use a value of a variable with path refid in ANT.

I tried different approaches and am getting different errors. Is it possible to use a variable value for refid?

    <path id="compile.classpath">

        <path refid="shared.lib.classpath" />

        <path refid="ext.classpath" />

        <path refid="common.classpath" />

        <path refid="${ant.refid:seq.1}" />

        <path refid="ear.lib.classpath" />

    </path>

Reference ${ant.refid:seq.1} not found.



OR



    <path id="compile.classpath">

        <path refid="shared.lib.classpath" />

(Continue reading)

SimonBate | 12 Sep 21:59 2014

native2ascii and JDK/JRE

[Trying again with a better subject and no garbage at the end...sorry.]

Excuse me if this has been answered or documented elsewhere, I've been searching 
for the past couple of hours and have found very little on this issue.

I have a project that uses the native2ascii task, that works fine on a machine 
with JRE 6 (1.6.0_65-b14-462-11M4609).

However, when trying to run the same project under JRE 7 (1.7.0_67-b01), it 
fails with the Java message "Error starting Sun's native2ascii."

Eventually I was able to fix this issue by copying tools.jar from a JDK into the 
lib file of my JRE.

I'm surprised to have to go to such lengths to fix this issue. I'm also 
surprised there's not more documentation in the native2ascii task in the Ant 
manual pointing out this problem.

Is there a more elegant solution out there than copying tools.jar? (I'm using 
Apache Ant under the DITA Open Toolkit; most DITA OT users just use the JRE.)

Thanks for any help or suggestions,
Simon

--------------------------------------------------------------------------------
Simon F. Bate
Senior Technical Consultant, Scriptorium Publishing Services, Inc.
sbate <at> scriptorium.com <mailto:sbate <at> scriptorium.com>
phone: 919.433.2606
twitter:  <at> simonbate
(Continue reading)

SimonBate | 12 Sep 21:44 2014

Nice to meet you in Sacramento

Excuse me if this has been answered or documented elsewhere, I've been searching 
for the past couple of hours and have found very little on this issue.

I have a project that uses the native2ascii task, that works fine on a machine 
with JRE 6 (1.6.0_65-b14-462-11M4609).

However, when trying to run the same project under JRE 7 (1.7.0_67-b01), it 
fails with the Java message "Error starting Sun's native2ascii."

Eventually I was able to fix this issue by copying tools.jar from a JDK into the 
lib file of my JRE.

I'm surprised to have to go to such lengths to fix this issue. I'm also 
surprised there's not more documentation in the native2ascii task in the Ant 
manual pointing out this problem.

Is there a more elegant solution out there than copying tools.jar? (I'm using 
Apache Ant under the DITA Open Toolkit; most DITA OT users just use the JRE.)

Thanks for any help or suggestions,
Simon

--------------------------------------------------------------------------------
Simon F. Bate
Senior Technical Consultant, Scriptorium Publishing Services, Inc.
sbate <at> scriptorium.com <mailto:sbate <at> scriptorium.com>
phone: 919.433.2606
twitter:  <at> 
It was nice to meet you in Sacramento at the STC Summit.

(Continue reading)

Erez Inchy | 3 Sep 18:29 2014

[replaceregexp] - Couldn't rename temporary file inside RAD tool

Hi,

We are having exactly same issue in ANT.

 

Any idea how to resolve it?

 

Thanks,

Erez Inchy.


Build Developer.
Casino & Games Builds | 888 Holdings | Herzliya Pituach, Israel.
P: +972-73288-8620 | m: +972-58-4321355

 

 



This email message and its attachments are for the sole use of the intended recipient(s) and may not be shared with any other party. They may contain confidential information of 888 Holdings plc or its direct and indirect subsidiaries (together, the “888 Group”) and are to be regarded as confidential information under any non-disclosure agreement. Any review, use, disclosure or distribution by persons or entities other than the intended recipient(s) is prohibited. Nothing in this message is capable of or intended to create any legally binding obligation. The 888 Group will only ever assume a legally binding obligation where recorded in a written agreement duly executed by the authorized signatories of the relevant 888 Group company. The 888 Group accepts no liability for any personal views expressed in this message. If you are not the intended recipient, please contact the sender by return and destroy all copies of the original message and its attachments. Thank you
foolhunger | 27 Aug 18:31 2014
Picon

Ant - Pathelement with wildcard only works in Javac forked mode?

I encountered below issue when using Ant.

My ANT script snippets:

<path id="id.compile.classpath">
  <pathelement location="src/compile_lib1/*" />
  <pathelement location="src/compile_lib2/*" /></path>
<javac srcdir="${module.root}/${src.root}" destdir="${swap.target.classes}"
  nowarn="${javac.nowarn}" debug="${javac.debug}" fork="${javac.fork}"
  classpathref="id.compile.classpath"
includeAntRuntime="${javac.includeAntRuntime}">
  <include name="**/*.java"/></javac>

When set fork=”true” in javac task, the wildcard pathelement works fine,
but when forked is set to false, Ant seems failed to interpret wildcard
correctly. (compilation failed, due to classpath error).

Any suggestions
Thanks.

--

-- 
<Stay Hungry, Stay Foolish>
------------------------------------------
Best Regards
foolhunger

Gmane