I am getting an issue while trying to generate a project from my maven archetype. Everything was alright when javascript files weren't parsed (i.e. exclude in the archetype-metadata.xml
file). But I need to insert ${MyProject}
variable in some js files and so not to exclude my project js files.
Here is my archetype configuration : (archetype-metadata.xml
file)
<!-- Project Web Content -->
<fileSet filtered="true" packaged="false" encoding="UTF-8">
<directory>src/main/webapp</directory>
<excludes>
<exclude>js/libs/**/*</exclude>
<exclude>js/angular-mock/**/*</exclude>
<exclude>template/**/*</exclude>
<exclude>views/**/*</exclude>
<exclude>img/**/*</exclude>
<exclude>font/**/*</exclude>
<exclude>icones/**/*</exclude>
<exclude>css/**/*</exclude>
</excludes>
</fileSet>
Here are the different errors I get with 3 test cases (I tried to exclude in archetype-metadata.xml
some files where I get the errros) :
Unable to create project from archetype [com.mypackage.archetypes:ngwis-project:2.0-SNAPSHOT]
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered "}" at line 14, column 25 of archetype-resources/__rootArtifactId__Web/src/main/webapp/js/__rootArtifactId__/application.js
Was expecting one of:
"[" ...
"{" ...
<STRING_LITERAL> ...
"true" ...
"false" ...
<INTEGER_LITERAL> ...
<FLOATING_POINT_LITERAL> ...
<IDENTIFIER> ...
"{" ...
Unable to create project from archetype [com.mypackage.archetypes:ngwis-project:2.0-SNAPSHOT]
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered "() { return item; },\r\n\t\t\t\t\t columns : function() { return scope.columns; },\r\n\t\t\t\t\t service: function() { return scope.service; },\r\n\t\t\t\t\t newItem: function() { return isNewItem; }\r\n\t\t\t\t\t }\r\n\t\t\t\t\t });\r\n\r\n\t\t\t\t\t\tmodalInstance.result.then(\r\n\t\t\t\t\t\t\tfunction (selectedItem) {\r\n\t\t\t\t\t\t\t\tscope.onclosemodal(selectedItem);\r\n\t\t\t\t\t\t\t\tscope.tableParams.reload();\r\n\t\t\t\t\t\t\t}, function () {\r\n\t\t\t\t\t\t\t\tconsole.log(\'Modal dismissed at: \' + new Date());\r\n\t\t\t\t\t\t\t});\r\n\t\t\t\t\t};\r\n\t\t\t\t\t\r\n\t\t\t\t\tscope.isSelectable = function() {\r\n\t\t\t\t\t\treturn scope.select && scope.select !== angular.noop;\r\n\t\t\t\t\t};\r\n\t\t\t\t\tscope.totalElements = 0;\r\n\t\t\t\t\tscope.hasElements = function () {\r\n\t\t\t\t\t\treturn (scope.totalElements > 0);\r\n\t\t\t\t\t}\r\n\t\t\t\t scope.tableParams = new ngTableParams({\r\n\t\t\t\t page: 1, // show first page\r\n\t\t\t\t count: scope.displayedLines, // count per page\r\n\t\t\t\t filter : scope.filter || {},\t// filtering\r\n\t\t\t\t sorting : scope.sort || {}\t\t//order by\r\n\t\t\t\t }, {\r\n\t\t\t\t \tcounts : [10, 25, 50, 100],\r\n\t\t\t\t total: 0, // length of data\r\n\t\t\t\t getData: function(" at line 143, column 66 of archetype-resources/__rootArtifactId__Web/src/main/webapp/js/__rootArtifactId__/directives/directives.js
Was expecting one of:
"," ...
"}" ...
Unable to create project from archetype [com.mypackage.archetypes:ngwis-project:2.0-SNAPSHOT]
org.apache.maven.archetype.exception.ArchetypeGenerationFailure: Error merging velocity templates: Encountered "(value) { \n\t\t" at line 16, column 41 of archetype-resources/__rootArtifactId__Web/src/main/webapp/js/__rootArtifactId__/controllers/controllers.js
Was expecting one of:
"," ...
")" ...
Any idea ? Thanks