Java Mailing List Archive

http://www.junlu.com/

Subjects
Home
mod jk2 https
Donation of JAXP 1 3 Sources to Apache
R annoyances
RE: Finding out when the aspnet admin worker process has recycled
Favorite Linux Distribution
eigenvalues of a circulant matrix
Apache Install
Reachin apache from outside
Ant should have an ext directory
Warning: Documentroot doesn 't exist
Can this be Done?
RE: Multilanguage Application
RE: Simple Question On setting up Sub Domain site
Lack of independence in anova()
How to close connection instead of sending 403?
winning the case for ANT
Re: adding php
New Ant GUI 'Ant 's Nest '
Narrowing Down A Strange Problem
Ant Task: sshexec
R Graph Gallery : categorization of the graphs
I 've been hacked, I need some help please
RE: Anyone working with DotNetNuke?
RE: Exception Handling Opinion
hex format
RE: IIS stopped working :(
<for > Build Failed:problem
RE: Separation of Objects from Logic
RE: Tracking pages with long request execution time
sending email to multiple destination
Web Site
ant UI
Easy cut & paste from Excel to R?
Win32 Apache Restart
Improving Tasks
HELP! PLEASE!
RE: Adding Controls to a Page
read table
RE: ASPNET account doesn 't exist!
Best way to uninstall Apache2 on red hat
from win to linux how to web page
XMLParseException changes and creation of XMLLocator2
Re Post: rewrite backslash to forward slash
Target or macrodef?
Page display problem XPSP2
Authentication problems
Dynamic Dictionary Data Type?
Newbie unable access my www from outside
off topic question: Latex and R in industries
Conflict between xtable and Hmisc when using Sweave?
Very old problem without any new solution
mod rewrite help
Basic Authentication question
RE: Code Security
calling ant from java program
prevent double signing
Re: Controlling Copy/Paste/Print
Using R to illustrate the Central Limit Theorem
web server slow too much slow
access to user directories
Links
Home
Official R Project Site
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
calling ant from java program

calling ant from java program

2004-08-30       - By Antoine Levy-Lambert
Reply:     <<     11     12     13     14     15     16     17  

Hi
you also need ant-commons-net.jar
Antoine
> Hi,
>
>  Antoine thx for reply,i had kept both commons-net.jar and jakarta-oro.jar
> files in ant/lib
> ,but when i call from java program it does not work(it works if build.xml
> didn't have any optional task)
> when i run from command it works well and send the file,
> but the problem is when i run this using the below java program it is not
> able to recognize ftp task
> (not only ftp also telnet,script etc say optional tasks)
> it says could not find ftp task i tried to run the program using
> java -cp commons-net.jar;jakarta-oro.jar ..but still it is not taking up..
> is there any thing i need to keep in class path ?.
>
> here is the snippet i have been working on
>
> <?xml version="1.0" encoding="UTF-8"?>
> <project basedir="." default="ftp" name="build">
>    
> <target name="ftp">
>   <ftp server="server.com"
>        remotedir="/root/temp"
>        userid="user"
>        password="pwd"
>        separator="/"
>        verbose="yes"
>        binary="yes"
>   >
>     <fileset dir="c:\temp">
>       <include name="temp.txt"/>
>     </fileset>
>   </ftp>
> </target>  
>    </project>
>
>
> import org.apache.tools.ant.*;
>
> import java.io.*;
> import java.util.*;
>
>
>
> public class AntRunner
> {
>      private Project project;
>
>      public void init(String _buildFile, String _baseDir) throws
> Exception
>      {
>          project = new Project();
>          try { project.init(); }
>          catch (BuildException e)
>              { throw new Exception("The default task list could not be
> loaded."); }
>
>          // Set the base directory. If none is given, "." is used.
>          if (_baseDir == null) _baseDir=new String(".");
>          try { project.setBasedir(_baseDir); }
>          catch (BuildException e)
>              { throw new Exception("The given basedir doesn't exist, or
> isn't a directory."); }
>    
>          if (_buildFile == null) _buildFile=new String("build.xml");
>          try { ProjectHelper.getProjectHelper().parse(project, new
> File(_buildFile)); }
>          catch (BuildException e)
>              { throw new Exception("Configuration file "+_buildFile+" is
> invalid, or cannot be read."); }
>      }
>
>
>      public void runTarget(String _target) throws Exception
>      {
>          // Test if the project exists
>          if (project == null) throw new Exception("No target can be
> launched because the project has not been initialized. Please call the
'init'
> method first !");
>
>          // If no target is specified, run the default one.
>          if (_target == null) _target = project.getDefaultTarget();
>
>          // Run the target
>          try { project.executeTarget(_target);  }
>          catch (BuildException e)
>          { throw new Exception(e.getMessage()); }
>      }
>
>          public static void main(String args[])
>       {
>       try{
>
>        
>         AntRunner ar=new AntRunner();        
>         ar.init("build.xml",".");        
>         ar.runTarget(null);
>
>       }catch(Exception e)
>       {
>         e.printStackTrace();
>       }
>   }
>
> }
>
> thanks
> Murali
>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)


©2008 junlu.com - Jax Systems, LLC, U.S.A.