Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Tools / April 2005

Tip: Looking for answers? Try searching our database.

Ant Error: Could not create task or type of type: propertyfile

Thread view: 
James Kimble - 07 Apr 2005 03:16 GMT
I'm fighting a problem with ant compiling an application I adopted
from a previous developer. The odd thing is the exact same setup
works fine on windows and on Suse 9.2 but on Red Hat 9.0 I get the
error shown in my subject. The script is very simple:

-------------------------------------------------------------------

 <property name="project.name" value="MyProject"/>
 <property name="project.name.short" value="MyProject"/>
 <property name="project.jar.file" value="build/myproject.jar"/>

 <property name="project.version.file" location="."
value="version.properties"/>

 <target name="prepare-version">
   <tstamp>
     <format property="build.date" pattern="MMM dd yyyy HH:mm:ss"/>
   </tstamp>

   <propertyfile file="${project.version.file}" comment="The build
number is incremented by Ant.">
     <entry  key="build.version.major" type="int" default="1"/>
     <entry  key="build.version.minor" type="int" default="22"/>
     <entry  key="build.number" type="int" default="0" operation="+"/>
     <entry  key="build.date" type="date" value="now" pattern="MMM dd
yyyy HH:mm:ss"/>
   </propertyfile>

   <property file="${project.version.file}"/>

   <echo file="${project.src.folder}/myproject/Version.java">package
myproject;
                            ~~~~
                            ~~~~

-------------------------  snip snip
--------------------------------------

The above script fails on line 12:

  <propertyfile file="${project.version.file}" comment="The build
number is incremented by Ant.">

The file refered to in ${project.version.file} is "version.properties"
and
it is in the same directory as the build and project xml files. It's
permissions are set world rwx. What heck is causing this? I've played
with
ANT_HOME, the CLASSPATH, and I've run out of ideas.

Anyone have a guess??? Any help much appreciated...

James Kimble
"." - 07 Apr 2005 15:51 GMT
> I'm fighting a problem with ant compiling an application I adopted
> from a previous developer. The odd thing is the exact same setup
> works fine on windows and on Suse 9.2 but on Red Hat 9.0 I get the
> error shown in my subject. The script is very simple:

It would have been helpful if you posted the error message.

What version of Ant are you running? It is possible that you are running
an older version of Ant on the Red Hat system. I'm not sure what versions
of Ant support <propertyfile> but I have found scripts I inherit have
things like <dirname>, <macrodef> and <import>.

Solution: get a version of Ant that supports <propertyfile>.

NOTE: Ant 1.5.3 to Ant 1.6.2 supports <propertyfile>. If you are running
Ant 1.5.3 or higher this is not you issue.

Second possibility, what is basedir for the <project> tag set to? If it is
not set at all this might have different affects on different platforms.

Without the actual error message that is about the best I could suggest.

> -------------------------------------------------------------------
>
[quoted text clipped - 44 lines]
>
> James Kimble

Signature

Send e-mail to: darrell dot grainger at utoronto dot ca



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.