当前位置: 首页 > news >正文

用dw自己做网站微信小程序通知

用dw自己做网站,微信小程序通知,深圳市光明区住房和建设局网站,外贸销售管理制度文章目录下载 Nexus 服务器安装包安装 Nexus 服务器配置环境变量/启动服务器/停止服务器Nexus 服务器管理后台登录管理后台Blob StoresNexus 初始密码无法登录的问题仓库#xff08;Repository#xff09;Nexus 内置的仓库Repository 的 Type 属性创建代理仓库创建本地仓库RepositoryNexus 内置的仓库Repository 的 Type 属性创建代理仓库创建本地仓库也叫宿主仓库/私有仓库配置 Nexus 服务器Nexus 命令介绍迁移 Nexus 服务器中的数据删除 Nexus 服务器中的数据升级 Nexus部署工件到服务器通过配置文件发布工件到 Nexus 服务器第一种配置方式通过配置文件发布工件到 Nexus 服务器第二种配置方式通过 Maven 命令发布工件到 Nexus 服务器选择本地工件上传到 Nexus 宿主仓库从 Nexus 服务器自动下载依赖工件settings.xml 配置私服配置 profile 元素配置 mirror 元素镜像仓库配置pom.xml 配置私服Nexus 3 和 Nexus 2 的区别下载 Nexus 服务器安装包 目前的版本有 2.X 和 3.X 2.X 对 Maven 的支持更友好一点3.X 的支持范围更广支持 ruby 和 docker。但是 3.X 要求 JDK 的版本是1.8而且貌似还需要做特殊配制。有人下载下来解压后运行不起来看 sonatype-work 里面的 logs 报的是缺某个 jar 包所以如果没有别的需要只是搭建单纯的 Maven 私服建议直接使用版本 2.x。 官网地址https://www.sonatype.com/。 我在下面也给出了直接下载的地址 点击下载 Nexus Repository Manager OSS 3.x /点击下载 Nexus Repository Manager OSS 2.x /点击下载 Nexus Repository 3.x。 通过官网下载 nexus 服务器安装包可能因为网速的问题会导致下载失败我已经把安装包上传到百度云盘 链接: https://pan.baidu.com/s/11E8lMR3-j71aUbYeK__Tyg 提取码: e1fd 安装 Nexus 服务器 下载安装包后将其解压到你需要的目录下例如用户主目录/Applications/我就是解压到用户主目录下的 Applications 目录下如下图所示 解压后你可以看到目录 nexus-3.20.1-01-mac在这个目录下有两个子目录 nexus-3.20.1-01 和 sonatype-work。nexus-3.20.1-01 是程序sonatype-work 是工作目录如果以后要备份数据只要备份 sonatype-work 就行。 在与 nexus-3.20.1-01 目录同级的目录下创建一个指向 /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-3.20.1-01 的软链接以方便日后的升级 [~/Applications/nexus-3.20.1-01-mac]$ ln -s /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-3.20.1-01 /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-latest [~/Applications/nexus-3.20.1-01-mac]$ ls nexus-3.20.1-01 nexus-latest sonatype-work配置环境变量/启动服务器/停止服务器 在配置有关环境变量之前要启动 nexus 服务器你需要打开命令终端切换到 ~/Applications/nexus-3.20.1-01-mac/nexus-3.20.1-01/bin 目录下再执行启动命令如下所示 [~/Applications/nexus-3.20.1-01-mac/nexus-3.20.1-01/bin]$ ./nexus start Starting nexus [~/Applications/nexus-3.20.1-01-mac/nexus-3.20.1-01/bin]$ ./nexus status nexus is running.配置环境变量后则不必进入 nexus 的 bin 目录下执行启动命令。下面介绍下如何配置 nexus 的环境变量。 编辑用户主目录下 .bash_profile 文件 [~/Applications/nexus-3.20.1-01-mac]$ vim ~/.bash_profile在其中添加如下内容 # 创建环境变量NEXUS_HOME export NEXUS_HOME/Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-latest # 在环境变量PATH的值后面追加nexus的bin目录路径 PATH$PATH:$NEXUS_HOME/bin执行下面的命令使 .bash_profile 文件的配置立即生效 [~/Applications/nexus-3.20.1-01-mac]$ source ~/.bash_profile因为前面已经配置 nexus 的环境变量所以可以在任意目录执行 nexus 的命令例如我在用户主目录下执行下面的停止服务器的命令 [~]$ nexus stop Shutting down nexus Stopped. [~]$ nexus start Starting nexusNexus 服务器管理后台 nexus 服务器启动后在浏览器地址栏输入http://localhost:8081你可以打开 Nexus Repository 的管理后台的首页。 登录管理后台 通过右侧的 Sign In 登录管理后台。对于未登录的用户只能查询和浏览相关资源。用户登录后就能看到管理相关的菜单了。 早期版本的 Nexus 的管理后台默认登录用户名是 admin默认登录密码 admin123最新版的 Nexus 管理后台默认登录密码不再是 admin123具体参见下面的章节。 Blob Stores Blob Stores 是用来配置资源的保存位置的可以将不同的资源保存到服务器的不同位置上类似于 Nexus 2 的资源保存路径。 Nexus 初始密码无法登录的问题 之前版本的 nexus 系统管理后台默认的登录用户名和密码是admin/admin123新版的 nexus 的管理后台默认登录密码不再是 admin123。初始密码保存在 nexus 安装目录下的 sonatype-work/nexus3/admin.password 文件中打开文件可以看到如下内容 上面的内容即为密码明文而非加密后的结果直接复制到密码输入框即可。 登录成功之后会要求修改密码密码修改成功后admin.password 文件会自动被删除。 仓库Repository Nexus 内置的仓库 上图中的 Format 列maven2 是Java 仓库nuget 是 .net 仓库。 Repository 的 Type 属性 Repository 的 Type 有三种proxy、hosted、group。 proxy代理仓库。即你可以设置代理远程的仓库设置了代理之后在你的 Nexus 仓库中找不到需要的工件就会到代理的远程仓库中查找 hosted本地仓库。即本地的私有仓库。通常用来存放和管理非中央仓库或者你自己开发的工件包。这仓库有 release 和 snapshots 两种类型自己在构建工件包的时候就需要指定 release正式版/发行版 还是 snapshots开发版。 group组合仓库。这种类型的仓库可以组合多个仓库然后用户只要访问这个组合仓库就可以同时访问被组合的其它成员仓库。一般用来给用户一个访问 Nexus 仓库的统一地址。组合仓库中可以看到成员仓库中的工件资源但是无权删除。 实际的使用场景通常是这样的你可以上传私有的工件到 hosted 仓库中代理仓库中配置被代理的远程仓库的 URL 以获取第三方的依赖比如可以配置中央仓库的地址。本地私有仓和代理仓都弄好了之后再通过 group 仓库进行组合这样就可以将组合仓库的 URL 对外提供使用了。 总结 Maven 可以直接从宿主仓库本地私有仓库下载构件Maven 也可以从代理仓库下载构件而代理仓库中若没有请求的构件则会自动地从被代理的远程仓库下载构件并缓存构件Maven 可以从组合仓库下载构件而组合仓库没有请求的构件组合仓库会转向其包含的宿主仓库或者代理仓库获取请求的构件。 组合仓库的详情界面如下图所示 特别注意组仓库会按从上到下的顺序访问成员仓库。 创建代理仓库 Repository Name 和 Remote storage 填写好之后就可以直接点击下方的 Create repository 创建仓库了。 代理仓库创建好之后就可以复制仓库的 URL在 settings.xml 或者项目的 pom.xml 中进行私服仓库的配置具体请参见下面的章节。 创建本地仓库也叫宿主仓库/私有仓库 配置 Nexus 服务器 打开 /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-3.20.1-01/etc 目录下的属性文件 nexus-default.properties打开后默认的内容如下 ## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties ## # Jetty section application-port8081 application-host0.0.0.0 nexus-args${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml nexus-context-path/# Nexus section nexus-editionnexus-pro-edition nexus-features\ nexus-pro-featurenexus.hazelcast.discovery.isEnabledtrueapplication-host是 nexus 服务器的 IP 地址默认为 0.0.0.0表示只要是本机上的 IP就能连上 nexus 服务器。为了安全和屏蔽掉其他IP建议改成 localhost 默认指向的 IP即 127.0.0.1。 application-port是 IP 的端口号默认为 8081如果端口号被占用可以换成其他端口号。 nexus-context-path上下文路径默认 /类似 Java Web 项目的虚拟目录如果添加上下文路径需要在访问地址后面加上下文路径即访问地址变为application-host:application-port/nexus-context-path。 配置后的内容如下 ## DO NOT EDIT - CUSTOMIZATIONS BELONG IN $data-dir/etc/nexus.properties ## # Jetty section application-port8081 application-host127.0.0.1 nexus-args${jetty.etc}/jetty.xml,${jetty.etc}/jetty-http.xml,${jetty.etc}/jetty-requestlog.xml nexus-context-path/nexus/content # http://127.0.0.1:8081/nexus/content# Nexus section nexus-editionnexus-pro-edition nexus-features\ nexus-pro-featurenexus.hazelcast.discovery.isEnabledtrue配置好之后需要重启 nexus [/etc]$ nexus restart Shutting down nexus Stopped. Restarting nexus然后在浏览器地址栏输入http://localhost:8081/nexus/content/ Nexus 命令介绍 nexus start nexus stop nexus status nexus restart nexus run nexus run-redirect nexus force-reload 迁移 Nexus 服务器中的数据 将 sonatype-work/nexus3 迁移到其它地方 删除 Nexus 服务器中的数据 sonatype-work/nexus3 整个目录删除以前缓存的数据就全部删除了。 接着你可以重启 Nexus等几秒钟再输入之前的访问地址nexus3 目录又会自动重新生成之前的登录密码作废了你需要再重新打开 sonatype-work/nexus3/admin.password 文件将里面的密码粘贴到密码输入框即可完成登录。 升级 Nexus 下载最新版的 nexus 包解压后仅保留 nexus-3.{new-version} 目录并移动到 /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac 目录下然后重新创建软链接 nexus-latest指向新版本的 nexus 目录即可 $ cd /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac $ rm nexus-latest $ ln -s /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-3.{new-version} /Users/liaowenxiong/Applications/nexus-3.20.1-01-mac/nexus-latest以上升级方法适用于从 nexus-3.1.0 升级到 nexus3 的最新版本官方文档为《Upgrading Nexus Repository Manager 3.1.0 and Newer》 部署工件到服务器 通过配置文件发布工件到 Nexus 服务器第一种配置方式 第一步配置 settings.xml 在 settings.xml 配置 nexus 服务器的登录用户名和密码以及连接的仓库名称。 !--配置访问存储类型为release的仓库时需要的认证信息 -- server!-- id建议写仓库的名称要与pom.xml中repository节点的id子节点的内容保持一致 --idrelease/id!--Nexus的登录用户名--usernameadmin/username!--Nexus的登录密码--password123456/password /server!--配置访问存储类型为snapshot的仓库时需要的认证信息 -- serveridsnapshot/idusernameadmin/usernamepassword123456/password /server第二步在项目的 pom.xml 文件中配置仓库的名称和访问地址 直接在 project 根节点的 distributionManagement 子节点中配置如下 distributionManagement!--配置仓库类型为host(宿主仓库的储存类型为release的仓库--repository!-- id的名字可以任意取但是在settings.xml文件中的server元素的ID子元素的内容与这里一致 --idrelease/id!--部署即上传工件的仓库地址--urlhttp://localhost:8081/nexus/content/repository/maven-releases//url/repository!--配置仓库类型为host(宿主仓库的储存类型为Snapshot的仓库--snapshotRepository!-- id的名字可以任意取但是在settings.xml文件中的server元素的ID子元素的内容与这里一致 --idsnapshot/id!--部署即上传工件的仓库地址--urlhttp://localhost:8081/nexus/content/repository/maven-snapshots/url/snapshotRepository /distributionManagement问题代理仓库和组仓库能否部署工件呢没有测试过有时间再测试。 第三步将项目打成指定格式的包发布到仓库中 项目的 pom.xml 文件中可以指定项目的打包格式如下图所示 通过配置文件发布工件到 Nexus 服务器第二种配置方式 第一步在 settings.xml 文件中配置 settings...servers!-- account and password for deploy to nexus --serveridlan/idusernameadmin/usernamepasswordadmin123/password/server/serversprofilesprofileidlan/id!--定义属性即变量--propertieslan-release-urlhttp://localhost:8081/repository/maven-releases/lan-release-urllan-snapshot-urlhttp://localhost:8081/repository/maven-snapshots/lan-snapshot-url/properties/profile/profiles /settings第二步在 pom.xml 中配置部署即上传upload工件的目标仓库 projectprofiles!-- configuration for deploy to nexus repository --profile!-- 这个id值要和settings.xml中定义属性的profile的id值一致 --idlan/iddistributionManagement!-- 这是配置版本类型为发布版的仓库 --repository!-- 这个id值要和settings.xml中的server的id值一致 --idlan/idurl${lan-release-url}/url/repository!-- 这是配置版本类型为开发版的仓库 --snapshotRepository!-- 这个id值要和settings.xml中的server的id值一致 --idlan/idurl${lan-snapshot-url}/url/snapshotRepository/distributionManagementbuildpluginsplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-source-plugin/artifactId/pluginplugingroupIdorg.apache.maven.plugins/groupIdartifactIdmaven-javadoc-plugin/artifactId/plugin/plugins/build/profile/profiles /project第三步命令行执行 mvn clean deploy -P lan 即可将项目打包发布到 nexus 私服命令中的 lan 是 pom.xml 文件中的 profile 的 ID 值。 通过 Maven 命令发布工件到 Nexus 服务器 第一步配置 settings.xml 在 settings.xml 配置 nexus 服务器的登录用户名和密码以及连接的仓库名称。 serveridmaven-snapshots/idusernameadmin/usernamepassword123456/password /server第二步在 IDEA 的 Maven 命令输入框执行部署命令 将下面的命令语句填写到 Maven 输入框中 deploy:deploy-file -DgroupIdcom.example -DartifactIddemo02 -Dversion1.0-SNAPSHOT -Dpackagingjar -Dfile/Users/liaowenxiong/Documents/IdeaProjects/demo02/target/demo02-1.0-SNAPSHOT.war -Durlhttp://localhost:8081/nexus/content/repository/maven-snapshots/ -DrepositoryIdmaven-snapshots输入完命令语句按回车键会执行命令语句。执行完成后你再到 Nexus 服务器的管理后台查看是否发布成功如下图所示 选项说明 DgroupId 和 DartifactId 构成了该 jar 包在 pom.xml 的坐标项目就是依靠这两个属性定位。可以在项目的 pom.xml 文件中查看如下图所示 Dfile 表示需要上传的工件的绝对路径。 Durl 私服上仓库的位置可以在 Nexus 服务器的管理后台查看仓库的 URL如下图所示 DrepositoryId 就是服务器的名称。 Dversion 工件的版本信息。在项目的 pom.xml 中可以看到。 选择本地工件上传到 Nexus 宿主仓库 如果通过包名和jar文件名来确定工件的坐标 如上的 jar 文件按 Maven 工件的命名规则应该是 artifactIdversion解压 jar 文件看下图 所以上面的 c3p0-0.9.5.2.jar 的坐标是 groupIdcom.mchange.v2 artifactIdc3p0 version0.9.5.2从 Nexus 服务器自动下载依赖工件 无论是自己安装 Maven还是 IDEA 自带的 Maven 默认是没有配置仓库信息这种情况下 Maven 默认去远程的中心仓库下载所依赖的工件也叫构件。如果希望从自己搭建的私服下载依赖的工件就需要明确告诉 Maven 去哪里下载可以在三个地方进行配置分别是 1.Maven 的安装目录下的 conf 目录下的 settings.xml 文件这个全局配置 2.再一个是在 ~/.m2 目录下的 settings.xml如果不存在该文件可以复制 conf 目录下的 settings.xml这个是针对当前用户的 3.还有一个是在 pom.xml 中指定这个只对 pom.xml 所属的项目有效。 以上三个文件的优先级是 pom.xml ~/.m2/settings.xml conf/settings.xml。 配置好私服的仓库信息后当项目执行 Maven 操作时如果本地库中没有依赖的构件Maven 会去指定的私服仓库下载如果指定的私服仓库也没有私服仓库会去指定的远程仓库下载注私服仓库是 proxy 类型才会到指定的远程仓库下载下载的构件会缓存在私服仓库中这样当其它项目需要使用这些构件时私服仓库就可以直接提供下载了。 settings.xml 配置私服 如果在 settings.xml 中设置了其它的镜像仓库需要将其注释掉我们自己配置的私服仓库才会生效。 配置 profile 元素 在 profiles 标签体中添加下面的元素 profile!--id标签体的内容随意但是要确保唯一性--idnexus/idrepositoriesrepository!--id标签体的内容随意但是要确保唯一性--idnexus/id!--定义仓库的名称但是在这里仓库的名称可以随便命名不必与真实的仓库名称相同即name标签体的内容随意--namelocal private nexus/nameurlhttp://localhost:8081/nexus/content/repository/maven-public//urlreleasesenabledtrue/enabled/releasessnapshotsenabledfalse/enabled/snapshots/repositoryrepositoryidnexus-snapshots/idnamelocal private nexus/nameurlhttp://localhost:8081/nexus/content/repository/maven-snapshots//urlreleasesenabledfalse/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidnexus/idnamelocal private nexus/nameurlhttp://localhost:8081/nexus/content/repository/maven-public//urlreleasesenabledtrue/enabled/releasessnapshotsenabledfalse/enabled/snapshots/pluginRepositorypluginRepositoryidnexus-snapshots/idnamelocal private nexus/nameurlhttp://localhost:8081/nexus/content/repository/maven-snapshots//urlreleasesenabledfalse/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositories/profile 上述的元素 id、name 可以根据自己的喜好来定义保证 id 不重复即可主要是仓库的 url 的配置不要写错了仓库的 url 可以在 nexus 服务器管理后台的 repositories 列表直接复制如下图所示 仓库中主要存放两种类型的构件第一种构件被用作其它构件的依赖这是中央仓库中存储的大部分构件的类型另外一种构件类型是插件。如果不配置 pluginRepositories那么 Maven 在下载项目所需的依赖构件时还是会直接去远程中央仓库下载需要的插件构件所以这里一定要加上这个。 另外还要在 activeProfiles 标签体中添加下面的元素 activeProfilenexus/activeProfileactiveProfile 标签体中的内容就上面定义 profile 的 id。表示激活指定 id 的 profile。 配置 mirror 元素镜像仓库配置 还可以在 mirrors 标签体中添加 mirror 元素来配置私服。 !--自己搭建的Nexus服务器的仓库地址--mirror!-- id表示镜像的唯一标识随意填写但是要确保唯一性 --idprivate nexus/id!--这里填写被镜像的仓库的id如果你没有配置其它仓库只有默认的中央仓库而默认中央仓的id是central所以你可以填写central--mirrorOfcentral/mirrorOf!-- 定义镜像名称具体名称随意 --nameprivate proxy nexus repository/name!--私服仓库的地址--urlhttp://localhost:8081/nexus/content/repository/maven-aliyun//url/mirror关于 mirror 元素的配置另请参见https://maven.apache.org/guides/mini/guide-mirror-settings.html pom.xml 配置私服 repositoriesrepository!--id根据自己的需要命名--idnexus/id!--name根据自己的需要命名--namelocal private nexus/nameurlhttp://192.168.1.68:8081/nexus/content/groups/public/urlreleasesenabledtrue/enabled/releasessnapshotsenabledfalse/enabled/snapshots/repositoryrepositoryidnexus-snapshots/idnamelocal private nexus/nameurlhttp://192.168.1.68:8081/nexus/content/groups/public-snapshots/urlreleasesenabledfalse/enabled/releasessnapshotsenabledtrue/enabled/snapshots/repository/repositoriespluginRepositoriespluginRepositoryidnexus/idnamelocal private nexus/nameurlhttp://192.168.1.68:8081/nexus/content/groups/public/urlreleasesenabledtrue/enabled/releasessnapshotsenabledfalse/enabled/snapshots/pluginRepositorypluginRepositoryidnexus-snapshots/idnamelocal private nexus/nameurlhttp://192.168.1.68:8081/nexus/content/groups/public-snapshots/urlreleasesenabledfalse/enabled/releasessnapshotsenabledtrue/enabled/snapshots/pluginRepository/pluginRepositoriespom.xml 文件中简单配置如下 !--配置私服--repositoriesrepository!--id标签体的内容随意只要确保唯一即可--idmaven-aliyun/id!--name标签体的内容随意--namelocal private nexus/name!--私服仓库的地址--urlhttp://localhost:8081/nexus/content/repository/maven-aliyun//url/repository/repositoriesNexus 3 和 Nexus 2 的区别 Nexus 2 能够下载远程仓库资源的索引到 Nexus 服务器本地供搜索查询使用但是 Nexus 3 暂时还不支持。在 Nexus 3 中查询的都是已经从远程仓库下载并缓存到服务器本地的资源对于远程仓库中没有缓存到 Nexus 本地的资源是无法查询到的。所以在 Nexus 3 搭建好后若没有被访问过那么在 Nexus 的代理仓库是查询不到任何资源的。对于代理仓库而言需要程序先访问 Nexus 代理仓库然后由仓库向被代理的远程仓库发起请求下载对应的资源并缓存到代理仓库中然后各个项目客户端再从 Nexus 代理仓请求下载依赖的资源。 所以对于 Nexus 代理仓中没有的资源必须项目客户端先发起请求然后 Nexus 仓库才会去代理的远程中央仓库下载资源缓存到代理仓库中以供其它用户直接下载使用。
http://www.zqtcl.cn/news/471465/

