Generator-jhipster: [FEATURE] Using local bower in yeoman.gradle

Created on 8 Sep 2016  路  8Comments  路  Source: jhipster/generator-jhipster

Overview of the issue

When setting up a jenkins job for my jhipster project I was able to avoid having to install bower globally by changing yeoman.gradle to use the local version of bower in node_modules.

task bower(type: Exec) {
    if (Os.isFamily(Os.FAMILY_WINDOWS)) {
        commandLine 'cmd', '/c', 'bower', 'install'
    }else{
        commandLine 'node_modules/bower/bin/bower', 'install'
    }
}

What do you think? We already download bower, might as well use it.

area area

Most helpful comment

From my understanding this will disappear with AngularJS 2 -> let's focus on AngularJS 2 instead

All 8 comments

If there is a local version present bower install would use that. Thats my understanding of how npm stuff works. SO I dont know why you need to point it to the local copy specifically?

Does is it also work on Windows and with gradle? But I don't see the advantage at the moment.

Jenkins kept complaining about not knowing the command "bower". It's not installed with npm install -g on the Jenkins box. The only thing, besides installing bower globally that fixed it for me was to point it at the local copy.

Have you locked at http://jhipster.github.io/setting-up-ci-linux/? When using the Jenkins node plugin you can declare globally installed packages which works fine.

@atomfrede Yes, I saw that. I could have installed them (or in my case, asked another team to please install them whenever they get to it...) but in the end it was just easier to point it at the local versions that npm already downloaded (both gulp and bower).
Not a big deal, just a little hiccup when you don't have admin rights on your CI system.

@bjoernw Ah I see (and I know the problem). Maybe you can put it into the tips section of the documentation? http://jhipster.github.io/tips/

From my understanding this will disappear with AngularJS 2 -> let's focus on AngularJS 2 instead

I'm closing this, as the AngularJS 2 focus is more important at the moment, and Bower should die after that.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

sdoxsee picture sdoxsee  路  4Comments

lsadehaan picture lsadehaan  路  3Comments

Steven-Garcia picture Steven-Garcia  路  3Comments

dronavallisaikrishna picture dronavallisaikrishna  路  3Comments

kaidohallik picture kaidohallik  路  3Comments