I was following the guidelines here: http://www.php-maven.org/branches/2.0-SNAPSHOT/php-web-5min.html to get a simple php web archetype project running, but the create archetype command fails to run. Looks like the template parser is tripping up over the inclusion of jQuery.
You should be able to fix this by specifying filtered="false" for the file set that includes jQuery in /src/main/resources/META-INF/maven/archetype-metadata.xml in the project that generates the archetype.
"(" ...
...
...
...
"##" ...
"\\" ...
"\" ...
...
"_#" ...
"_#" ...
...
...
...
...
...
...
...
...
...
"{" ...
"}" ...
```
at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3360)
at org.apache.velocity.runtime.parser.Parser.jj_consume_token(Parser.java:3237)
at org.apache.velocity.runtime.parser.Parser.process(Parser.java:260)
at org.apache.velocity.runtime.parser.Parser.parse(Parser.java:105)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:1042)
at org.apache.velocity.runtime.RuntimeInstance.parse(RuntimeInstance.java:972)
at org.apache.velocity.Template.process(Template.java:120)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplate(DefaultFilesetArchetypeGenerator.java:655)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFileSet(DefaultFilesetArchetypeGenerator.java:476)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplates(DefaultFilesetArchetypeGenerator.java:703)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processArchetypeTemplates(DefaultFilesetArchetypeGenerator.java:451)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetProject(DefaultFilesetArchetypeGenerator.java:560)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetModule(DefaultFilesetArchetypeGenerator.java:495)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:210)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processFileSetArchetype(DefaultArchetypeGenerator.java:136)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:106)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:149)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:209)
at org.apache.maven.archetype.DefaultArchetypeManager.generateProjectFromArchetype(DefaultArchetypeManager.java:71)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:190)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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:319)
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)
```
[ERROR] ResourceManager.getResource() parse exception
[ERROR] org.apache.velocity.exception.ParseErrorException: Encountered ")" at line 4, column 738 of archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js
Was expecting one of:
"(" ...
...
...
...
"##" ...
"\\" ...
"\" ...
...
"_#" ...
"_#" ...
...
...
...
...
...
...
...
...
...
"{" ...
"}" ...
```
at org.apache.velocity.Template.process(Template.java:137)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplate(DefaultFilesetArchetypeGenerator.java:655)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFileSet(DefaultFilesetArchetypeGenerator.java:476)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplates(DefaultFilesetArchetypeGenerator.java:703)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processArchetypeTemplates(DefaultFilesetArchetypeGenerator.java:451)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetProject(DefaultFilesetArchetypeGenerator.java:560)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetModule(DefaultFilesetArchetypeGenerator.java:495)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:210)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processFileSetArchetype(DefaultArchetypeGenerator.java:136)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:106)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:149)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:209)
at org.apache.maven.archetype.DefaultArchetypeManager.generateProjectFromArchetype(DefaultArchetypeManager.java:71)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:190)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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:319)
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)
```
[ERROR] org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered ")" at line 4, column 738 of archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js
Was expecting one of:
"(" ...
...
...
...
"##" ...
"\\" ...
"\" ...
...
"_#" ...
"_#" ...
...
...
...
...
...
...
...
...
...
"{" ...
"}" ...
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered ")" at line 4, column 738 of archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js
Was expecting one of:
"(" ...
...
...
...
"##" ...
"\\" ...
"\" ...
...
"_#" ...
"_#" ...
...
...
...
...
...
...
...
...
...
"{" ...
"}" ...
```
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:233)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.processFileSetArchetype(DefaultArchetypeGenerator.java:136)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:106)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:149)
at org.apache.maven.archetype.generator.DefaultArchetypeGenerator.generateArchetype(DefaultArchetypeGenerator.java:209)
at org.apache.maven.archetype.DefaultArchetypeManager.generateProjectFromArchetype(DefaultArchetypeManager.java:71)
at org.apache.maven.archetype.mojos.CreateProjectFromArchetypeMojo.execute(CreateProjectFromArchetypeMojo.java:190)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
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:319)
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.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered ")" at line 4, column 738 of archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js
Was expecting one of:
"(" ...
...
...
...
"##" ...
"\\" ...
"\" ...
...
"_#" ...
"_#" ...
...
...
...
...
...
...
...
...
...
"{" ...
"}" ...
```
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplate(DefaultFilesetArchetypeGenerator.java:665)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFileSet(DefaultFilesetArchetypeGenerator.java:476)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplates(DefaultFilesetArchetypeGenerator.java:703)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processArchetypeTemplates(DefaultFilesetArchetypeGenerator.java:451)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetProject(DefaultFilesetArchetypeGenerator.java:560)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processFilesetModule(DefaultFilesetArchetypeGenerator.java:495)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.generateArchetype(DefaultFilesetArchetypeGenerator.java:210)
... 27 more
```
Caused by: org.apache.velocity.exception.ParseErrorException: Encountered ")" at line 4, column 738 of archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js
Was expecting one of:
"(" ...
...
...
...
"##" ...
"\\" ...
"\" ...
...
"_#" ...
"_#" ...
...
...
...
...
...
...
...
...
...
"{" ...
"}" ...
```
at org.apache.velocity.Template.process(Template.java:137)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.loadResource(ResourceManagerImpl.java:415)
at org.apache.velocity.runtime.resource.ResourceManagerImpl.getResource(ResourceManagerImpl.java:335)
at org.apache.velocity.runtime.RuntimeInstance.getTemplate(RuntimeInstance.java:1102)
at org.apache.velocity.app.VelocityEngine.mergeTemplate(VelocityEngine.java:498)
at org.apache.maven.archetype.generator.DefaultFilesetArchetypeGenerator.processTemplate(DefaultFilesetArchetypeGenerator.java:655)
... 33 more
```
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 32.552s
[INFO] Finished at: Tue Mar 06 14:00:13 GMT 2012
[INFO] Final Memory: 7M/1019M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.0:generate (default-cli) on project standalone-pom: org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered ")" at line 4, column 738 of archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js
[ERROR] Was expecting one of:
[ERROR]
[ERROR] "(" ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] "##" ...
[ERROR] "\\" ...
[ERROR] "\" ...
[ERROR] ...
[ERROR] "_#" ...
[ERROR] "_#" ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] ...
[ERROR] "{" ...
[ERROR] "}" ...
[ERROR] -> [Help 1]
[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/MojoFailureException
I was following the guidelines here: http://www.php-maven.org/branches/2.0-SNAPSHOT/php-web-5min.html to get a simple php web archetype project running, but the create archetype command fails to run. Looks like the template parser is tripping up over the inclusion of jQuery.
You should be able to fix this by specifying filtered="false" for the file set that includes jQuery in /src/main/resources/META-INF/maven/archetype-metadata.xml in the project that generates the archetype.
I'm running:
mvn archetype:generate \ -DarchetypeGroupId=org.phpmaven \ -DarchetypeArtifactId=php5-web-archetype \ -DarchetypeVersion=2.0-SNAPSHOT \ -DarchetypeRepository=http://repos.php-maven.org/snapshots \ -DgroupId=org.sample \ -DartifactId=my-app \ -Dversion=0.0.1-SNAPSHOT
The output I get is:
[INFO] Scanning for projects... [INFO]
[INFO] ------------------------------------------------------------------------ [INFO] Building Maven Stub Project (No POM) 1 [INFO] ------------------------------------------------------------------------ [INFO] [INFO] >>> maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom >>> [INFO] [INFO] <<< maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom <<< [INFO] [INFO] --- maven-archetype-plugin:2.0:generate (default-cli) @ standalone-pom --- [INFO] Generating project in Interactive mode [INFO] Archetype defined by properties Downloading: http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml [WARNING] Checksum validation failed, expected 46df6fb93318ed26e17a4fb463953b7dc94fd27d but is 6af22a37eac733091f43f96243e9a36b0d37c783 for http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml [WARNING] Checksum validation failed, expected 46df6fb93318ed26e17a4fb463953b7dc94fd27d but is 6af22a37eac733091f43f96243e9a36b0d37c783 for http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml Downloaded: http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml (774 B at 2.1 KB/sec) Downloading: http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml [WARNING] Checksum validation failed, expected 46df6fb93318ed26e17a4fb463953b7dc94fd27d but is 6af22a37eac733091f43f96243e9a36b0d37c783 for http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml [WARNING] Checksum validation failed, expected 46df6fb93318ed26e17a4fb463953b7dc94fd27d but is 6af22a37eac733091f43f96243e9a36b0d37c783 for http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml Downloaded: http://repos.php-maven.org/snapshots/org/phpmaven/php5-web-archetype/2.0-SNAPSHOT/maven-metadata.xml (774 B at 3.8 KB/sec) [INFO] Using property: groupId = org.sample [INFO] Using property: artifactId = my-app [INFO] Using property: version = 0.0.1-SNAPSHOT [INFO] Using property: package = org.sample Confirm properties configuration: groupId: org.sample artifactId: my-app version: 0.0.1-SNAPSHOT package: org.sample Y: : [ERROR] Parser Exception: archetype-resources/src/main/resources/webapp/javascript/jquery-1.7.min.js [ERROR] org.apache.velocity.runtime.parser.ParseException: Encountered ")" at line 4, column 738. Was expecting one of: