Build error while following PHP libraries - 5 minutes starter guide

512 views
Skip to first unread message

Rodrigo

unread,
Jan 4, 2012, 8:55:21 AM1/4/12
to Maven for PHP
Hi Community.

I'm starting with Maven for PHP, so I just follow "Prepare Maven for
PHP" and "PHP library project - 5 minutes starter guide" from
http://www.xworlds.org/php-maven/ and couldn't get my-app library to
get packaged.

While reading the output I found a hint into the error, checksum
failed for org.phpmaven:maven-php-plugin:2.0-SNAPSHOT which I think it
lead into the following log:
- Internal error in the plugin manager executing goal
'org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:resources': Unable to load
the mojo 'org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:resources' in the
plugin 'org.phpmaven:maven-php-plugin'. A required class is missing:
Lorg/apache/maven/project/ProjectBuilder;
org.apache.maven.project.ProjectBuilder

The thing is that I don't have a clue how to resolve it!

Below I copy the output generated while creating the project and the
execution of "mvn package". Sorry I didn't fine a way to attach a
file.

Thank in advance for your time and help and I will be waiting for your
response.

Rodrigo.

-----------------------------------------------------------------------------------------
CREATE PROJECT

jerryrmt@Desktop:~/Demos/workspace-php$ mvn archetype:generate -
DarchetypeGroupId=org.phpmaven -DarchetypeArtifactId=php5-lib-
archetype -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=org.sample -
DartifactId=my-app
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] org.apache.maven.plugins: checking for updates from release-
repo1.php-maven.org
[INFO] org.codehaus.mojo: checking for updates from release-repo1.php-
maven.org
[INFO] artifact org.apache.maven.plugins:maven-archetype-plugin:
checking for updates from release-repo1.php-maven.org
[INFO]
------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO] task-segment: [archetype:generate] (aggregator-style)
[INFO]
------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] [archetype:generate {execution: default-cli}]
[INFO] Generating project in Interactive mode
[WARNING] Archetype not found in any catalog. Falling back to central
repository (http://repo1.maven.org/maven2).
[WARNING] Use -DarchetypeRepository=<your repository> if archetype's
repository is elsewhere.
[INFO] snapshot org.phpmaven:php5-lib-archetype:2.0-SNAPSHOT: checking
for updates from php5-lib-archetype-repo
[INFO] snapshot org.phpmaven:php5-lib-archetype:2.0-SNAPSHOT: checking
for updates from release-repo1.php-maven.org
[INFO] snapshot org.phpmaven:php5-lib-archetype:2.0-SNAPSHOT: checking
for updates from snapshot-repo1.php-maven.org
[INFO] Using property: groupId = org.sample
[INFO] Using property: artifactId = my-app
Define value for property 'version': 1.0-SNAPSHOT:
[INFO] Using property: package = org.sample
Confirm properties configuration:
groupId: org.sample
artifactId: my-app
version: 1.0-SNAPSHOT
package: org.sample
Y:
Downloading: http://repo1.maven.org/maven2/org/phpmaven/php5-lib-archetype/2.0-SNAPSHOT/php5-lib-archetype-2.0-SNAPSHOT.jar
[INFO] Unable to find resource 'org.phpmaven:php5-lib-archetype:jar:
2.0-SNAPSHOT' in repository php5-lib-archetype-repo (http://
repo1.maven.org/maven2)
Downloading: http://repo1.maven.org/maven2/org/phpmaven/php5-lib-archetype/2.0-SNAPSHOT/php5-lib-archetype-2.0-SNAPSHOT.pom
[INFO] Unable to find resource 'org.phpmaven:php5-lib-archetype:pom:
2.0-SNAPSHOT' in repository php5-lib-archetype-repo (http://
repo1.maven.org/maven2)
[INFO]
----------------------------------------------------------------------------
[INFO] Using following parameters for creating project from Archetype:
php5-lib-archetype:2.0-SNAPSHOT
[INFO]
----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: org.sample
[INFO] Parameter: artifactId, Value: my-app
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.sample
[INFO] Parameter: packageInPathFormat, Value: org/sample
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[INFO] Parameter: package, Value: org.sample
[INFO] Parameter: groupId, Value: org.sample
[INFO] Parameter: artifactId, Value: my-app
[WARNING] Don't override file /home/rodrigo_techera/Demos/workspace-
php/my-app/src/site
[INFO] project created from Archetype in dir: /home/rodrigo_techera/
Demos/workspace-php/my-app
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 14 seconds
[INFO] Finished at: Wed Jan 04 10:43:00 UYST 2012
[INFO] Final Memory: 24M/167M
[INFO]
------------------------------------------------------------------------


