How To Run Ant FTP / Telnet / Rexec Task كيفية تشغيل بروتوكول نقل الملفات النمل / تلنت / rexec مهمة
Ant النملة (java software) from Apache Foundation is a popular build tool (often used successfully with other release management tasks) which replaces make. (برنامج جافا) من اباتشي المءسسه هي اداة بناء الشعبية (وكثيرا ما تستخدم بنجاح مع الافراج عن المهام الاداريه الأخرى) الذي يحل محل تقدم.
“Apache Ant is a Java-based build tool. "اباتشي النملة هو جافا - القائمة اداة بناء. In theory, it is kind of like Make, but without Make’s wrinkles. ومن الناحية النظريه ، وهو نوع من مثل تقديم ، ولكن من دون تقديم 'sالتجاعيد. “ "
Included in Ant are optional tasks like نمله المدرجه في المهام مثل اختياريه FTP بروتوكول انتقال الملف & Telnet. & تلنت. For example the FTP Task allows you to communicate with FTP servers (get / put / list etc.). على سبيل المثال بروتوكول نقل الملفات المهمة يتيح لك الاتصال لخدمة بروتوكول نقل الملفات (الحصول على / وضع / قائمة وما الى ذلك).
Unfortunately they don’t work out of box and not well documented. وللاسف لا يعملون خارج الاطار وغير موثقه جيدا. In this article we will explain the whole procedure in six simple steps. ونحن في هذه المادة سوف يشرح العملية بأكملها في ست خطوات بسيطة.
To use them follow the steps below: لاستخدامها اتباع الخطوات الواردة ادناه :
- Download تنزيل jakarta-oro جاكرتا - اورو and و commons-net - المشاعات صافي library. المكتبه.
Note: The links above allow you to download the version I tested them with. ملاحظه : وصلات اعلاه تسمح لك تنزيل نسخة الاول اختبار لهم. - Create a lib directory for your project if you have not already done so. إنشاء مكتبة دليل للمشروع الخاص بك اذا كنت لم تفعل ذلك.
- Extract the jar file jakarta-oro*.jar from استخراج الجره الملف جاكرتا - جرة من اورو *. jakarta-oro جاكرتا - اورو library you have downloaded and copy it to the lib directory you created. المكتبه قمت بتنزيل نسخة الى مكتبه دليل قمت بانشائه.
Note: ملاحظه :- If you have downloaded from the links in step 1 then the exact file name is jakarta-oro-2.0.8.jar اذا كان لديك تنزيلها من الروابط في الخطوة 1 ثم على وجه الدقه هو اسم الملف جاكرتا - أورو - 2.0.8.jar
- Ensure that the file is copied to the lib directory and not to any of its sub-directories الملف ضمان ان يتم نسخها الى مكتبه دليل وليس إلى أي من دون ادلة
- Extract the jar file commons-net*.jar file from جرة استخراج ملف المشاعات - صافي جرة الملف من *. commons-net - المشاعات صافي library you have downloaded and copy it to the lib directory. المكتبه قمت بتنزيل نسخة الى مكتبه دليل.
Note: ملاحظه :- If you have downloaded from the links in step 1 then the exact file name is commons-net-1.4.0.jar اذا كان لديك تنزيلها من الروابط في الخطوة 1 ثم الدقيق المشاعات هو اسم الملف - صافي - 1.4.0.jar
- Ensure that the file is copied to the lib directory and not to any of its sub-directories الملف ضمان ان يتم نسخها الى مكتبه دليل وليس إلى أي من دون ادلة
- Add the ftp taskdef at the top: اضافة بروتوكول نقل الملفات في اعلى taskdef :
- Add the appropriate task to your build.xml file. اضافة مناسبة مهمة لbuild.xml الملف الخاص بك. An example task to upload a directory is as follows: ومن الامثله المهمة لتحميل الدليل على النحو التالي :
- Run Ant by including the lib directory in classpath. نمله البعيد من قبل بما في مكتبه دليل classpath. An example would be: وربما يكون المثل :
ant -lib lib upload النملة - مكتبة مكتبة تحميلNote: I just had to include the lib directory to ensure all its jar files are automatically included. ملاحظه : انا فقط قد لتشمل مكتبه دليل لضمان الجره جميع الملفات اليه آليا.
Note: ملاحظه :
- The same procedure can be used to run Ant Telnet and RExec Tasks. نفس الاجراء يمكن ان تستخدم لتشغيل التلنت والنملة rexec المهام. Only the task name and parameters in build.xml file will change. فقط اسم والمعالم المهمة في build.xml الملف التغيير. Check the corresponding manuals for details. التحقق من الادله للحصول على تفاصيل المقابلة.
- I have promoted the use of lib directory (within project) to keep your jar files. لقد شجعت استخدام مكتبه دليل (في اطار المشروع) ان تبقى جرة الملفات الخاصة بك. This makes your jar files available only to your project. وهذا يجعل من الملفات الخاصة بك جرة متاحة فقط للمشروع الخاص بك. There are two other alternatives. وهناك بدائل اخرى اثنين. First you can keep them in %ANT_HOME%\lib directory. اولا يمكنك الاحتفاظ بها في ant_home ٪ ٪ \ مكتبه دليل. This makes them available to all projects for all users in that machine. وهذا يجعلها متاحة للجميع المشاريع لجميع المستخدمين فى هذا الجهاز.
You can also keep them in ${user.home}/.ant/lib . يمكنك ايضا الاحتفاظ بها في $ () user.home /.ant / مكتبة.The location of ${user.home}/.ant/lib is somewhat dependent on the JVM. موقع user.home $ () /.ant / مكتبة نوعا ما تعتمد على jvm. On Unix systems ${user.home} maps to the user’s home directory whilst on recent versions of Windows it will be somewhere such as C:\Documents and Settings\username\.ant\lib. على انظمة الينكس $ () user.home خرائط المستخدم الى الصفحه الرئيسية دليل على حين ان الاصدارات الاخيرة من ويندوز وسيكون مكان ما مثل جيم : \ المستندات والاعدادات \ اسم المستخدم \. نمله \ مكتبه.
Enjoy! يتمتع!
Filed under المقدم بمقتضى Headline News أهم الانباء , ، How To كيف , ، Java Software برنامج جافا , ، Tech Note ملاحظه تقنيه | |
| |
RSS 2.0 ار اس اس 2،0 | |
Trackback this Article | هذه المادة |
Email this Article ارسل هذه المادة
You may also like to read ويمكنك ايضا ان تقرأ |




