Maven пакет проблема с верным в php-проекте - PullRequest
0 голосов
/ 26 февраля 2012

Я пытаюсь запустить команду пакета в своем проекте php, но получаю ошибку, связанную с верными отчетами.Как вы можете видеть в журнале, это связано с выводом теста phpunit ... Причины: org.apache.maven.plugin.MojoExecutionException: -no output- в файле: 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>

1 Ответ

0 голосов
/ 29 февраля 2012

В настоящее время в некоторых версиях все еще есть ошибки и ложные сообщения.Используйте следующую команду «mvn -DflushPHPOutput = true test», чтобы увидеть основную ошибку.Возможно, что-то не так в самом тестовом примере php.

Архетипы не подходят для некоторых версий phpunit.Однако просмотр вывода php должен помочь.

...