MVN PACKAGE

jerryrmt@Desktop:~/Demos/workspace-php/$cd my-app
jerryrmt@Desktop:~/Demos/workspace-php/my-app$ mvn package
[INFO] Scanning for projects...
[INFO] snapshot org.phpmaven:maven-php-plugin:2.0-SNAPSHOT: checking
for updates from release-repo1.php-maven.org
[INFO] snapshot org.phpmaven:maven-php-plugin:2.0-SNAPSHOT: checking
for updates from snapshot-repo1.php-maven.org
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'6b9c22ec9aa731414aa29e1413b7fba3abf13b46'; remote =
'27ee8d16138ae47ee581573874f5f474ba0d5c46' - RETRYING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'6b9c22ec9aa731414aa29e1413b7fba3abf13b46'; remote =
'27ee8d16138ae47ee581573874f5f474ba0d5c46' - IGNORING
[INFO] snapshot org.phpmaven:maven-php-parent:2.0-SNAPSHOT: checking
for updates from release-repo1.php-maven.org
[INFO] snapshot org.phpmaven:maven-php-parent:2.0-SNAPSHOT: checking
for updates from snapshot-repo1.php-maven.org
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'eb967fc694c82cd1ee9332f2424f11a9d0c0f558'; remote =
'174b0128eb074ed5d9c3d097291f078b2d4a28f4' - RETRYING
[WARNING] *** CHECKSUM FAILED - Checksum failed on download: local =
'eb967fc694c82cd1ee9332f2424f11a9d0c0f558'; remote =
'174b0128eb074ed5d9c3d097291f078b2d4a28f4' - IGNORING
[INFO]
------------------------------------------------------------------------
[INFO] Building Sample PHP 5 library project
[INFO] task-segment: [package]
[INFO]
------------------------------------------------------------------------
[INFO] [php:set-sources {execution: default-set-sources}]
Downloading: http://repos.xworlds.org/releases/org/phpunit/phpunit5/3.3.9/phpunit5-3.3.9.pom
[INFO] Unable to find resource 'org.phpunit:phpunit5:pom:3.3.9' in
repository release-repo1.php-maven.org (http://repos.xworlds.org/
releases)
Downloading: http://repo1.maven.org/maven2/org/phpunit/phpunit5/3.3.9/phpunit5-3.3.9.pom
[INFO] Unable to find resource 'org.phpunit:phpunit5:pom:3.3.9' in
repository central (http://repo1.maven.org/maven2)
[INFO] [plugin:descriptor {execution: default-descriptor}]
[INFO] [resources:resources {execution: default-resources}]
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/rodrigo_techera/Demos/
workspace-php/my-app/src/main/resources
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Internal error in the plugin manager executing goal
'org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:resources': Unable to load
the mojo 'org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:resources' in the
plugin 'org.phpmaven:maven-php-plugin'. A required class is missing:
Lorg/apache/maven/project/ProjectBuilder;
org.apache.maven.project.ProjectBuilder
[INFO]
------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO]
------------------------------------------------------------------------
[INFO] Total time: 10 seconds
[INFO] Finished at: Wed Jan 04 11:08:01 UYST 2012
[INFO] Final Memory: 28M/292M
[INFO]
------------------------------------------------------------------------

MAVEN VERSION

jerryrmt@Desktop:~/Demos/workspace-php/$ mvn -version
Apache Maven 2.2.1 (r801777; 2009-08-06 16:16:01-0300)
Java version: 1.6.0_26
Java home: /usr/lib/jvm/java-6-sun-1.6.0.26/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux" version: "2.6.38-13-generic" arch: "amd64" Family:
"unix"

TeeTee

unread,
Jan 10, 2012, 12:40:28 AM1/10/12
to Maven for PHP

I have the same problems.
but I found a WORKAROUND in "Introduction to php5 with Maven":
http://www.vegaasen.com/blog/?p=71

You try to change "http://repos.xworlds.org/" to "http://repo1.php-
maven.org/"
where is the "profile-php-maven"'s repositories in your settings.xml.