April 6th, 2006 at 6:41 am السادس من نيسان / ابريل ، 2006 في الساعة 6:41
Dear Sir, سيدي العزيز ،
I followed the six steps, but the example didn’t work. تابعت الخطوات الست ، ولكن المثال لا يعمل. When I execute “ant -lib lib upload” the following message is printed: وعندما تنفذ "النملة - مكتبة مكتبة تحميل" الرسالة التالية تطبع :
C:\Temp\testeRemoto\build.xml:25: Could not create task or type of type: ج : \ مؤقت \ testeremoto \ build.xml : 25 : لا يمكن خلق نوع من مهمة او النوع : http://ftp .
Ant could not find the task or a class this task relies upon. تعذر العثور على نمله مهمة او من الدرجة تعتمد عليها هذه المهمة.
This is common and has a number of causes; the usual وهذا أمر له عدد من الاسباب المعتاده
solutions are to read the manual pages then download and حلول لقراءة الصفحات بعد ذلك دليل وتحميل
install needed JAR files, or fix the build file: تثبيت ملفات يحتاج جرة ، او في تحديد بناء الملف :
- You have misspelt ‘ftp’. -- لقد اخطأ في الهجاء 'بروتوكول نقل الملفات'.
Fix: check your spelling. فيكس : تحقق من التهجيه.
- The task needs an external JAR file to execute -- احتياجات مهمة خارجي لتنفيذ الملف جرة
and this is not found at the right place in the classpath. وهذا امر غير موجود في المكان المناسب في classpath.
Fix: check the documentation for dependencies. فيكس : التحقق من وثائق الاعتماد.
Fix: declare the task. فيكس : اعلن المهمة.
- The task is an Ant optional task and the JAR file and/or libraries -- هذه المهمة هي مهمة نمله الاختياري والجره الملف و / أو المكتبات
implementing the functionality were not found at the time you تنفيذ لم يتم العثور على وظائف كانت في ذلك الوقت كنت
yourself built your installation of Ant from the Ant sources. تبني نفسك التثبيت نمله نمله من المصادر.
Fix: Look in the ANT_HOME/lib for the ‘ant-’ JAR corresponding to the فيكس : أبحث في ant_home / مكتبه ل'نمله -' المقابلة لجره
task and make sure it contains more than merely a META-INF/MANIFEST.MF. المهمة والتأكد من انها تحتوي على اكثر من مجرد meta-inf/manifest.mf.
If all it contains is the manifest, then rebuild Ant with the needed اذا كان يحتوي على كل ما هو واضح ، ثم إعادة بناء اللازمة مع نمله
libraries present in ${ant.home}/lib/optional/ , or alternatively, المكتبات الموجودة في $ () ant.home / ليب / اختياري / أو بدلا من ذلك ،
download a pre-built release version from apache.org تحميل بنيت قبل الافراج عن نسخة من apache.org
- The build file was written for a later version of Ant -- بناء ملف كتب لاحق نسخة من النملة
Fix: upgrade to at least the latest release version of Ant فيكس : الارتقاء الى ما لا يقل عن اطلاق سراح اخر نسخة من النملة
- The task is not an Ant core or optional task -- المهمة ليست نمله او الاختياري المهمة الاساسية
and needs to be declared using . ويحتاج الى استخدام المعلنة.
- You are attempting to use a task defined using -- انت تسعى الى استخدام مهمة محددة باستخدام
or but have spelt wrong or not ولكن قد وردت او خاطءه او لا
defined it at the point of use عرفه عند نقطة استخدام
Remember that for JAR files to be visible to Ant tasks implemented لنتذكر ان جره الى ملفات تكون واضحة لتنفيذ المهام نمله
in ANT_HOME/lib, the files must be in the same directory or on the في ant_home / مكتبة ، يجب أن تكون الملفات في نفس الدليل او على
classpath
Please neither file bug reports on this problem, nor email the الملف عله لا يرجى تقارير عن هذه المشكلة ، ولا البريد الالكتروني
Ant mailing lists, until all of these causes have been explored, نمله القوائم البريديه ، وحتى كل هذه الاسباب تم استكشاف ،
as this is not an Ant bug. ان هذه هي علة لا نمله.
Total time: 0 seconds الوقت الاجمالى : 0 ثانية
Thank you. شكرا لك.
Cordially, وديا ،
Marcelo. مارسيلو.
April 6th, 2006 at 9:24 am السادس من نيسان / ابريل ، 2006 في الساعة 9:24
You need to add the taskdef for انت بحاجة الى اضافة لtaskdef http://ftp . See the article (updated) for details. انظر المادة (محدث) للاطلاع على التفاصيل.
August 26th, 2006 at 6:40 am اب / اغسطس 26th ، 2006 في الساعة 6:40
Hi اهلا
I followed the steps outlined in the article and تابعت الخطوات المبينه في المادة و
copied the jars to my %ANT_HOME%\lib directory. نسخت الجرار الى بلدي ant_home ٪ ٪ \ مكتبه دليل.
I also added the jars in classpath. كما انني واضاف جرار في classpath.
Still when I run my ftp task I get the following message: عندما كنت لا تزال بلادي تشغيل بروتوكول نقل الملفات المهمة احصل على الرسالة التالية :
taskdef class org.apache.tools.ant.taskdefs.optional.net.FTP cannot be found taskdef الدرجة org.apache.tools.ant.taskdefs.optional.net.ftp لا يمكن العثور
Thanks, شكرا ،
Nikesh نيكش
August 26th, 2006 at 9:09 am اب / اغسطس 26th ، 2006 في الساعة 9:09
Please install the ant optional jars, specifically the one for الرجاء تثبيت النملة الاختياري الجرار ، وعلى وجه التحديد لأحد http://ftp .
September 28th, 2006 at 9:42 am ايلول / سبتمبر 28th ، 2006 في الساعة 9:42
i followed the steps and got this error تابعت الخطوات وحصلت على هذا الخطأ
Error reading project file C:\apache-ant-1.6.5\build_ftp.xml: Invalid byte 1 of 1-byte UTF-8 sequence خطأ في قراءة ملف المشروع ج : \ اباتشي - النملة - 1.6.5 \ build_ftp.xml : غير صحيح بايت 1 من 1 بايت - سلسلة الرموز العالمية لتحوير الهيءه - 8
September 29th, 2006 at 3:27 pm ايلول / سبتمبر 29th ، 2006 في الساعة 3:27
i deleted all th ant dirs, cleared the classpaths and downloaded afresh copy of bin dist. انا بحذف جميع ال نمله dirs ، برا classpaths والتحميل من جديد نسخة من بن لDistr.
everything works great even with out classpaths. كل شيء على ما يرام كبيرة حتى مع classpaths بها.
hope this helps someone else على امل ان يساعد شخص آخر
December 13th, 2006 at 7:21 am كانون الاول / ديسمبر 13th ، 2006 في الساعة 7:21
i face this error.. الوجه الاول لهذا الخطأ..
BUILD FAILED: java.lang.NoClassDefFoundError: org/apache/commons/net/ftp/FTPClient بناء فشل java.lang.noclassdeffounderror : org / اباتشى / المشاعات / صافي / بروتوكول نقل الملفات / ftpclient
my target i supplied in build.xml file is : هدفي الاول في الموردة build.xml الملف :
can u plz helpe out to resolve this problem. ش plz helpe يمكن بها حل هذه المشكلة.
December 13th, 2006 at 7:25 am كانون الاول / ديسمبر 13th ، 2006 في الساعة 7:25
continued… تابع…
—————————————- --------------
July 13th, 2007 at 1:36 am يوليو 13th ، 2007 في الساعة 1:36
Hi, اهلا ،
I want to use telnet task for connecting to a unix server and start build there. اريد ان استخدام تلنت مهمة لربط لخادم يونكس والبدء في بناء هناك. I tried and its working. وحاولت عملها. But the problem is, after i give a build command in telnet, its immediately comming out. لكن المشكلة ، وبعد ان تعطي القيادة في بناء تلنت ، وخرج على الفور. If i add a tag to wait for some string, then it works. واذا اضيف الى علامة الانتظار لبعض جمله ، ثم أنه يعمل. Now the issue is i cannot have the same read tag for a fixed string always. المساله هي الآن لا استطيع ان اقرأ لها نفس العلامه لأجل محدد الخيط دائما. If my build fails in then the string can be different. واذا فشل في بناء بلدي بعد ذلك الخيط يمكن ان تكون مختلفة. How can we solve this? كيف يمكننا حل هذه؟
August 2nd, 2007 at 4:55 pm اب / اغسطس 2nd ، 2007 في الساعة 55/16
BUILD FAILED: java.lang.NoClassDefFoundError: I got this error too :-org/apache/commons/net/ftp/FTPClient بناء فشل java.lang.noclassdeffounderror : حصلت على هذا الخطأ أيضا : -org/apache/commons/net/ftp/ftpclient
When I built it after adding to the classpath from cmd prompt, it is giving me the following error: عندما بنيت عليه بعد اضافة الى classpath من اجل CMD ، ومن اعطائي الخطأ التالية :
C:\ATG\ATG2006.3\NutriSystem\build.xml:210: error during FTP transfer: java.net. ج : \ ATG \ atg2006.3 \ nutrisystem \ build.xml : 210 : خطأ خلال بروتوكول نقل الملفات نقل : java.net.
SocketException: Connection reset Socketexception : اعادة الصدد