cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco behavior tutorial - parse error

Rista
Champ in-the-making
Champ in-the-making

I'm following Alfresco Developer Series tutorial from ECM architect. In the behavior tutorial section a custom behavior is first implemented in Java and then in JavaScript.

https://ecmarchitect.com/alfresco-developer-series-tutorials/behaviors/tutorial/tutorial.html

The Java part goes fine. But when I re-implement the behavior in JavaScript by adding rating.js, onCreateRating.js and onDeleteRating.js files (to $TUTORIAL_HOME/behavior-tutorial-platform/src/main/resources/alfresco/module/behavior-tutorial-platform/scripts), configure a Spring bean and then try to mvn install -DskipTests, I get this error:

SEVERE: alfresco/module/behavior-tutorial-platform/scripts/onCreateRating.js:1:1: ERROR - [JSC_PARSE_ERROR] Parse error. primary expression expected
  1| <import resource="classpath:alfresco/module/behavior-tutorial-platform/scripts/rating.js">

ERROR] Failed to execute goal com.github.blutorange:closure-compiler-maven-plugin:2.28.0:minify (compress-resources) on project behavior-tutorial-platform: Closure compilation failure: FileException

When I remove the import tag, the files are successfuly minified but of course that's not a solution.

Any idea what am I doing wrong? Keep in mind I'm new to java/js/maven so it could be something very obvious. Thanks in advance.

0 REPLIES 0