相关文章:

  • 商务网站建设哪家好绍兴网站建设做网站
  • 网站域名管理东莞网页设计和网页制作
  • 网站建设与制作报价网站app制作
  • 下载可以做动漫的我的世界视频网站长沙网站seo技巧
  • 汕头网站制作推荐制作影视视频的软件
  • 定制程序网站宁波英文网站建设
  • 安康公司做网站网页设计怎么设计
  • 小型企业网站系统南京seo外包平台
  • 曲靖网站制作邢台网站制作那家便宜
  • wordpress中portfolio重庆网站seo按天计费
  • 做淘客网站需要多大的空间工程公司名称大全简单大气
  • 康县建设局网站网站做优化
  • 笔记网站开发代码下载了wordpress后
  • 北京招聘高级网站开发工程师域名最新通知
  • 企业如何实现高端网站建设西安百度推广开户
  • 广西城乡住房建设厅网站首页本地 安装 WordPress主题
  • 网站开发 技术方案设计一个软件需要多少钱
  • 网站如何做死链接提交建设银行网站官网网址
  • 网站难做吗承德平台
  • 手机备案网站营销网络建设怎么写
  • 建个网站要花多少钱WordPress密码重设怎么改
  • 招商网站建设免费网站改版 升级的目的
  • 安徽圣力建设集团网站如何自己开发微信小程序
  • 学院网站板块盘多多搜索引擎入口
  • 网站seo内部优化wordpress建站网站报错
  • 网站建设科技国外网站入口
  • 怎样用网站做淘宝推广免费的项目管理软件
  • 共青城网站建设微网站开发报价
  • 网站建设选超速云建站网站建设公司比较
  • 芜湖网络科技有限公司沈阳网站推广优化公司哪家好