ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Obermeit <ton...@compuserve.com>
Subject Re: Running build.xml located in jar file
Date Sun, 12 Jan 2003 19:48:29 GMT
I've grabbed that example, it looks pretty straight forward.  Thanks for 
your help!

Enjoy your day

Tony

At 12:43 PM 12/01/2003 -0500, you wrote:
>To do it programmatically, I'd recommend you just emulate what Main.main() 
>does in your own class.  See a post I made providing a basic skeleton of 
>Java code to run an Ant project from a servlet from a couple of weeks ago 
>(or so).  You wouldn't do it as a java.io.File (at least not without 
>refactoring Ant).  You'd first pull a resource from a JAR (or URL) to a 
>local filesystem file, then run that through Ant's existing mechanisms.
>
>         Erik
>
>
>
>On Saturday, January 11, 2003, at 02:44  PM, Tony Obermeit wrote:
>>Thanks for the quick reply,
>>
>>Is it possible to do this programmatically?  I can then reference the 
>>build file and pass it to the ant.Main class as a java.io.File object?
>>
>>Tony
>>
>>At 05:32 AM 11/01/2003 -0500, you wrote:
>>>Currently Ant only runs a build file located on the filesystem.
>>>
>>>A workaround would be to ship with a minimal build.xml along with the 
>>>JAR which does an <unjar> to bootstrap and <ant> the primary build
file, 
>>>although this is probably just as good as deploying the real build file.
>>>
>>>It would be nice for Ant to be modified to allow getting at build files 
>>>from an archive resource or from a URL.
>>>
>>>         Erik
>>>
>>>
>>>On Saturday, January 11, 2003, at 12:51  AM, Tony Obermeit wrote:
>>>>I have created a jar file that include the ant class files, a build.xml 
>>>>file and my application class files.
>>>>
>>>>I have not been able to get ant to find the build file within the jar 
>>>>file.  If I place the build file in the same directory as the jar file, 
>>>>and run ant as follows:
>>>>
>>>>java -cp application.jar org.apache.tools.ant.Main, ant runs the build 
>>>>file successfully.  The problem is when the build file is not in a 
>>>>directory, but instead is bundled within the jar file, then ant reports 
>>>>"Build file: build.xml does not exist, Build Failed".
>>>>
>>>>I'm using a single jar file (which includes ant class files, 
>>>>application class files and build.xml) so that my entire application, 
>>>>and it's setup scripts (build.xml) can be easily deployed.  For what 
>>>>it's worth, the build file contains sql tasks that I used to create 
>>>>database tables when running the application.
>>>>
>>>>Any help would be appreciated.
>>>>
>>>>Thanks
>>>>
>>>>Tony
>>>>
>>>>
>>>>
>>>>--
>>>>To unsubscribe, e-mail:
>>>><mailto:ant-user-unsubscribe@jakarta.apache.org>
>>>>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>>>
>>>
>>>--
>>>To unsubscribe, e-mail:
>>><mailto:ant-user-unsubscribe@jakarta.apache.org>
>>>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>>
>>
>>
>>
>>--
>>To unsubscribe, e-mail:
>><mailto:ant-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>
>>
>
>
>--
>To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>




--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message