osu*_*lad 4 artifactory maven node.js npm
我们有一个公司代理,阻止我使用maven-frontend-plugin.
问题是,要获取npm和bower依赖项,我们使用内部Artifactory,因此我们不应该为此设置任何代理设置.但实际的可执行文件是直接获取的,因此要获取它们我们需要代理.并且前端插件似乎不支持特定域的例外.
那么有一种简单的方法可以将npm和nodejs可执行文件上传到我们的内部工件中,以便我们可以完全跳过代理吗?或者另一种解决方法?
编辑
我在这里添加解决方案是为了方便,因为我需要修改下面批准的答案.
在Artifactory中设置两个远程存储库,一个设置为nodejs(https://nodejs.org/dist/),另一个设置为npm(https://registry.npmjs.org/npm/-/).
编辑你的maven-frontend-plugin配置:
<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>
Run Code Online (Sandbox Code Playgroud)
有可能只使用nodejs repo(但是npm仅适用于版本1.4.9)将npmDownloadRoot更改为:
<npmDownloadRoot>https://artifactory.my company.com/artifactory/nodejs.dist/npm/</npmDownloadRoot>
并且不要忘记从maven中删除代理设置 settings.xml
要从Artifactory安装节点和npm可执行文件,您应该:
downloadRoot属性来完成,例如:<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>
Run Code Online (Sandbox Code Playgroud)
有关更多信息,请参阅插件文档中的安装节点和npm
| 归档时间: |
|
| 查看次数: |
3477 次 |
| 最近记录: |