Open erex1 opened 8 years ago
Unfortunately, the plugin isn't written for the use case with multiple modules sharing the same node/npm executables. You could use something like npm with <arguments>run bower</arguments>
, and then define a "bower" script in package.json that does what you want.
Thanks for the fast response! Helped me alot!
Never used npm scripts before, so I didnt think of that at all.
This is what I ended up with:
I placed these package.json files within the client modules:
{
"private": true,
"devDependencies": {
},
"scripts": {
"bower": "bower install --config.interactive=false"
}
}
and changed the bower install part of the clients pom to this:
<execution>
<id>npm run bower</id>
<goals>
<goal>npm</goal>
</goals>
<configuration>
<arguments>run bower</arguments>
<workingDirectory>.</workingDirectory>
<installDirectory>../</installDirectory>
</configuration>
</execution>
Not sure if this is the best way to do this, but it seems to work.
Thanks again!
First of all, great plugin!
Here is my problem:
I have several clients (and more coming) that i want to build with same instance of node and grunt. Therefore i have a created a to module "web-parent" that contains node and grunt. I have placed my two webclients in two submodules. Lets call then "web-client-one" and "web-client-two", these webclients is build by Grunt using the Gruntfile in "web-parent", and they each use their own bower setup.
So my filestructure looks like this:
web-parent/ ├── web-client-one/ │ ├── .bowerrc │ ├── bower.json │ ├── bower │ ├── bower.cmd │ ├── ... │ └── pom.xml ├── web-client-two/ │ ├── .bowerrc │ ├── bower.json │ ├── bower │ ├── bower.cmd │ ├── ... │ └── pom.xml ├── node/ ├── node_modules/ ├── package.json ├── Gruntfile.js ├── ... └── package.json
All this works fine, and I can run "bower install" in both "web-client-one" and "web-client-two" in the cmd thanks to the helper classes bower and bower.cmd that is referencing node and node_modules in the "web-parent".
But this does not work when I try running "bower install" with the plugin. In the pom of "web-client-one" I have this code:
This does not work because "bower install" is trying to fetch node from "web-client-one":
I dont know how the helper classes bower and bower.cmd works, but they doesnt seem to have any effect when running "bower install" with the plugin. Is it shomething I am doing wrong? Or would it be possible to implement the functionality of the helper classes to the plugins configuration? I.e: A value that gives bower install a refrence to the local node and node_modules dir so that it would work the same way as when I am running bower install from cmd in my webclients dir.