I have a bell set globally using NPM. In my Maven project, I have a bower.json file, I use exec-maven-plugin to install bower components on the assembly, but this failed because it "cannot run the bower program in the directory", which makes sense, because Bower is not locally installed in the project directory.
However, I want to use the global version of Bower, so I do not have separate Bower programs in all my projects, it works if I go to the directory in the terminal and in manual mode "bower install".
Question: I want Maven to use my global version of Bower to avoid duplicate Bower instances in each project, how to do it?
This is the code from my POM file that launches the plugin and execution:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.3.2</version>
<executions>
<execution>
<id>exec-bower-install</id>
<phase>generate-sources</phase>
<configuration>
<executable>bower</executable>
<arguments>
<argument>install</argument>
</arguments>
</configuration>
<goals>
<goal>exec</goal>
</goals>
</execution>
</executions>
</plugin>
source
share