<?xml version="1.0" encoding="UTF-8"?><!-- mkdir javac jar clean 执行ant构建文件过后,没有修改任何相关的文件,第二遍执行ant,这时ant会提示任务已经完成的任务不再执行,记住这是任务级别的,这种情况包括在控制台上指定两个project-->
<project name="OurProject" default="archive" basedir="..\"><target name="init" description="创建文件夹"><mkdir dir="build\classes" description="用来放置类文件"/><mkdir dir="dist" description="用来放置打包文件"/></target><target name="compile" depends="init" description="编译源文件"><javac srcdir="src" destdir="build/classes"></javac></target><target name="archive" depends="compile" description="打包"><jar destfile="dist\project.jar" basedir="build\classes"></jar></target><target name="clean" depends="init" description="清除类文件和打包文件"><delete dir="build" description="如果该文件夹有打开的文件,删除失败"></delete><delete dir="dist"></delete></target>
</project><!--
执行ant构建文件过后,没有修改任何相关的文件,第二遍执行ant,这时ant会提示任务已经完成的任务不再执行,
比如任务是创建文件夹,可是文件夹已经创建了(可能是第一次执行构建文件时创建的,也有可能是手工创建的))
[mkdir] Skipping D:\Workspaces\AntTest\build\classes because it already exists.
记住这是任务级别的还有,比如,在控制台上指定两个project,D:\Workspaces\AntTest\src>ant init clean -verbose
可是执行project clean是仍会去执行project init,此时ant检查init中的任务已经执行过了,就不再执行其中的任务了,但是project init
还是会去执行,只不过没去执行其中的任务D:\Workspaces\AntTest\src>ant init clean -verbose
Apache Ant(TM) version 1.8.2 compiled on December 20 2010
Trying the default build file: build.xml
Buildfile: D:\Workspaces\AntTest\src\build.xml
Detected Java version: 1.6 in: C:\Program Files\Java\jre6
Detected OS: Windows 7
parsing buildfile D:\Workspaces\AntTest\src\build.xml with URI = file:/D:/Workspaces/AntTest/src/build.xml
Project base dir set to: D:\Workspaces\AntTest
Build sequence for target(s) `init' is [init]
Complete build sequence is [init, clean, compile, archive, ]init:
parsing buildfile jar:file:/E:/JavaEE/Data/Ant/apache-ant-1.8.2/lib/ant.jar!/org/apache/tools/ant/antlib.xml with URI = jar:file:/E:/JavaEE/Data/Ant/a
pache-ant-1.8.2/lib/ant.jar!/org/apache/tools/ant/antlib.xml from a zip file[mkdir] Created dir: D:\Workspaces\AntTest\build\classes[mkdir] Created dir: D:\Workspaces\AntTest\dist
Build sequence for target(s) `clean' is [init, clean]
Complete build sequence is [init, clean, compile, archive, ]init:[mkdir] Skipping D:\Workspaces\AntTest\build\classes because it already exists.[mkdir] Skipping D:\Workspaces\AntTest\dist because it already exists.clean:[delete] Deleting directory D:\Workspaces\AntTest\build[delete] Deleting directory D:\Workspaces\AntTest\build\classes[delete] Deleting directory D:\Workspaces\AntTest\build[delete] Deleting directory D:\Workspaces\AntTest\dist[delete] Deleting directory D:\Workspaces\AntTest\distBUILD SUCCESSFUL
Total time: 0 seconds
-->
详细解决方案
执行ant构建文件过后,没有修改任何相关的文件,第二遍执行ant,这时ant会提示任务已经完成的任务不再执行,记住这是任务级别的,这种情况包括在控制台上指定两个project
热度:74 发布时间:2024-01-17 03:30:38.0
相关解决方案
- eclipse ee版本 怎么新建和发布 web project
- dynamic web project怎么转成tomcat project
- Your project contains error(s), please fix them beforerunning your application.该怎么解决
- 新建java project,从已存在的工程导入解决方法
- 查询的有关问题,@project 已经声明过,变量名在批查询或存储过程内部中必须唯一
- Project Server 2007 表单验证 异常: 拒绝访问
- BlackBerry_JDE_PluginFull_1.1.2.201004161203-16.exe 怎么“Bulid Project”
- Android test project 编译方法
- web project 读取数据库内容有关问题
- 有哪位高手有microsoft project 2007的教程呀!要!多谢
- svn cannot 地图 the project with svn provider解决方法
- eclipse集成SVN导入项目时报错:cannot 地图 the project with svn provider 解决方法: 原因:可能是subcli
- SVN:cannot 地图 the project with svn provider解决方法
- 鬼老又给偶出了一个 Final Project, 紧急求助大家
- JavaWeb Project 中使用JBPM,使用JUnit 四
- JAVA,为什么小弟我在Eclipse没有 web Project 选项的解决方法
- Tomcat 配备 project war ,无需手动发布
- Errors running builder 'JavaScript Validator' on project '.'
- GWT涂鸦(一)――Starter Project
- GWT涂鸦(三)――Spring Roo Project
- Web Project errorpage设立
- java project 跟 web project
- eclipse 使用tomcat7.0建立Dynamic Web Project 时 web.xml的有关问题
- win7上 gwt安装后,没有New Web Application Project button
- 将Eclipse的Java Project变换为Dynamic Web Project
- eclise导入已存在工程报 Faceted Project Problem 异常
- Eclipse新建Server遇到异常"Project facets 1.6"不能添加web项目有关问题
- 逆向工程中的有关问题:Hibernate project not selected 解决方式(转)
- ant创造web project
- maven创设web project