On 1月4日, 午後10:55, Rodrigo <jerry...@gmail.com> wrote:
> Hi Community.
>
> I'm starting with Maven for PHP, so I just follow "Prepare Maven for
> PHP" and "PHP library project - 5 minutes starter guide" fromhttp://www.xworlds.org/php-maven/and couldn't get my-app library to
> get packaged.
>
> While reading the output I found a hint into the error, checksum
> failed for org.phpmaven:maven-php-plugin:2.0-SNAPSHOT which I think it
> lead into the following log:
>  - Internal error in the plugin manager executing goal
> 'org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:resources': Unable to load
> the mojo 'org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:resources' in the
> plugin 'org.phpmaven:maven-php-plugin'. A required class is missing:
> Lorg/apache/maven/project/ProjectBuilder;
> org.apache.maven.project.ProjectBuilder
>
> The thing is that I don't have a clue how to resolve it!
>
> Below I copy the output generated while creating the project and the
> execution of "mvn package". Sorry I didn't fine a way to attach a
> file.
>
> Thank in advance for your time and help and I will be waiting for your
> response.
>
> Rodrigo.
>
> ---------------------------------------------------------------------------­--------------
> Downloading:http://repo1.maven.org/maven2/org/phpmaven/php5-lib-archetype/2.0-SNA...
> [INFO] Unable to find resource 'org.phpmaven:php5-lib-archetype:jar:
> 2.0-SNAPSHOT' in repository php5-lib-archetype-repo (http://
> repo1.maven.org/maven2)
> Downloading:http://repo1.maven.org/maven2/org/phpmaven/php5-lib-archetype/2.0-SNA...
> [INFO] Unable to find resource 'org.phpmaven:php5-lib-archetype:pom:
> 2.0-SNAPSHOT' in repository php5-lib-archetype-repo (http://
> repo1.maven.org/maven2)
> [INFO]
> ---------------------------------------------------------------------------­-
> [INFO] Using following parameters for creating project from Archetype:
> php5-lib-archetype:2.0-SNAPSHOT
> [INFO]
> ---------------------------------------------------------------------------­-
> Downloading:http://repos.xworlds.org/releases/org/phpunit/phpunit5/3.3.9/phpunit5...
> [INFO] Unable to find resource 'org.phpunit:phpunit5:pom:3.3.9' in
> repository release-repo1.php-maven.org (http://repos.xworlds.org/
> releases)
> Downloading:http://repo1.maven.org/maven2/org/phpunit/phpunit5/3.3.9/phpunit5-3.3...

mepeisen

unread,
Feb 18, 2012, 7:46:06 PM2/18/12
to Maven for PHP
Please upgrade to Maven 3 first. Change the repository to
repos.php.maven.org as described here: http://www.php-maven.org/prepare.html
PHP-Maven >=V2.0.0 won't be compatible to maven2.

Then you should retry your sample. Read the tutorials at
http://www.php-maven.org/branches/2.0-SNAPSHOT/tutorials.html#quick-tutorials

tomask.de

unread,
Mar 2, 2012, 4:26:43 AM3/2/12
to maven-...@googlegroups.com
Hi Martin,

I'm still getting an error while building my multi modul project.

[ERROR] Failed to execute goal org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:phar (default-phar) on project php-lib: Failed packing phar:
...
[ERROR] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'Iterator RecursiveIteratorIterator returned a path
...

I'm using the new repo, the argument -U to force updates and maven 3, and still getting the checksum failed warning

[WARNING] Checksum validation failed, expected 2ce734a9659672a12a4fcf347ba9e4d28fd3f44a but is 7854b31ea217a7cb23f0c4089edcf1b7fc4f3015 for http://repos.php-maven.org/snapshots/org/phpmaven/maven-php-plugin/2.0-SNAPSHOT/maven-metadata.xml
[WARNING] Checksum validation failed, expected 2ce734a9659672a12a4fcf347ba9e4d28fd3f44a but is 7854b31ea217a7cb23f0c4089edcf1b7fc4f3015 for http://repos.php-maven.org/snapshots/org/phpmaven/maven-php-plugin/2.0-SNAPSHOT/maven-metadata.xml
[WARNING] Checksum validation failed, expected 792bdb0c5f0b16eb0fab027ed9d35cd6411aa398 but is 61efc270a00fc3fb339ab2f5aa0990109fe3eac9 for http://repos.php-maven.org/snapshots/org/phpmaven/build/generic-java-parent/2.0-SNAPSHOT/maven-metadata.xml
[WARNING] Checksum validation failed, expected 792bdb0c5f0b16eb0fab027ed9d35cd6411aa398 but is 61efc270a00fc3fb339ab2f5aa0990109fe3eac9 for http://repos.php-maven.org/snapshots/org/phpmaven/build/generic-java-parent/2.0-SNAPSHOT/maven-metadata.xml

