Search code examples
mavennpmnpm-installexec-maven-plugin

maven npm exec-maven-plugin set registry and proxy


Maven + npm install

I have following plugin to install package.json dependencies, is there a way i can run npm config set registry and npm config set proxy command with following plugin ?

<plugin>
          <groupId>org.codehaus.mojo</groupId>
          <artifactId>exec-maven-plugin</artifactId>
          <executions>
                <execution>
                  <id>exec-npm-install</id>
                  <phase>generate-sources</phase>

                  <goals>
                    <goal>exec</goal>
                  </goals>

                  <configuration>
                    <executable>npm</executable>
                    <arguments>
                      <argument>install</argument>
                    </arguments>
                    <workingDirectory>${basedir}/src/main/webapp</workingDirectory>
                  </configuration>

                </execution>
           </executions>
        </plugin>

Solution

  • was able to get it done through .nprmc file on project root

    create file and have entry like

    registry= proxy=