Installing 3rd party library, updating PHPUnit dependency/using actual PHPUnit version

201 views
Skip to first unread message

tomask.de

unread,
Jan 16, 2012, 12:39:33 PM1/16/12
to maven-...@googlegroups.com
Hi @all,

I want to use the current PHPUnit Version 3.6.7 as dependency in my Testproject and just followed the instructions at http://www.php-maven.org/tut-add3partylibs.html But getting the tar from http://pear.phpunit.de/get/PHPUnit-3.6.7.tar and installing it successfully to my local repo from zip leads to following error while executing "mvn package":

[ERROR] Failed to execute goal org.phpmaven:maven-php-plugin:1.1:phpunit (default-phpunit) on project my-php-lib: ~/Develop/php/org.sample.my-php-lib/target/phpinc/PHPUnit/Autoload.php (No such file or directory) -> [Help 1]

So I compared the size of both jar's (3.3.9 and 3.6.7) in my local repo and discovered that the new jar file is smaller:
-rw-r--r-- 1 721386 2011-10-19 20:56 phpunit5-3.3.9.jar
-rw-r--r-- 1 284683 2012-01-16 14:30 phpunit5-3.6.7.jar

I guess the new (generated) jar doesn't include all required dependencies, so the way to install as it's described doesn't work for me.

In a second try I used the PHPUnit folder at /usr/share/php/PHPUnit which is the one of the PEAR installed version and zipped that one for installation as 3rd party lib. This generated jar has a similar size to the 3.3.9 jar...
-rw-r--r-- 1 720377 2012-01-16 14:41 phpunit5-3.6.7.jar

Unfortunely this version doesn't work either. Updateing the dependency in my project's pom.xml leads to the following error now:

[ERROR] Failed to execute goal org.phpmaven:maven-php-plugin:1.1:phpunit (default-phpunit) on project my-php-lib: [ERROR] PHP Fatal error:  Class 'PHPUnit_Runner_BaseTestRunner' not found in ~/Develop/php/org.sample.my-php-lib/target/phpinc/PHPUnit/TextUI/TestRunner.php on line 60PHP Stack trace:PHP   1. {main}() ~/Develop/php/org.sample.my-php-lib/target/phpinc/PHPUnit/TextUI/Maven.php:0PHP   2. require_once() ~/Develop/php/org.sample.my-php-lib/target/phpinc/PHPUnit/TextUI/Maven.php:5 in [ERROR] File: [ERROR] ~/Develop/php/org.sample.my-php-lib/src/test/php/org/sample/AppTest.php [ERROR] Command: [ERROR] php -d include_path=":~/Develop/php/org.sample.my-php-lib/src/main/php:~/Develop/php/org.sample.my-php-lib//src/test/php:~/Develop/php/org.sample.my-php-lib/target/phpinc:~/Develop/php/org.sample.my-php-lib/src/test/php/org/sample:~/Develop/php/org.sample.my-php-lib/target/test-classes:~/Develop/php/org.sample.my-php-lib/target/classes:" "~/Develop/php/org.sample.my-php-lib/target/phpinc/PHPUnit/TextUI/Maven.php" "~/Develop/php/org.sample.my-php-lib/src/test/php/org/sample/AppTest.php" "~/Develop/php/org.sample.my-php-lib/target/surefire-reports/AppTest.xml"+

I'm still on my former setup: Ubuntu 10.10, maven 3.0.3, Java 1.6.0_24, PHP 5.3.3

Apache Maven 3.0.3 (r1075438; 2011-02-28 18:31:09+0100) Maven home: /opt/apache-maven-3.0.3 Java version: 1.6.0_24, vendor: Sun Microsystems Inc. Java home: /usr/lib/jvm/java-6-sun-1.6.0.24/jre Default locale: de_DE, platform encoding: UTF-8 OS name: "linux", version: "2.6.35-30-generic", arch: "amd64", family: "unix"

PHP 5.3.3-1ubuntu9.7 with Suhosin-Patch (cli) (built: Dec 13 2011 17:53:00)  Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies     with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans

Any suggestions? Thanks in advance.
tomask

