I have a little web app using Spring Boot and Angular 1, Maven and Wro4j, and I want to give a try to Angular 2, which I am completely new in.
I use Maven/Wro4j 1.8.0 to minify at compile time and get a single js file for angular dependencies, which I then use in my index.html header. While it worked with my angular 1 app, minifying fails now. I use jsMin
as a processor. It fails when handling webjar:angular__compiler/2.1.1/bundles/compiler.umd.js
.
Digging in the wro4j doc, I found the ngAnnotate
processor, which may be the solution to my problem. But I got two more issues there:
- I added ng-annotate 1.2.1 to my pom.xml (wro4j dependencies) but it fails because of an unsatisfied transitive dependency to acorn (ng-annotate 1.2.1 pom depends on acorn [2.6.4,2.7), and there is no such version on Maven central). To circumvemt this, I edited the ng-annotate pom to use acorn 2.7.0, which may not be the best solution.
- After getting my dependency OK and adding
ngAnnotate
to the processors list (beforejsMin
), I get this error message:
processor is not supported on this environment
It seems that it tries to run ng-annotate and does not find it. The Wro4j documentation states that "The implementation assume the required npm is installed". I thought (wrongly, it seems) that adding the ng-annotate webjar to the pom would be enough. What did I miss?
Note: I would really like to go on letting Maven handle all the configuration (Java and Js), which worked before, instead of switching to a js dependency solution. I never used any npm command, nor grunt, nor bower, and never needed it so far.