title: Using Maven to install Bower components with Bower installed globally
body: <p>I have bower installed globally using NPM. 
  In my Maven project I have a bower.json file, I am using the exec-maven-plugin to install the bower components on build, however it failed because it "cannot run the program 'bower' in directory" which makes sense because Bower is not locally installed in the project directory.</p>
  
  <p>However I want to use the global version of Bower so I don't have separate Bower programs in all my projects, it works if I go to the directory in terminal and manual run 'bower install'. </p>
  
  <p>Question: I want Maven to use my global Bower version to avoid me having duplicate copies of Bower in each project, how do I do this?</p>
  
  <p>This is the code from my POM file that runs the plugin and execution:</p>
  
  <pre><code> &lt;plugin&gt;
  
    &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt;
    &lt;artifactId&gt;exec-maven-plugin&lt;/artifactId&gt;
    &lt;version&gt;1.3.2&lt;/version&gt;
  
    &lt;executions&gt;
  
      &lt;execution&gt;
        &lt;id&gt;exec-bower-install&lt;/id&gt;
  
        &lt;phase&gt;generate-sources&lt;/phase&gt;
        &lt;configuration&gt;
  
          &lt;executable&gt;bower&lt;/executable&gt;
  
          &lt;arguments&gt;
            &lt;argument&gt;install&lt;/argument&gt;
          &lt;/arguments&gt;
  
        &lt;/configuration&gt;
        &lt;goals&gt;
          &lt;goal&gt;exec&lt;/goal&gt;
        &lt;/goals&gt;
      &lt;/execution&gt;
  
    &lt;/executions&gt;
  &lt;/plugin&gt;
  </code></pre>