mepeisen

unread,
Feb 6, 2012, 4:33:35 AM2/6/12
to Maven for PHP
I will publish some versions of phpunit tonight in the repository. So
that no manual installation is needed.

However your error may be caused by the wrong layout in jar. Please
have a look at the target directory. Is PHPUnit unpacked correctly?
Are all files present or is the directory layout corrupt?

tomask.de

unread,
Feb 6, 2012, 2:38:09 PM2/6/12
to maven-...@googlegroups.com
Hi,

I just had a look at the target directory again.
All files are present - The size of the target/phpinc/PHPUnit folder equals the size of the PHPUnit source folder before compression.
So unpacking that stuff seems to work right.

Greetz tomask.

And a big THANKYOU for your effort to drive this project forward!

mepeisen

unread,
Feb 9, 2012, 7:40:42 PM2/9/12
to Maven for PHP
Please have a try with version 3.6.10 from reporitory. (see other
thread about phpunit).
It does contain every dependency PEAR reported or more commonly it is
a result of a valid PEAR installation.

tomask.de

unread,
Feb 15, 2012, 3:50:39 AM2/15/12
to maven-...@googlegroups.com
Hi Martin,

I just tried to use the version 3.6.10 as dependency in my sample project after changing the urls of the php-maven repo in my settings.xml, but I get the following error:

[ERROR] Failed to execute goal on project my-php-lib: Could not resolve dependencies for project org.sample:my-php-lib:php:1.0-SNAPSHOT: Could not find artifact org.phpunit:phpunit5:jar:3.6.10 in release-repo1.php-maven.org (http://repos.php-maven.org/releases) -> [Help 1]

After browsing the nexus repo I saw that the package is deployed as a phar.
But actually maven tries to download a jar-file.
How can I force maven to download the phar?

Thanks in advance.

martin.eisengardt

unread,
Feb 15, 2012, 4:13:46 AM2/15/12
to maven-...@googlegroups.com
 
See the dependency information on the bottom right corner :-)
In short ways: The XML-Tag "type" does all the magic. Not using this tag will think maven of using a jar. As of PHP-Maven 1.0 there was no phar support, so everything was packed as JAR. For compatibility reason PHP-Maven2 will support loading and extracting JAR-Dependencies of php products. But it is not recommended.
 

--
You received this message because you are subscribed to the Google Groups "Maven for PHP" group.
To view this discussion on the web visit https://groups.google.com/d/msg/maven-for-php/-/Rs1abr8f2bIJ.

To post to this group, send email to maven-...@googlegroups.com.
To unsubscribe from this group, send email to maven-for-ph...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/maven-for-php?hl=en.

tomask.de

unread,
Feb 15, 2012, 4:41:21 AM2/15/12
to maven-...@googlegroups.com
Thanks ... that's what I was looking for --> <type>

A quick look in the Maven documentation would have helped too ;)


Btw: I'm also following the other threads.
What do you think about a cakephp-archetype next to the zend-archetype?
And what do you think about an additional maven plugin, which generates PHP classes out of XML schemas (like xmlbeans-maven-plugin for Java).
I started a small maven-plugin-test-project on that issue, using LegkoXML (XSD-to-PHP) as base, but didn't get it to run until now and not yet developed own Maven plugins :)

Would love to help a little bit 
tomask

martin.eisengardt

unread,
Feb 15, 2012, 5:47:14 AM2/15/12
to maven-...@googlegroups.com
Those aren't topics I am following know. However I will create a zend archetype and sample project as well as documentation because I have enough experience in zend. Other archetypes should be done by you (the community). If someone is interested I will add him/her to the github group and grant upload privilege so that her/her can maintain an archetype.

The xml/xsd to php might be one of the next topics.

mepeisen

unread,
Feb 18, 2012, 8:06:58 PM2/18/12
to Maven for PHP
Imported into trac:

Cake-PHP request: http://trac.php-maven.org/ticket/42
XML to JAXB binding-request: http://trac.php-maven.org/ticket/43

Targeted for 2.0.0 release
Reply all
Reply to author
Forward
0 new messages