2012-10-29 112 views
0

我试图建立我的项目在我的笔记本电脑上运行Windows 7的 我不能构建项目,它抛出一个错误Ant构建失败,并在Windows平台

BUILD FAILED 
C:\Projects\apsrtc-oprs\src\build.xml:118: Basedir C:\Projects\apsrtc-oprs\src\Projectsapsrtc-oprs\src\components does not exist 

基本目录错误我build.properties

# 
# For developers/PC pls update the project.base and deploy.dir accordingly in the build.properties file 
# Donot Modify or change the build.properties.console file, use the template file instead... 
# 
# To avoid ant quirks, the project.base here must be a full absolute path 

project.base=C:\Projects\apsrtc-oprs 

# Deployment directory 
deploy.dir=C:\Program Files\Apache Software Foundation\Tomcat 7.0\webapps 
cxf.home=C:\Projects\apache-cxf-2.6.0 

# Log files 
log.file.path.windows=C:\Projects\apsrtc-oprs\dist\logs\log4j.log 
project.keystore.pwd=AbhS!g4n9Jar0Prod6O3P3R4S5 

build.xml

<project name="APSRTC_project" default="build" basedir="."> 

    <!-- Read the system environment variables and stores them in properties, --> 
    <!-- prefixed with "env.". --> 
    <property environment="env."/> 

    <!-- define all settings for different kinds of builds --> 
    &load-flag-targets; 

    <!-- setup targets to options --> 
    <target name="--init"> 
     <tstamp /> 
     <copy file="build.properties.console" tofile="build.properties" overwrite="false"/> 

     <!-- The build.properties file defines the project base and easuite-lib directories --> 
     <!-- This must be loaded before the &set-properties; inclusion --> 
     <property file="./build.properties"/> 
     <echoproperties prefix="env." destfile="env.properties"/> 
    </target> 

    <!-- invokes build script to clean apps and components --> 
    <target name="clean" depends="--init"> 
     <!-- set the properties based on the build flags --> 
     &set-properties; 

     <ant dir="${project.base}/src/components" target="clean"/> 
     <ant dir="${project.base}/src/apps" target="clean"/> 
    </target> 

我试图清理项目,并获得上述的错误在

<ant dir="${project.base}/src/components" target="clean"/> 

通过改变build.properties基本目录及其他相关路径的路径文件的工作我的Centos操作系统的罚款。我究竟在哪里出错?

感谢

+0

Windows 7的......可能是一个接取的问题。无论你用什么程序来执行蚂蚁。关闭并重新运行,右键单击并选择“以管理员身份运行” –

+0

我已经以管理员身份登录..我正在执行构建文件从我的eclipse ..但为什么它解析为错误的路径?当我回应我得到的路径 - 初始化: 干净: [回声] **编译模式:调试,应用服务器:tomcat,目标操作系统:windows [回声] ** dir.prefix:调试,dir.appserver: tomcat,dir.suffix:windows [echo] ** Basedir:C:\ Projects \ apsrtc-oprs \ src –

+0

尝试使用ant-debug并检查设置的属性。 – Jayan

回答

0

价值'C:\Projects\apsrtc-oprs\src\Projectsapsrtc-oprs\src\components'似乎是${project.base}/src/components结果。请检查您是否在寻找build.properties文件。

望着命名约定,它看起来像一个“/”是必要的Projectsapsrtc-oprs,因此它成为Projects/apsrtc-oprs

+0

你是什么意思通过采购build.properties文件。在我的build.properties中,我设置了project.base = C:\ Projects \ apsrtc-oprs,实际上这个值应该解析为C:\ Projects \ apsrtc-oprs \ src \ components,但它会再次添加Projectsapsrtc-oprs :( –