0

我正在尝试在我的 php 项目上运行包命令,但我收到了与肯定报告相关的错误。正如您在日志中看到的,它与 phpunit 测试输出有关... 原因:org.apache.maven.plugin.MojoExecutionException: -no output- in file: C:\Users\Develop\adc\src\test \php\org\adc\apptest.php

有谁知道什么可能是错的??

这里我附上漏洞“mvn package -e”命令日志:

C:\Users\Develop\adc>mvn package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Sample PHP 5 web project 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-php-plugin:2.0-SNAPSHOT:set-sources (default-set-sources-1) @ adc ---
[INFO]
[INFO] --- maven-plugin-plugin:2.9:descriptor (default-descriptor) @ adc ---
[INFO]
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ adc ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Develop\adc\src\main\resources
[INFO]
[INFO] --- maven-php-plugin:2.0-SNAPSHOT:resources (default-resources) @ adc ---
[INFO] Unpacking dependencies
[INFO]
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ adc ---
[debug] execute contextualize
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory C:\Users\Develop\adc\src\test\resources
[INFO]
[INFO] --- maven-php-plugin:2.0-SNAPSHOT:testResources (default-testResources) @ adc ---
[INFO] Unpacking dependencies
[INFO]
[INFO] --- maven-php-plugin:2.0-SNAPSHOT:test (default-test) @ adc ---
[INFO]
-------------------------------------------------------
T E S T S
-------------------------------------------------------

[INFO] Surefire report directory: C:\Users\Develop\adc\target\surefire-reports
[ERROR] Testcase: apptest.php fails.
[ERROR] See log: C:\Users\Develop\adc\target\surefire-reports\apptest.txt
[ERROR] Testcase: apptest.php fails.
[ERROR] See log: C:\Users\Develop\adc\target\surefire-reports\apptest.txt
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 24.101s
[INFO] Finished at: Sat Feb 25 20:16:05 ART 2012
[INFO] Final Memory: 7M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:test (default-test) on project a-don
de-comemos:
[ERROR] -no output-
[ERROR] in file: C:\Users\Develop\adc\src\test\php\org\adc\apptest.php
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.phpmaven:maven-php-plugin:2
.0-SNAPSHOT:test (default-test) on project adc:
-no output-
in file: C:\Users\Develop\adc\src\test\php\org\adc\apptest.php
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java
:84)
        at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java
:59)
        at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)

        at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
        at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
        at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
        at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
        at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
        at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.MojoExecutionException:
-no output-
in file: C:\Users\Develop\adc\src\test\php\org\adc\apptest.php
        at org.phpmaven.plugin.build.PhpTest.executeTest(PhpTest.java:443)
        at org.phpmaven.plugin.build.PhpTest.doTesting(PhpTest.java:313)
        at org.phpmaven.plugin.build.PhpTest.execute(PhpTest.java:271)
        at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
        at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
        ... 19 more
Caused by: org.phpmaven.plugin.php.PhpErrorException:
-no output-
in file: C:\Users\Develop\adc\src\test\php\org\adc\apptest.php
        at org.phpmaven.plugin.build.PhpTest.executeTest(PhpTest.java:438)
        ... 23 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

这是我的 pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project>
    <modelVersion>4.0.0</modelVersion>
    <groupId>org.adc</groupId>
    <artifactId>adc</artifactId>
    <packaging>php</packaging>
    <name>Sample PHP 5 web project</name>
    <version>1.0-SNAPSHOT</version>

    <build>
        <plugins>
            <plugin>
                <groupId>org.phpmaven</groupId>
                <artifactId>maven-php-plugin</artifactId>
                <version>2.0-SNAPSHOT</version>
                <extensions>true</extensions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-site-plugin</artifactId>
                <version>3.0</version>
                <inherited>true</inherited>
                <configuration>
                    <reportPlugins>
                        <plugin>
                            <groupId>org.phpmaven</groupId>
                            <artifactId>maven-php-plugin</artifactId>
                            <reportSets>
                                <reportSet>
                                    <reports>
                                        <report>phpdocumentor</report>
                                    </reports>
                                </reportSet>
                            </reportSets>
                        </plugin>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-surefire-report-plugin</artifactId>
                            <version>2.10</version>
                            <reportSets>
                                <reportSet>
                                    <reports>
                                        <report>report-only</report>
                                    </reports>
                                </reportSet>
                            </reportSets>
                        </plugin>
                    </reportPlugins>
                </configuration>
            </plugin>

        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.phpunit</groupId>
            <artifactId>phpunit5</artifactId>
            <version>3.3.9</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>
</project>
4

1 回答 1

0

目前某些版本仍然存在错误和错误报告。使用以下命令“mvn -DflushPHPOutput=true test”查看底层错误。也许测试用例 php 本身有问题。

某些版本的 phpunit 的原型不合适。但是查看 php 输出应该会有所帮助。

于 2012-02-29T17:47:47.483 回答