• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

httphotoshop访问nexus 以和Maven和VUE私服的创建

武飞扬头像
gc889900
帮助1

注意:

1,不要使用docker版的nexus,要不然哭的很惨

2,SSL的key怎么弄这里就不做说明了

3,nginx,nexus安装网上太多了哈就不说了

整活儿

  • 配置nginx

截取部分配置信息

  1.  
     
  2.  
    server {
  3.  
    listen 443 ssl;
  4.  
    server_name localhost;
  5.  
    root /usr/share/nginx/html;
  6.  
    underscores_in_headers on;
  7.  
     
  8.  
    ssl_certificate "/etc/nginx/key/XXXXX.pem";
  9.  
    ssl_certificate_key "/etc/nginx/key/XXXXX.key";
  10.  
    ssl_session_cache shared:SSL:1m;
  11.  
    ssl_session_timeout 5m;
  12.  
    ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
  13.  
    ssl_ciphers ECDH:AESGCM:HIGH:!RC4:!DH:!MD5:!3DES:!aNULL:!eNULL;
  14.  
    ssl_prefer_server_ciphers on;
  15.  
    location / {
  16.  
    proxy_pass http://localhost:8085;
  17.  
    proxy_set_header REMOTE_ADDR $remote_addr;
  18.  
    proxy_set_header Host $http_host;
  19.  
    proxy_set_header X-Forwarded-Proto https;
  20.  
    proxy_http_version 1.1;
  21.  
    proxy_set_header Connection "";
  22.  
    proxy_set_header Upgrade $http_upgrade;
  23.  
    proxy_set_header Connection "upgrade";
  24.  
    }
  25.  
    }
学新通

没有什么特殊的  underscores_in_headers 表示头信息可以用下划线

重启 ./nginx -s reload

  • 配置nexus
  • 再nexus中添加证书(读取PEM,复制进去)

学新通

配置匿名访问

学新通

  • 配置库,maven和vue大体一样,就是在创建host,group,proxy的时候别选错了,这里就拿vue举例

        先创建blob

        学新通

创建host

学新通

创建proxy(可能有多个)

学新通

可以根据自己的服务器网速用nrm 或者yrm测试一下

 这里是常用的代理地址

  npm ---------- https://registry.npmjs.org/

  yarn --------- https://registry.yarnpkg.com/

  tencent ------ tencent npm mirrors

  cnpm --------- https://r.cnpmjs.org/

  taobao ------- https://registry.npmmirror.com/

  npmMirror ---- https://skimdb.npmjs.com/registry/

创建group,把刚刚创建的htos和proxy都放进去

学新通

 重启nexus

  • 在客户端使用的时候需要登陆

npm login --registry='https://ip:8081/repository/npm-public/'

更换源

npm config set registry  'https://ip:8081/repository/npm-public/'

npm install

  • Maven的配置

学新通

 在打包的过程中可能会遇到的错

(1) sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

(2) Could not transfer artifact org.jyaml:jyaml:pom:1.3 from/to nexus (https://ip/repository/info-public/): Transfer failed for phttps://ip/repository/info-public/org/jyaml/jyaml/1.3/jyaml-1.3.pom

都是一个解决方法(注意配置好环境变量)

mvn clean install -Dmaven.test.skip=true  -Dmaven.multiModuleProjectDirectory=$MAVEN_HOME -Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.ignore.validity.dates=true

(3) npm ERR! code E401

npm ERR! Unable to authenticate, need: BASIC realm="Sonatype Nexus Repository Manager"

解决  客户端需要登陆

(4) npm ERR! Failed at the nodent-runtime@3.2.1 install script.

npm ERR! Failed at the node-sass@4.14.1 postinstall script.

这个需要先设置

npm config set sass_binary_site=https://npm.taobao.org/mirrors/node-sass

(5) Setting the TLS ServerName to an IP address is not permitted by RFC 6066. This will be ignored in a future version.

https访问时不能直接用ip需要映射一个域名

在设置一下ssl忽略验证 yarn & npm  config  set strict-ssl false

(6) 每个用户有自己的yarn配置,查看 yarn config list

删除配置 npm config delete <#name#>

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanhgegjgf
系列文章
更多 icon
同类精品
更多 icon
继续加载