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
Al Le | 31 Jul 11:10 2014
Picon
Picon

How to override a property that was set in the command line via "-D..."

user <at> ant.apache.org

How to override a property that was set in the command line via "-D..."

Hello.

Could someone please help me with the following situation?

I have some ant scripts that are used in two ways:

1. Standalone build, i.e. the script is executed directly from the command line
2. As a part of a larger build -- then the script is called via 'ant' from another
    script (here we have a main and a called scripts).

Each script uses a property 'outFileName' that specifies where to write some output to.
Both the main and the called script use this property. The script gets the value of
the property passed from the caller.

The root script (i.e. the one called from the command line) gets passed the value of
'outFileName' via the "-DoutFileName=..." option.

When the main script calls a called script, it may specify another value for the
property 'outFileName' (using the nested 'property' element). The called script
should notice no difference how it was called (i.e. whether it is called from the
command line or as a called script from another script).

Now the propblem: It turns out that the properties specified via "-D=..." are set
as *user* properties. Hence it's not possible to redefine them via the nested
elements. Ant not even using a script task with a call 'project.setProperty()'.

How would you solve this situation? I would not like introduce properties with a
different name, since my goal is to have scripts that can be 'customized' by
specifying a property with a well known name ('outFileName') -- be it on the
command line or trough a nested element of an ant task. Thik of it as of script
interface.

The only possible solution I can think of is to specify a custom property helper,
but that's too much IMO and makes scripts not 'portable'.

Here's an example that I hope would explain the problem (I use ant 1.8.4 but I think
the same problem would also occur with ant 1.9.x):

-- Main build file 'main.xml' --

<project name="Main" default="run">
	
    <target name="run">
    	<echo>Main: outFileName: ${outFileName}</echo>
    	
    	<ant antfile="called.xml" target="run">
    		<property name="outFileName" value="OTHER VALUE"/>
    	</ant>
    </target>
	
</project>

-- Called build file 'called.xml' --
<project name="Called" default="run">
	
    <target name="run">
    	<echo>Called: outFileName: ${outFileName}</echo>
    </target>

</project>

-- Command line --
ant -f main.xml -DoutFileName=START

-- Actual output --
run:
     [echo] Main: outFileName: START
run:
     [echo] Called: outFileName: START

-- Expected (desired) output --
run:
     [echo] Main: outFileName: START
run:
     [echo] Called: outFileName: OTHER VALUE

Any help will be much appreciated.

Al
Eric Fetzer | 17 Jul 18:47 2014

StarTeam Upgrade

We're upgrading our StarTeam version from 2009 to 14.2 and somewhere between 2009 and 14, there was a
complete rewrite in the SDK.  I'm wondering if my StarTeam tasks will work once I get on the other side of
the upgrade?  Any help?

Thanks,
Eric
Lee, Sarek | 2 Jul 00:04 2014

StarTeam Label Trouble with Ant


Hello,
     I'm new to Ant and am working on it for StarTeam build automation. I've scoured the internet for a similar
problem but I was unable to find any, and everyone at my work believe it should run fine.

My goal is to apply a build label (named "buildLabelPIPAppCVS") to a  directory ("AdvancedAttr")  and all
its subfolders/files on our StarTeam server. This is executed as one of the steps in the build, and needs to
draw information from variables defined earlier in the build (like "buildLabelPIPAppCVS").

Below is the code snippet  I am running:

                ...

                <echo message=""/>
                                <echo message="2S. Apply Build Label in StarTeam"/>
                                <tstamp>
                                                <format property="nowstamp" pattern="yyyyMMddHHmmss" locale="en"/>
                                </tstamp>
                                <stlabel URL="starteamapp.staples.com:49201/MMS_VendorItemPortal/AdvancedAttr"
           username="thisismyuser"
           password="thisismypassword"
           label= "${buildLabelPIPAppCVS}"
           lastbuild="${nowstamp}"
           description="-This description is currently unavailable.-"
                                />

                ...

However,  when I run the above snippet, the build fails and I receive the error message shown below:

BUILD FAILED
C:\StarTeamWorkingFolders\MMS_VendorItemPortal\Mainline\MMS_VendorItemPortal\5_D
eploy\antBuildScripts\05_executePIPBuild.xml:104: The following error occurred w
hile executing this line:
C:\StarTeamWorkingFolders\MMS_VendorItemPortal\Mainline\MMS_VendorItemPortal\5_D
eploy\antBuildScripts\10_packageBuild.xml:79: Problem: failed to create task or
type stlabel
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.

Software Versions:

-          Ant 1.9.4

-          JDK 1.6.0u21

-          Windows XP Prof. SP3

My question then is:

                What could be causing the "Failed to create task or type stlabel" in my code, and what can I do to fix this problem?

Thanks,

Sarek Lee
IT Intern

Gmane