0
我試圖在我的php項目上運行一個包命令,但是我得到了一個關於surefire報告的錯誤。 正如您在日誌中看到的,它與phpunit測試輸出有關... 引起:org.apache.maven.plugin.MojoExecutionException: -no output- in file:C:\ Users \ Develop \ adc \ SRC \測試\ PHP \組織\ ADC \ apptest.php在php項目中用surefire的Maven包問題
沒有人有任何想法可能是錯誤的?..
在這裏,我附上洞 「MVN包-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>
現在已修好。因爲您正在使用快照,所以它現在可以正常工作(phpunit中的錯誤修正是在過去的兩週內完成的)。 – 2012-03-28 16:31:04