为什么Phing运行的build.xml我,然后说,它不存在? [英] Why is Phing running my build.xml, and then saying it doesn't exist?

查看:279
本文介绍了为什么Phing运行的build.xml我,然后说,它不存在?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它的运行我的build.xml,当错误弹出我的build.xml文件丢失......这是没有意义的。

 <项目名称=php_project默认为建>
    &所述;! - ============================================ - - >
    < - 目标:prepare - >
    &所述;! - ============================================ - - >
    <目标NAME =prepare>
        <回声味精=制作目录./target/>
        < MKDIR DIR =./target/>
    < /目标与GT;
    &所述;! - ============================================ - - >
    < - 目标:构建 - >
    &所述;! - ============================================ - - >
    <目标名称=建造取决于=prepare>
        <回声味精=将文件复制到build目录.../>
        <回声味精=复制到./src/main/php/lib目录./target/lib .../>
        <拷贝文件=./src/main/php/libTOFILE =./target/lib/>
        <回声味精=复制到./src/main/php/webapp目录./target/webapp .../>
        <拷贝文件=./src/main/php/webappTOFILE =./target/webapp/>
    < /目标与GT;
< /项目>

正如你所知道的,我使用PHP-Maven的文件结构,但是PHP-Maven是死了,所以我切换到Phing。作曲家位于的src / main / PHP / lib中/供应商。我build.sh:

 #!/ bin / sh的
./phing的build.xml

输出:

  $运行./build.sh
构建文件:./build.xml
覆盖忽视了用户属性phing.file
覆盖忽视了用户属性phing.dir
添加参考...
  +任务定义:...
  +用户数据类型:...
  +目标:prepare
  +任务:回声
  +任务上:mkdir构建失败
异常'BuildException有消息目标的build.xml没有在这个项目中存在的。在php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Project.php:935
堆栈跟踪:
#0 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Project.php(867):项目 - > _tsort('build.xml文件',数组,数组,数组,数组)
#1 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Project.php(817):项目 - > _topoSort('build.xml文件',阵列)
#2 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Project.php(797):项目 - > executeTarget('build.xml文件')
#3 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Phing.php(574):项目 - > executeTargets(阵列)
#4 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Phing.php(172):Phing-> runBuild()
#5 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /班/ phing / Phing.php(272):Phing ::开始(阵列,NULL)
#6 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /斌/ phing.php(43):Phing ::火(阵列)
#7 php_project / src目录/主/ PHP / lib中/供应商/ phing / phing /斌/ phing(20):require_once('php_project / ...')
#{8}主总时间:0.0560秒


解决方案

  

./ phing的build.xml


您正在运行与目标的build.xmlphing。这个目标不存在。但构建的文件 phing使用默认存在,这是的build.xml 。如果你想运行一个不同的生成的文件名phing,你必须使用选项 -f - 构建文件,后跟要使用的文件名。

由于现有目标构建作为默认执行,你不需要在所有名称的任何目标。

./ phing 会怎么做。

./ phing构建也做,有明确命名的目标来执行。

It's running my build.xml, when the error pops up that my build.xml is missing... This makes no sense.

<project name = "php_project" default = "build" >
    <!-- ============================================ -->
    <!-- Target: prepare -->
    <!-- ============================================ --> 
    <target name = "prepare" >
        <echo msg = "Making directory ./target" />
        <mkdir dir = "./target" />
    </target>
    <!-- ============================================ -->
    <!-- Target: build -->
    <!-- ============================================ -->
    <target name = "build" depends = "prepare" >
        <echo msg = "Copying files to build directory..." />
        <echo msg = "Copying ./src/main/php/lib to ./target/lib directory..." />
        <copy file = "./src/main/php/lib" tofile = "./target/lib" />
        <echo msg = "Copying ./src/main/php/webapp to ./target/webapp directory..." />
        <copy file = "./src/main/php/webapp" tofile = "./target/webapp" />
    </target>
</project>

As you can tell, I'm using a PHP-Maven file structure, but PHP-Maven is dead so I'm switching to Phing. Composer is located in src/main/php/lib/vendor. My build.sh:

#!/bin/sh
./phing build.xml

Output:

$ ./build.sh
Buildfile: ./build.xml
Override ignored for user property phing.file
Override ignored for user property phing.dir
Adding reference...
  +Task definition: ...
  +User datatype: ...
  +Target: prepare
  +Task: echo
  +Task: mkdir

BUILD FAILED
exception 'BuildException' with message 'Target 'build.xml' does not exist in this project.' in php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Project.php:935
Stack trace:
#0 php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Project.php(867): Project->_tsort('build.xml', Array, Array, Array, Array)
#1 php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Project.php(817): Project->_topoSort('build.xml', Array)
#2 php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Project.php(797): Project->executeTarget('build.xml')
#3 php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Phing.php(574): Project->executeTargets(Array)
#4 php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Phing.php(172): Phing->runBuild()
#5 php_project/src/main/php/lib/vendor/phing/phing/classes/phing/Phing.php(272): Phing::start(Array, NULL)
#6 php_project/src/main/php/lib/vendor/phing/phing/bin/phing.php(43): Phing::fire(Array)
#7 php_project/src/main/php/lib/vendor/phing/phing/bin/phing(20): require_once('php_project/...')
#8 {main}

Total time: 0.0560 seconds

解决方案

./phing build.xml

You are running phing with the target "build.xml". This target does not exist. But the build file phing uses as default exists, which is build.xml. If you want to run phing with a different build file name, you have to use the option -f or --buildfile, followed by the name of the file you want to use.

Because the existing target "build" is executed as default, you don't need to name ANY target at all.

./phing would do.

./phing build would also do, with explicitly naming the target to execute.

这篇关于为什么Phing运行的build.xml我,然后说,它不存在?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