| Home » Newcomers » Newcomers » Ant/Eclipse problem: import using property fails
 Goto Forum:| 
| Ant/Eclipse problem: import using property fails [message #134682] | Fri, 03 February 2006 12:21  |  | 
| Eclipse User  |  |  |  |  | Hello, all.  I am wrestling with an Ant/Eclipse problem.  I want to define a user.properties file that contains a project name, and then
 have ant use that name to import a particular file.
 
 My test build.xml looks like this :
 
 <?xml version="1.0"?>
 <project name="test">
 <loadproperties srcFile="user.properties"/>
 <import file="${projectname}.xml"  />
 </project>
 
 
 and my user.properties file contains:
 
 projectname=required
 
 so ant should try to import "required.xml".  When I run ant from the
 command line, it succeeds.  But when I look at my build.xml in Eclipse,
 I get the warning:
 
 Cannot find ${projectname}.xml imported from [my build path]/build.xml
 
 Does anyone have any ideas why this occurs?  My system is running
 Eclipse 3.1.0 (Build id I20050627-1435) on Linux, and my ant classes are
 org.eclipse.ant.core 3.1.0, org.eclipse.ant.ui 3.1.0, and org.apache.ant
 1.6.5.
 
 Any help or suggestions anyone could provide, or suggestions towards
 which group to post this to, would be greatly appreciated.
 Many thanks,
 Ed
 |  |  |  |  | 
| Re: Ant/Eclipse problem: import using property fails [message #134731 is a reply to message #134682] | Fri, 03 February 2006 14:08   |  | 
| Eclipse User  |  |  |  |  | We have a bug within the Ant editor warning/problem indication. Eclipse will properly run the buildfile.
 The warning in the editor is incorrect.
 
 Logged as
 https://bugs.eclipse.org/bugs/show_bug.cgi?id=126392
 
 The workaround is to use
 <project name="test">
 <property file="user.properties"/>
 <import file="${projectname}.xml" />
 </project>
 
 Thanks
 Darins
 
 "Ed Beaty" <edbeaty@charter.net> wrote in message
 news:ds03eo$rb6$1@utils.eclipse.org...
 > Hello, all.  I am wrestling with an Ant/Eclipse problem.  I want to
 > define a user.properties file that contains a project name, and then
 > have ant use that name to import a particular file.
 >
 > My test build.xml looks like this :
 >
 > <?xml version="1.0"?>
 > <project name="test">
 > <loadproperties srcFile="user.properties"/>
 > <import file="${projectname}.xml"  />
 > </project>
 >
 >
 > and my user.properties file contains:
 >
 > projectname=required
 >
 > so ant should try to import "required.xml".  When I run ant from the
 > command line, it succeeds.  But when I look at my build.xml in Eclipse,
 > I get the warning:
 >
 > Cannot find ${projectname}.xml imported from [my build path]/build.xml
 >
 > Does anyone have any ideas why this occurs?  My system is running
 > Eclipse 3.1.0 (Build id I20050627-1435) on Linux, and my ant classes are
 > org.eclipse.ant.core 3.1.0, org.eclipse.ant.ui 3.1.0, and org.apache.ant
 > 1.6.5.
 >
 > Any help or suggestions anyone could provide, or suggestions towards
 > which group to post this to, would be greatly appreciated.
 > Many thanks,
 > Ed
 >
 |  |  |  |  | 
| Re: Ant/Eclipse problem: import using property fails [message #134745 is a reply to message #134731] | Fri, 03 February 2006 14:19   |  | 
| Eclipse User  |  |  |  |  | BTW...thanks for the excellent explaination of the problem and test case...man that makes my life soooo much easier.
 Also the bug has been fixed and will be in the next Eclipse 3.2 integration
 build.
 
 Thanks
 Darins
 
 "Darin Swanson" <Darin_Swanson@us.ibm.com> wrote in message
 news:ds09nk$6pm$1@utils.eclipse.org...
 > We have a bug within the Ant editor warning/problem indication.
 > Eclipse will properly run the buildfile.
 > The warning in the editor is incorrect.
 >
 > Logged as
 > https://bugs.eclipse.org/bugs/show_bug.cgi?id=126392
 >
 > The workaround is to use
 > <project name="test">
 >  <property file="user.properties"/>
 >  <import file="${projectname}.xml" />
 > </project>
 >
 > Thanks
 > Darins
 >
 > "Ed Beaty" <edbeaty@charter.net> wrote in message
 > news:ds03eo$rb6$1@utils.eclipse.org...
 > > Hello, all.  I am wrestling with an Ant/Eclipse problem.  I want to
 > > define a user.properties file that contains a project name, and then
 > > have ant use that name to import a particular file.
 > >
 > > My test build.xml looks like this :
 > >
 > > <?xml version="1.0"?>
 > > <project name="test">
 > > <loadproperties srcFile="user.properties"/>
 > > <import file="${projectname}.xml"  />
 > > </project>
 > >
 > >
 > > and my user.properties file contains:
 > >
 > > projectname=required
 > >
 > > so ant should try to import "required.xml".  When I run ant from the
 > > command line, it succeeds.  But when I look at my build.xml in Eclipse,
 > > I get the warning:
 > >
 > > Cannot find ${projectname}.xml imported from [my build path]/build.xml
 > >
 > > Does anyone have any ideas why this occurs?  My system is running
 > > Eclipse 3.1.0 (Build id I20050627-1435) on Linux, and my ant classes are
 > > org.eclipse.ant.core 3.1.0, org.eclipse.ant.ui 3.1.0, and org.apache.ant
 > > 1.6.5.
 > >
 > > Any help or suggestions anyone could provide, or suggestions towards
 > > which group to post this to, would be greatly appreciated.
 > > Many thanks,
 > > Ed
 > >
 >
 >
 |  |  |  |  | 
| Re: Ant/Eclipse problem: import using property fails [message #134771 is a reply to message #134745] | Fri, 03 February 2006 15:17  |  | 
| Eclipse User  |  |  |  |  | No, thank YOU for logging the bug, then fixing it so quickly! Rock on,
 Ed
 
 Darin Swanson wrote:
 > BTW...thanks for the excellent explaination of the problem and test
 > case...man that makes my life soooo much easier.
 > Also the bug has been fixed and will be in the next Eclipse 3.2 integration
 > build.
 >
 > Thanks
 > Darins
 >
 > "Darin Swanson" <Darin_Swanson@us.ibm.com> wrote in message
 > news:ds09nk$6pm$1@utils.eclipse.org...
 >
 >>We have a bug within the Ant editor warning/problem indication.
 >>Eclipse will properly run the buildfile.
 >>The warning in the editor is incorrect.
 >>
 >>Logged as
 >>https://bugs.eclipse.org/bugs/show_bug.cgi?id=126392
 >>
 >>The workaround is to use
 >><project name="test">
 >> <property file="user.properties"/>
 >> <import file="${projectname}.xml" />
 >></project>
 >>
 >>Thanks
 >>Darins
 >>
 >>"Ed Beaty" <edbeaty@charter.net> wrote in message
 >>news:ds03eo$rb6$1@utils.eclipse.org...
 >>
 >>>Hello, all.  I am wrestling with an Ant/Eclipse problem.  I want to
 >>>define a user.properties file that contains a project name, and then
 >>>have ant use that name to import a particular file.
 >>>
 >>>My test build.xml looks like this :
 >>>
 >>><?xml version="1.0"?>
 >>><project name="test">
 >>><loadproperties srcFile="user.properties"/>
 >>><import file="${projectname}.xml"  />
 >>></project>
 >>>
 >>>
 >>>and my user.properties file contains:
 >>>
 >>>projectname=required
 >>>
 >>>so ant should try to import "required.xml".  When I run ant from the
 >>>command line, it succeeds.  But when I look at my build.xml in Eclipse,
 >>>I get the warning:
 >>>
 >>>Cannot find ${projectname}.xml imported from [my build path]/build.xml
 >>>
 >>>Does anyone have any ideas why this occurs?  My system is running
 >>>Eclipse 3.1.0 (Build id I20050627-1435) on Linux, and my ant classes are
 >>>org.eclipse.ant.core 3.1.0, org.eclipse.ant.ui 3.1.0, and org.apache.ant
 >>>1.6.5.
 >>>
 >>>Any help or suggestions anyone could provide, or suggestions towards
 >>>which group to post this to, would be greatly appreciated.
 >>>Many thanks,
 >>>Ed
 >>>
 >>
 >>
 >
 >
 |  |  |  | 
 
 
 Current Time: Fri Oct 31 01:37:05 EDT 2025 
 Powered by FUDForum . Page generated in 0.05801 seconds |