1

When I try to build JHipster on a windows Jenkins instance, I get the following error

org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal com.github.trecloux:yeoman-maven-plugin:0.4:build (run-frontend-build) on project jhipster: Error during : cmd /c bower --version

I tried running Pprod clean package from the commandline and it works fine.

Any thoughts / Help appreciated.

wishy
  • 1,748
  • 2
  • 12
  • 14

2 Answers2

1

That's because Jenkins's node environment is not complete, make sure bower is in its path. Bower should be installed using npm install -g bower

Please refer to our documentation about Jenkins setup: http://jhipster.github.io/setting-up-ci/

Gaël Marziou
  • 16,028
  • 4
  • 38
  • 49
  • If I try installing node in C:/nodejs and add it to the env variables, node itself is not recognized by the yeoman-maven-plugin. If I try installing it to its default location (c:\program files\nodejs), bower is not recognized by yeoman-maven-plugin. In both cases, I went into c:\ and tried bower -version, node -version and npm -version (without path) and everything works as expected. I also tried -g install for bower but that did not work. – wishy Feb 08 '16 at 23:12
  • It depends on how you installed Jenkins, you may have installed it as a service running under system user. If so you have to make it run under under a local non priviledged user for whom you have correctly set the environment variables. – Gaël Marziou Feb 08 '16 at 23:47
  • Thanks Gaël Marziou for the pointers. I could resolve the issue using the NodeJS plugin - https://wiki.jenkins-ci.org/display/JENKINS/NodeJS+Plugin. I will add that as an answer if anyone else runs into the same issue. – wishy Feb 09 '16 at 01:32
  • Great, please consider submitting a pull request to improve our documentation https://github.com/jhipster/jhipster.github.io – Gaël Marziou Feb 09 '16 at 09:45
0

Thanks to Gaël Marziou, I zeroed in on the problem to access issues for the Jenkins user. I was able to solve it using the NodeJS plugin.

wishy
  • 1,748
  • 2
  • 12
  • 14