Eclipse中使用ANT_MySQL
Eclipse
前言
ant是java开发者工具箱的重要一环,junit,xdoclet等都与它紧密关联,程序员可能习惯了IDE提供的自动构建,甚至部署的功能,从而忽略了ant本身,其实,主流的IDE通常是内置ant任务来完成这些工作的,熟悉ant内在的机理,可以阅读或简单修改build.xml无疑可以帮助你更灵活地集成、管理应用项目,如果需要学习maven这种开源项目管理解决方案,也是要以理解ant为基础的哟。另外,使用ant的过程实际上对构建进行了文档化,它是无关于IDE的,想象一下,你的同事中可能三分之一在用JbuilderX,三分之一用eclipse,还有一些是别的。
本人使用eclipse3.0.1,以前的构建和发布工作都由myeclipse插件作了,趁周末实践了一下手动构建,记此备忘。
实践
准备工作:这是我的个人习惯,把所有公用的类库jar置于一个固定目录,分好类,不要丢在一个文件夹下,如jakarta-commons、hibernate、spring、struts等,这些是源码构建时需要用到的,在部署时可能有一些不用再打进去了,比如servlet.jar。如果你们有自己的framework,也一并放在这里。然后,打开eclipse,进入Windows->Preferences->Java->User Libraries,增加一个自己的库,比如说mylib,把刚才那些公共的jar全部添入,这样有个好处,在eclipse项目中,不用再看到烦人的长长的jar列表了,比较整洁。
下来正式进行:
1.新建一个Java Project,此时就不要再选你的j2ee插件内置的一些选项了,至简即可。
2.在root下建几个文件夹,我们在网上下载的开源项目中经常可以看到这些,比如:
src - 源码
classes - 编译
web - jsp等
lib - 库,这里可以简单地把mylib下的东东copy过来,便于将来发布源码。
dlist - 输出的jar或war
当然,我们要建一个build.xml,eclipse中会出现一个蚂蚁的小图标,一般这个文件建立后,下一个项目简单的copy过去,稍加改动就可以了。
3.打开项目的属性页,在Java Build Path的库选项中,加入我们自定义的公共库mylib.至于Builders方式就不用改了,使用默认的Java Builer即可,我只是项目部署时使用ant,平常的排错工作就交给IDE吧。
4.重中之重,写你的build.xml,网上文章很海,我这里就不再

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics











CrystalDiskMark is a small HDD benchmark tool for hard drives that quickly measures sequential and random read/write speeds. Next, let the editor introduce CrystalDiskMark to you and how to use crystaldiskmark~ 1. Introduction to CrystalDiskMark CrystalDiskMark is a widely used disk performance testing tool used to evaluate the read and write speed and performance of mechanical hard drives and solid-state drives (SSD). Random I/O performance. It is a free Windows application and provides a user-friendly interface and various test modes to evaluate different aspects of hard drive performance and is widely used in hardware reviews

foobar2000 is a software that can listen to music resources at any time. It brings you all kinds of music with lossless sound quality. The enhanced version of the music player allows you to get a more comprehensive and comfortable music experience. Its design concept is to play the advanced audio on the computer The device is transplanted to mobile phones to provide a more convenient and efficient music playback experience. The interface design is simple, clear and easy to use. It adopts a minimalist design style without too many decorations and cumbersome operations to get started quickly. It also supports a variety of skins and Theme, personalize settings according to your own preferences, and create an exclusive music player that supports the playback of multiple audio formats. It also supports the audio gain function to adjust the volume according to your own hearing conditions to avoid hearing damage caused by excessive volume. Next, let me help you

Fermat's last theorem, about to be conquered by AI? And the most meaningful part of the whole thing is that Fermat’s Last Theorem, which AI is about to solve, is precisely to prove that AI is useless. Once upon a time, mathematics belonged to the realm of pure human intelligence; now, this territory is being deciphered and trampled by advanced algorithms. Image Fermat's Last Theorem is a "notorious" puzzle that has puzzled mathematicians for centuries. It was proven in 1993, and now mathematicians have a big plan: to recreate the proof using computers. They hope that any logical errors in this version of the proof can be checked by a computer. Project address: https://github.com/riccardobrasca/flt

MetaMask (also called Little Fox Wallet in Chinese) is a free and well-received encryption wallet software. Currently, BTCC supports binding to the MetaMask wallet. After binding, you can use the MetaMask wallet to quickly log in, store value, buy coins, etc., and you can also get 20 USDT trial bonus for the first time binding. In the BTCCMetaMask wallet tutorial, we will introduce in detail how to register and use MetaMask, and how to bind and use the Little Fox wallet in BTCC. What is MetaMask wallet? With over 30 million users, MetaMask Little Fox Wallet is one of the most popular cryptocurrency wallets today. It is free to use and can be installed on the network as an extension

Title: Learn more about PyCharm: An efficient way to delete projects. In recent years, Python, as a powerful and flexible programming language, has been favored by more and more developers. In the development of Python projects, it is crucial to choose an efficient integrated development environment. As a powerful integrated development environment, PyCharm provides Python developers with many convenient functions and tools, including deleting project directories quickly and efficiently. The following will focus on how to use delete in PyCharm

NetEase Mailbox, as an email address widely used by Chinese netizens, has always won the trust of users with its stable and efficient services. NetEase Mailbox Master is an email software specially created for mobile phone users. It greatly simplifies the process of sending and receiving emails and makes our email processing more convenient. So how to use NetEase Mailbox Master, and what specific functions it has. Below, the editor of this site will give you a detailed introduction, hoping to help you! First, you can search and download the NetEase Mailbox Master app in the mobile app store. Search for "NetEase Mailbox Master" in App Store or Baidu Mobile Assistant, and then follow the prompts to install it. After the download and installation is completed, we open the NetEase email account and log in. The login interface is as shown below

Cloud storage has become an indispensable part of our daily life and work nowadays. As one of the leading cloud storage services in China, Baidu Netdisk has won the favor of a large number of users with its powerful storage functions, efficient transmission speed and convenient operation experience. And whether you want to back up important files, share information, watch videos online, or listen to music, Baidu Cloud Disk can meet your needs. However, many users may not understand the specific use method of Baidu Netdisk app, so this tutorial will introduce in detail how to use Baidu Netdisk app. Users who are still confused can follow this article to learn more. ! How to use Baidu Cloud Network Disk: 1. Installation First, when downloading and installing Baidu Cloud software, please select the custom installation option.

With the rapid development of network technology, our lives have also been greatly facilitated, one of which is the ability to download and share various resources through the network. In the process of downloading resources, magnet links have become a very common and convenient download method. So, how to use Thunder magnet links? Below, I will give you a detailed introduction. Xunlei is a very popular download tool that supports a variety of download methods, including magnet links. A magnet link can be understood as a download address through which we can obtain relevant information about resources.
