dcsimg
Executing Ant War Task Programmatically.
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Amit_Shah
Posted On:   Thursday, July 20, 2006 04:36 AM

Hi, I am using ant 1.5.2 version. I have created a class which extends org.apache.tools.ant.taskdefs.War class. The code is as below. Note : The war file used already contains some files. public class TestWARTask extends War { public TestWARTask() { project = new Project(); project.init(); taskName = "war"; taskType = "war"; target = new Target(); } public static void main(String[] args) { TestWARTask warTask = new TestWARTask(); warTask.setDestFile(new File("E:\test.war")); warTask.setBasedir(new File("E:\AddFiles")); warTask.setWebxml(new File("E:\web.xml"));    More>>

Hi,
I am using ant 1.5.2 version.
I have created a class which extends org.apache.tools.ant.taskdefs.War class. The code is as below.

Note : The war file used already contains some files.

public class TestWARTask extends War {
public TestWARTask() {
project = new Project();
project.init();
taskName = "war";
taskType = "war";
target = new Target();

}

public static void main(String[] args) {
TestWARTask warTask = new TestWARTask();
warTask.setDestFile(new File("E:\test.war"));
warTask.setBasedir(new File("E:\AddFiles"));
warTask.setWebxml(new File("E:\web.xml"));
warTask.setUpdate(true);
warTask.execute();
}
}

When i execute the above war task, the war file gets updated,but when I open the war file using winzip, only the files which are newly added are shown.
When I extract the files from winzip it extracts all the files(inlcuding the old ones too).

Also when I execute the same task using a build.xml file,it works fine. The build.xml is as follows :



destfile="E: est.war"
basedir="E:AddFiles"
webxml="E:web.xml"
update="true">




When the above target is executed it updates the war file and the winzip shows all the files.

Can you please tell me what should be done, so that all the files are viewed in winzip(new and the old ones both) ?

Thanks in advance

   <<Less

Re: Executing Ant War Task Programmatically.

Posted By:   Robert_Lybarger  
Posted On:   Monday, July 24, 2006 10:10 PM

This sounds entirely like a "winzip" question, and not at all like an "ant" question. You should check if there are settings in winzip as to what it is showing you. (?anyone?)
About | Sitemap | Contact