We have a company proxy that prevents me from using the maven-frontend-plugin as it is.
The problem is that to fetch npm and bower dependencies we use an internal Artifactory so we should not have any proxy settings for that. But the actual executables are fetched directly thus to fetch them we need the proxy. And the frontend-plugin doesn't seem to support exceptions for specific domains.
So is there an easy way to upload npm and nodejs executables to our internal artifactory so that we can skip the proxy altogether? Or another way of solving this?
Edit
I add the solution here for ease since I needed to modify the answer I approved below.
Set up two remote repositories in Artifactory, one to nodejs (https://nodejs.org/dist/
) and one to npm (https://registry.npmjs.org/npm/-/
).
The edit your maven-frontend-plugin configuration:
<execution>
<!-- optional: you don't really need execution ids,
but it looks nice in your build log. -->
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<nodeVersion>v0.12.1</nodeVersion>
<npmVersion>2.14.1</npmVersion>
<!-- use the URL for the repository you created in step 1 -->
<nodeDownloadRoot>https://artifactory.my company.com/artifactory/nodejs.dist/</nodeDownloadRoot>
<npmDownloadRoot>https://artifactory.my company.com/artifactory/npm.dist/</npmDownloadRoot>
</configuration>
</execution>
It was possible to only use only the nodejs repo (but then npm is available only to version 1.4.9) Change npmDownloadRoot to:
<npmDownloadRoot>https://artifactory.my company.com/artifactory/nodejs.dist/npm/</npmDownloadRoot>
And don't forget to remove the proxy settings from your maven settings.xml
To install the node and npm executables from Artifactory you should:
downloadRoot
property, for example:<execution>
<!-- optional: you don't really need execution ids,
but it looks nice in your build log. -->
<id>install node and npm</id>
<goals>
<goal>install-node-and-npm</goal>
</goals>
<!-- optional: default phase is "generate-resources" -->
<phase>generate-resources</phase>
<configuration>
<nodeVersion>v0.10.18</nodeVersion>
<npmVersion>1.3.8</npmVersion>
<!-- use the URL for the repository you created in step 1 -->
<downloadRoot>http://localhost:8081/artifactory/repo-id/</downloadRoot>
</configuration>
</execution>
For more info see installing node and npm in the plugin documentation
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With