Setix
Setix

Reputation: 141

Maven 3 + maven-php-plugin + PHPUnit can not extract phar

I am trying to clean and build a maven php project, I have the following code snippet in my pom file:

<build>

    <plugins>

        <plugin>

            <groupId>org.phpmaven</groupId>

            <artifactId>maven-php-plugin</artifactId>

    <version>2.0.0</version>

            <extensions>true</extensions>

            <configuration>

                <ignoreIncludeErrors>true</ignoreIncludeErrors>

                <ignoreValidate>true</ignoreValidate>

            </configuration>

        </plugin>

    </plugins>

</build>

<dependencies>

    <dependency>

        <groupId>de.phpunit</groupId>

        <artifactId>PHPUnit</artifactId>

        <version>3.6.10</version>

    <type>phar</type>

        <scope>test</scope>

    </dependency>

</dependencies>

but I keep getting the following error:

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.phpmaven:maven-php-plugin:2.0.0:extractTestDependencies (default-extractTestDependencies) on project MediaWikiTestClasses: Error while execution unphar script. Unable to extract /home/demo/.m2/repository/de/phpunit/PHPUnit/3.6.7/PHPUnit-3.6.7.phar 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: Error while execution unphar script. Unable to extract /home/demo/.m2/repository/de/phpunit/PHPUnit/3.6.7/PHPUnit-3.6.7.phar at org.phpmaven.plugin.build.AbstractPhpExtractMojo.execute(AbstractPhpExtractMojo.java:76) 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: java.io.IOException: Error while execution unphar script. Unable to extract /home/demo/.m2/repository/de/phpunit/PHPUnit/3.6.7/PHPUnit-3.6.7.phar at org.phpmaven.plugin.build.FileHelper.unphar(FileHelper.java:164) at org.phpmaven.plugin.build.FileHelper.unzipElements(FileHelper.java:123) at org.phpmaven.plugin.php.PhpMojoHelper.prepareDependencies(PhpMojoHelper.java:368) at org.phpmaven.plugin.build.AbstractPhpExtractMojo.execute(AbstractPhpExtractMojo.java:70) ... 21 more

Can anyone help with this?

Upvotes: 1

Views: 1112

Answers (1)

user1461838
user1461838

Reputation: 26

Possible solutions: - Your php executable is aware of phar files? Maybe you need to upgrade. - Your php executable is available on path? test with console (php command).

If this does not help you should have a look at debug output (-X flag). Are there any additional stack trace entries?

Upvotes: 0

Related Questions