Any ideas?

gabor...@gmail.com

unread,
Mar 4, 2012, 9:38:51 AM3/4/12
to maven-...@googlegroups.com
Hi All,

I'm glad to have found Maven for PHP and tried to use it, but I have the same problem as Tomask. I have Maven 3, PHP 5.3, PEAR, and PhpDoc installed on Ubuntu 11.10. I added the PHP-Maven repo to my settings.xml as described at www.php-maven.org and created the sample lib project by executing 

mvn archetype:generate -DarchetypeGroupId=org.phpmaven -DarchetypeArtifactId=php5-lib-archetype -DarchetypeVersion=2.0-SNAPSHOT -DgroupId=org.sample -DartifactId=my-app -Dversion=0.0.1-SNAPSHOT

The project was created successfully (though the resulting structure slightly differs from what's described in the tutorial), but executing "mvn package -Dmaven.test.skip=true" in its directory failed with error messages similar to those sent by Tomask, including checksum warnings and the "Failed packing phar" error:

...
[WARNING] Checksum validation failed, expected 40461d69018b0be4744195ccff148f699b642603 but is 9a7c89468d0d1a606174a98c22de5f5b1792b1c1 for http://repos.php-maven.org/snapshots/org/phpmaven/php-parent-pom/2.0-SNAPSHOT/maven-metadata.xml
[WARNING] Checksum validation failed, expected 40461d69018b0be4744195ccff148f699b642603 but is 9a7c89468d0d1a606174a98c22de5f5b1792b1c1 for http://repos.php-maven.org/snapshots/org/phpmaven/php-parent-pom/2.0-SNAPSHOT/maven-metadata.xml
...
[ERROR] Failed to execute goal org.phpmaven:maven-php-plugin:2.0-SNAPSHOT:phar (default-phar) on project my-app: Failed packing phar:
[ERROR] Failed to execute PHP with arguments '-d include_path=":/path/to/project/my-app/target/classes:/path/to/project/my-app/target/php-deps:/path/to/project/my-app/target/php-deps/pear" -d phar.readonly=0 "/path/to/project/my-app/target/packagePhar.php"' [Return: 255]:
[ERROR] PHP Fatal error:  Uncaught exception 'UnexpectedValueException' with message 'Iterator RecursiveIteratorIterator returned a path "/path/to/project/my-app/target" that is not in the base directory "/path/to/project/my-app/target/classes"' in /path/to/project/my-app/target/packagePhar.php:8
[ERROR] Stack trace:
[ERROR] #0 /path/to/project/my-app/target/packagePhar.php(8): Phar->buildFromIterator(Object(RecursiveIteratorIterator), '/path/to/projec...')
[ERROR] #1 {main}
[ERROR] thrown in /path/to/project/my-app/target/packagePhar.php on line 8
[ERROR] 
[ERROR] in file: /path/to/project/my-app/target/packagePhar.php
...

I don't know how to fix that. Any help is greatly appreciated. Thanks in advance,

Gábor Dicső

martin.eisengardt

unread,
Mar 4, 2012, 10:32:33 AM3/4/12
to maven-...@googlegroups.com
I do not know why this happens. However the next beta will fix it in the mentioned way.
 
And in beta 3 we will have a way to influence the used snippet.php. So that you are able to experiment with various variants and hopefully we find the cause for this exception.

gabor...@gmail.com

unread,
Mar 4, 2012, 11:52:04 AM3/4/12
to maven-...@googlegroups.com
Thanks Martin.

I found a workaround, replace the buildFromIterator call in packagePhar.php with the following:

$phar->buildFromDirectory(realpath('/path/to/project/my-app/target/classes'));

If for some reason this should not suit your needs, here's what I tried before that. I also found the suggestion you mentioned and edited the packagePhar.php to use the suggested "IgnorantRecursiveDirectoryIterator" but it didn't help. Looks like a similar extension could be made to RecursiveIteratorIterator as well, but I didn't know what to override here so I got stuck. I also tried to pass a RecursiveRegexIterator instance wrapping the DirectoryIterator to the RecursiveIteratorIterator to filter values that don't start with the classes directory's path but that didn't work either, possibly my regexp wasn't correct. Maybe you'll find out how to do that.

Anyway, to me it seems that buildFromDirectory works fine. Is there a way for me to edit the template of packagePhar.php? It gets overwritten every time I use mvn package. Thanks,

Gábor

martin.eisengardt

unread,
Mar 4, 2012, 12:08:03 PM3/4/12
to maven-...@googlegroups.com
Yep, buildFromDirectory succeeds as long as there are not thousands of files. For example creating a phar for zend framework always fails. See https://bugs.php.net/bug.php?id=53467
 
You can overwrite the templates in pom.xml. Use configuration option
<pharConfig><packagePhpContent>...</packagePhpContent><packagePhpDirectory>...</packagePhpDirectory></pharConfig>
 
Line 54 and 62.

 



2012/3/4 <gabor...@gmail.com>
--
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/-/_gYNAxZq31EJ.

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.

gabor.dicso

unread,
Mar 4, 2012, 3:02:46 PM3/4/12
to Maven for PHP
I changed line 8 of packagePhar.php from this

$phar->buildFromIterator(new RecursiveIteratorIterator(new
RecursiveDirectoryIterator(
realpath('/path/to/project/my-app/target/classes'))),
realpath('/path/to/project/my-app/target/classes'));

to this (removed '/classes' from the end of the phar base dir):

$phar->buildFromIterator(new RecursiveIteratorIterator(new
RecursiveDirectoryIterator(
realpath('/path/to/project/my-app/target/classes'))),
realpath('/path/to/project/my-app/target'));

and it worked.

If I understand correctly, I only need to add the packagePhpDirectory
tag to pom.xml (with "realpath('$:{pharfilepath}'));" instead of
"realpath('$:{pkgbasedir}'));") in order to change the generated
packagePhar.php when using mvn package. Can you please tell me where
and what exactly I must put in the pom.xml? I tried several ways but
had no success. Thanks,

Gábor

On márc. 4, 18:08, "martin.eisengardt"
<martin.eisenga...@googlemail.com> wrote:
> Yep, buildFromDirectory succeeds as long as there are not thousands of
> files. For example creating a phar for zend framework always fails. Seehttps://bugs.php.net/bug.php?id=53467
>
> You can overwrite the templates in pom.xml. Use configuration option
> <pharConfig><packagePhpContent>...</packagePhpContent><packagePhpDirectory> ...</packagePhpDirectory></pharConfig>
>
> You can see the templates format at the sources:https://github.com/php-maven/maven-php-plugin/blob/master/branches/2....
> Line 54 and 62.
>
> 2012/3/4 <gabor.di...@gmail.com>
>
>
>
>
>
>
>
> > Thanks Martin.
>
> > I found a workaround, replace the buildFromIterator call in
> > packagePhar.php with the following:
>
> > $phar->buildFromDirectory(realpath('/path/to/project/my-app/target/classes' ));
>
> > If for some reason this should not suit your needs, here's what I tried
> > before that. I also found the suggestion you mentioned and edited the
> > packagePhar.php to use the suggested "IgnorantRecursiveDirectoryIterator"
> > but it didn't help. Looks like a similar extension could be made
> > to RecursiveIteratorIterator as well, but I didn't know what to override
> > here so I got stuck. I also tried to pass a RecursiveRegexIterator instance
> > wrapping the DirectoryIterator to the RecursiveIteratorIterator to filter
> > values that don't start with the classes directory's path but that didn't
> > work either, possibly my regexp wasn't correct. Maybe you'll find out how
> > to do that.
>
> > Anyway, to me it seems that buildFromDirectory works fine. Is there a way
> > for me to edit the template of packagePhar.php? It gets overwritten every
> > time I use mvn package. Thanks,
>
> > Gábor
>
> > 2012. március 4., vasárnap 16:32:33 UTC+1 időpontban Martin Eisengardt a
> > következőt írta:
>
> >> I saw some notes at php.net manuals.  http://www.php.net/manual/en/**
> >> class.**recursivedirectoryiterator.**php#101654<http://www.php.net/manual/en/class.recursivedirectoryiterator.php#101654>
> >> I do not know why this happens. However the next beta will fix it in the
> >> mentioned way.
>
> >> And in beta 3 we will have a way to influence the used snippet.php. So
> >> that you are able to experiment with various variants and hopefully we find
> >> the cause for this exception.
>
> > 2012. március 4., vasárnap 16:32:33 UTC+1 időpontban Martin Eisengardt a
> > következőt írta:
>
> >> I saw some notes at php.net manuals.  http://www.php.net/manual/en/**
> >> class.**recursivedirectoryiterator.**php#101654<http://www.php.net/manual/en/class.recursivedirectoryiterator.php#101654>
> >> I do not know why this happens. However the next beta will fix it in the
> >> mentioned way.
>
> >> And in beta 3 we will have a way to influence the used snippet.php. So
> >> that you are able to experiment with various variants and hopefully we find
> >> the cause for this exception.
>
> > 2012. március 4., vasárnap 16:32:33 UTC+1 időpontban Martin Eisengardt a
> > következőt írta:
>
> >> I saw some notes at php.net manuals.  http://www.php.net/manual/en/**
> >> class.**recursivedirectoryiterator.**php#101654<http://www.php.net/manual/en/class.recursivedirectoryiterator.php#101654>
> >> I do not know why this happens. However the next beta will fix it in the
> >> mentioned way.
>
> >> And in beta 3 we will have a way to influence the used snippet.php. So
> >> that you are able to experiment with various variants and hopefully we find
> >> the cause for this exception.
>
> > 2012. március 4., vasárnap 16:32:33 UTC+1 időpontban Martin Eisengardt a
> > következőt írta:
>
> >> I saw some notes at php.net manuals.  http://www.php.net/manual/en/**
> >> class.**recursivedirectoryiterator.**php#101654<http://www.php.net/manual/en/class.recursivedirectoryiterator.php#101654>

martin.eisengardt

unread,
Mar 4, 2012, 8:17:42 PM3/4/12
to maven-...@googlegroups.com
hmmm. that will not work because the paths within phar will not be correct. The files will contain the folder "classes/" as prefix.
But maybe you can find a way that works. What Operating System are you using?
 
The correct place in the pom is:
<build><plugins><plugin>
<groupid>org.phpmaven</groupid>
<artifactid>maven-php-plugin</artifactid>
<configuration>
    <pharConfig>....</phrConfig>
......

v0idnull

unread,
Mar 5, 2012, 9:28:02 PM3/5/12
to Maven for PHP
Same error for me.

Fixed it by doing new RecursiveDirectoryIterator('/the/dir',
FilesystemIterator::SKIP_DOTS);

Unfortunately, the packagePhar.php is overwritten each build.

On Mar 4, 8:17 pm, "martin.eisengardt"

Gábor Dicső

unread,
Mar 11, 2012, 3:49:37 AM3/11/12
to maven-...@googlegroups.com
Thanks v0idnull, SKIP_DOTS helped! The RecursiveDirectoryIterator must have crawled ".." before. This is where you have to put it in your pom.xml:

...
    <build>
        <plugins>
            <plugin>
                <groupId>org.phpmaven</groupId>
                <artifactId>maven-php-plugin</artifactId>
                <configuration>
           <pharConfig>
               <packagePhpDirectory>
$phar->buildFromIterator(new RecursiveIteratorIterator(new RecursiveDirectoryIterator(
realpath('$:{pkgdir}'), FilesystemIterator::SKIP_DOTS)),
realpath('$:{pkgbasedir}'));
               </packagePhpDirectory>
           </pharConfig>
...
                </configuration>
            </plugin>
...
        </plugins>
    </build>
...

Martin, today I tried to take a look at the packagePhar.php templates again here:


but the file is missing. I see there were some related changes in the code. I tried to find the templates but I couldn't. Can you please tell me where they are? I'd like to make some more changes. Thanks!

Gábor

2012/3/6 v0idnull <v0id...@gmail.com>
--
You received this message because you are subscribed to the Google Groups "Maven for PHP" group.
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.




--
Üdvözlettel / Best Regards

Gabor Dicso | +36308237933 | Gabor...@inepex.com
 http://inepex.com | IT Development and Location Based Services

martin.eisengardt

unread,
Mar 11, 2012, 5:28:13 AM3/11/12
to maven-...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages