php-maven/maven-php-plugin — Issue #10: Archetype still not working
Author: achingbrain
Created: 2012-03-07 15:36:22+00:00
State: open

Since you've fixed issue #9 but not yet updated the snapshots on http://repos.php-maven.org/snapshots , I cloned the git repo, went into /branches/2.0-SNAPSHOT/archetypes/php5-web-archetype and did a mvn install.

Now running:

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

works, hurrah! However after changing to the newly created my-app directory, running:

$ mvn package

does not. Instead, I get this error message:

$ mvn package
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.sample:my-app:0.0.1-SNAPSHOT (/Users/alex/Sites/foo/my-app/pom.xml) has 1 error
[ERROR] Non-resolvable parent POM: Could not find artifact org.phpmaven:php-parent-pom:pom:2.0-SNAPSHOT and 'parent.relativePath' points at wrong local POM @ line 5, column 13 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/ProjectBuildingException
[ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/UnresolvableModelException

Looking at the pom there is indeed a reference to a parent project. Commenting out the reference to the parent and running mvn package again, I get:

$ mvn package
[INFO] Scanning for projects...
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project org.sample:my-app:0.0.1-SNAPSHOT (/Users/alex/Sites/foo/my-app/pom.xml) has 1 error
[ERROR] Unknown packaging: php @ line 20, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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/ProjectBuildingException

There's likely to be another issue as the pom generated by the archetype has no repositories or pluginRepositories so maven will not know where to get the maven-php-plugin from.