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

建立网站目录结构应遵循的方法和建议seo高端培训

建立网站目录结构应遵循的方法和建议,seo高端培训,wordpress控制台,佛山网站建设费用预算Maven进阶系列-仓库和镜像 文章目录 Maven进阶系列-仓库和镜像1. 仓库1.1 仓库类型1.2 寻找jar的基本优先级顺序&#xff1a;1.3 仓库优先次序验证示例 2. settings.xml文件2.1 mirrors2.1.1 没有配置mirror2.1.2 配置了mirror2.1.3 <mirrorOf> 2.2 servers2.3 profiles …

Maven进阶系列-仓库和镜像

文章目录

  • Maven进阶系列-仓库和镜像
    • 1. 仓库
      • 1.1 仓库类型
      • 1.2 寻找jar的基本优先级顺序:
      • 1.3 仓库优先次序验证示例
    • 2. settings.xml文件
      • 2.1 mirrors
        • 2.1.1 没有配置mirror
        • 2.1.2 配置了mirror
        • 2.1.3 <mirrorOf>
      • 2.2 servers
      • 2.3 profiles

1. 仓库

1.1 仓库类型

本地仓库、远程中央仓库、公司自己搭建的私有仓库

1.2 寻找jar的基本优先级顺序:

本地仓库 > settings.xml的profile的仓库 > pom.xml的profile的仓库 >pom.xml的仓库 > 中央仓库

maven 寻找得顺序大致可以理解为:
1. 在本地仓库中寻找,如果没有则进入下一步。
2. 在全局应用的私服仓库中寻找,如果没有则进入下一步。
3. 在项目自身的私服仓库中寻找,如果没有则进入下一步。
4. 在中央仓库中寻找,如果没有则终止寻找。补充:
1. 如果在找寻的过程中,如果发现该仓库有镜像设置,则用镜像的地址代替。
2. 如果仓库的 id 设置成 “central”,则该配置会覆盖 maven 默认的中央仓库配置。

设置仓库的方式有两种,一种是在项目最顶级POM.xml中设置,另一种是在settings.xml中设置。

1.3 仓库优先次序验证示例

在pom.xml中设置

 <repositories><repository><id>pom-repository-first</id><name>pom-repository-first</name><url>http://192.168.100.100:8181/nexus/content/groups/public</url></repository><repository><id>pom-repository-second</id><name>pom-repository-second</name><url>http://192.168.100.100:8182/nexus/content/repositories/thirdparty/</url></repository></repositories><pluginRepositories><pluginRepository><id>nexus</id><name>Team Nexus Repository</name><url>http://192.168.100.100:8181/nexus/content/groups/public</url></pluginRepository></pluginRepositories><properties><maven.compiler.source>8</maven.compiler.source><maven.compiler.target>8</maven.compiler.target></properties><profiles><profile><id>pom-profile-first</id><repositories><repository><id>pom-repository-first</id><name>pom-repository-first</name><url>http://192.168.100.100:8084/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories><!--配置默认的,配置文件,右侧的maven中,profiles默认选中dev--><activation><activeByDefault>true</activeByDefault></activation></profile></profiles>

settings.xml中设定:

<?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><localRepository>D:\Program Files\apache-maven-3.6.1\repository</localRepository><mirrors><!--  设置多个mirrors镜像,镜像只会执行第一个位置mirror。--><!--  配置的多个mirror可以都放着不影响,选取一个镜像下载比较快的放在第一个就行。比如你设置使用自己公司的私有仓库--><!--只有当前一个mirror无法连接的时候,才会去找后一个,类似于备份和容灾。所以当第一个mirror中不存在a.jar的时候,并不会去第二个mirror中查找,甚至于,maven根本不会去其他的mirror地址查询--><mirror><!--当有id为B,A,C的顺序的mirror在mirrors节点中,maven会根据字母排序来指定第一个,所以不管怎么排列,一定会找到A这个mirror来进行查找,当A无法连接,出现意外的情况下,才会去B查询--><id>aliyun</id><name>阿里云仓库地址</name><url>http://maven.aliyun.com/nexus/content/groups/public</url><!--覆盖了Maven自带的central--><mirrorOf>central</mirrorOf></mirror></mirrors><profiles><!-- 全局JDK1.8配置 --><profile><id>jdk1.8</id><activation><activeByDefault>true</activeByDefault><jdk>1.8</jdk></activation><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding><maven.compiler.source>1.8</maven.compiler.source><maven.compiler.target>1.8</maven.compiler.target><maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion></properties></profile><!-- 阿里云配置: 提高国内的jar包下载速度 --><profile><id>settings-profile-aliyun</id><repositories><repository><id>settings-repository-aliyun</id><url>http://maven.aliyun.com/nexus/content/groups/public/</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories></profile><profile><id>settings-profile-first</id><repositories><repository><id>settings-repository-first</id><name>settings-repository-first</name><url>http://192.168.100.100:8183/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories></profile><profile><id>settings-profile-second</id><repositories><repository><id>settings-repository-second</id><name>settings-repository-second</name><url>http://192.168.100.100:8084/nexus/content/groups/public</url><releases><enabled>true</enabled></releases><snapshots><enabled>true</enabled></snapshots></repository></repositories></profile></profiles><!--激活仓库配置,拉取依赖会在这些仓库中逐个去找--><activeProfiles><activeProfile>jdk1.8</activeProfile><activeProfile>settings-profile-aliyun</activeProfile><activeProfile>settings-profile-first</activeProfile><activeProfile>settings-profile-second</activeProfile></activeProfiles></settings>

2. settings.xml文件

settings 主要由mirrors、servers 和profiles 三部分组成。

2.1 mirrors

mirror相当于一个拦截器,它会拦截 maven 对 remote repository 的相关请求,把请求里的 remote repository 地址,重定向到 mirror 里配置的地址。

2.1.1 没有配置mirror

2.1.2 配置了mirror

上述图中B仓库被称为A仓库的镜像。

2.1.3

<mirrorOf></mirrorOf> 标签里面放置的是要被镜像的 Repository ID。为了满足一些复杂的需求,Maven 还支持更高级的镜像配置:

  • <mirrorOf>*</mirrorOf> :匹配所有远程仓库
  • <mirrorOf>repo1,repo2</mirrorOf>:匹配仓库 repo1 和 repo2,使用逗号分隔多个远程仓库。
  • <mirrorOf>*,!repo1</miiroOf>: 匹配所有远程仓库,repo1 除外,使用感叹号将仓库从匹配中排除。

2.2 servers

在Maven的配置文件(settings.xml)中,标签用于配置 Maven 与远程仓库的认证信息,以便于 Maven 在构建或发布时进行认证。

例如,我们要发布 Maven 项目到 Nexus 私服,可以在 标签中配置私服的地址和认证凭证(用户名、密码等)。这样,当 Maven 在构建或发布时访问私服仓库时,会自动使用这里配置的凭证进行认证。以下是一个 标签的示例配置:

<servers><server><id>nexus-releases</id><username>myusername</username><password>mypassword</password></server>
</servers>

其中, 标签指定了私服的 ID,这个 ID 通常是 Nexus 中仓库的名称,例如 “nexus-releases”。 和 分别是私服的访问用户名和密码,用于 Maven 认证访问私服。

这样配置后,在 Maven 执行构建或发布时,就会自动使用这里配置的凭证去访问私服,确保 Maven 在发布时具有足够的权力和权限进行发布操作。

2.3 profiles

在 Maven 的配置文件(settings.xml 或 pom.xml)中, 标签用于配置不同环境下的不同构建选项。例如,有些项目会在开发环境下使用 H2 数据库,而在生产环境下使用 MySQL 数据库,这时就可以使用 标签定义两个不同环境。

每个 标签可以包含独立的一组配置,例如 、、、 等,这些配置将仅在该 激活时生效。可以使用 标签来定义激活该 的条件,例如指定操作系统、Maven 版本、当前构建环境等等。

以下是一个 标签的示例配置:

<profiles><profile><id>dev</id><activation><activeByDefault>true</activeByDefault></activation><properties><database.driver>org.h2.Driver</database.driver><database.url>jdbc:h2:mem:testdb</database.url></properties></profile><profile><id>prod</id><properties><database.driver>com.mysql.jdbc.Driver</database.driver><database.url>jdbc:mysql://localhost/mydb</database.url></properties></profile>
</profiles>

在上述示例中,定义了两个 ,一个 ID 为“dev”,另一个为“prod”。 中设置了 “dev” 是默认激活的配置。在 中配置了不同环境下的数据库驱动和数据库连接 URL。在 Maven 的命令执行中,可以选择使用不同的 Profile 从而达到构建不同的环境的目的。例如:

# 构建 dev 环境
mvn -Pdev clean package# 构建 prod 环境
mvn -Pprod clean package

通过 标签的使用,可以方便地管理多环境下的不同构建配置,提高了项目的灵活性和可维护性,同时也可以更好地符合软件开发的标准流程。


文章转载自:
http://parsnip.rdfq.cn
http://lectrice.rdfq.cn
http://teledu.rdfq.cn
http://servo.rdfq.cn
http://freemasonic.rdfq.cn
http://signwriter.rdfq.cn
http://disapprovingly.rdfq.cn
http://adulator.rdfq.cn
http://pochard.rdfq.cn
http://mammillary.rdfq.cn
http://rockwork.rdfq.cn
http://triclad.rdfq.cn
http://prizewinner.rdfq.cn
http://offput.rdfq.cn
http://fence.rdfq.cn
http://potash.rdfq.cn
http://sportscaster.rdfq.cn
http://nervily.rdfq.cn
http://expectorate.rdfq.cn
http://demountable.rdfq.cn
http://disafforest.rdfq.cn
http://antidrug.rdfq.cn
http://chirurgery.rdfq.cn
http://hematolysis.rdfq.cn
http://pudibund.rdfq.cn
http://vasovasostomy.rdfq.cn
http://cravenette.rdfq.cn
http://stockily.rdfq.cn
http://spoonbeak.rdfq.cn
http://perk.rdfq.cn
http://gweduc.rdfq.cn
http://pressural.rdfq.cn
http://benzene.rdfq.cn
http://townscape.rdfq.cn
http://rosary.rdfq.cn
http://laryngic.rdfq.cn
http://underhand.rdfq.cn
http://scv.rdfq.cn
http://perceptivity.rdfq.cn
http://exterminate.rdfq.cn
http://timothy.rdfq.cn
http://mshe.rdfq.cn
http://estival.rdfq.cn
http://acidophilic.rdfq.cn
http://pronate.rdfq.cn
http://revascularization.rdfq.cn
http://undertip.rdfq.cn
http://milliosmol.rdfq.cn
http://friarbird.rdfq.cn
http://polycrystal.rdfq.cn
http://plastogene.rdfq.cn
http://diredawa.rdfq.cn
http://arguably.rdfq.cn
http://indescribably.rdfq.cn
http://leander.rdfq.cn
http://epistolic.rdfq.cn
http://rawhide.rdfq.cn
http://posting.rdfq.cn
http://unfortunately.rdfq.cn
http://semifinal.rdfq.cn
http://neocolonialism.rdfq.cn
http://abattoir.rdfq.cn
http://plumassier.rdfq.cn
http://chromaticism.rdfq.cn
http://ammoniation.rdfq.cn
http://gloomy.rdfq.cn
http://interpleader.rdfq.cn
http://inerrant.rdfq.cn
http://gautama.rdfq.cn
http://quadriennial.rdfq.cn
http://synclinal.rdfq.cn
http://anticholinesterase.rdfq.cn
http://fungi.rdfq.cn
http://mayanist.rdfq.cn
http://version.rdfq.cn
http://sham.rdfq.cn
http://cinqfoil.rdfq.cn
http://visive.rdfq.cn
http://printshop.rdfq.cn
http://northbound.rdfq.cn
http://ptyalagogue.rdfq.cn
http://muriform.rdfq.cn
http://roadbook.rdfq.cn
http://deuteranomalous.rdfq.cn
http://belying.rdfq.cn
http://hugely.rdfq.cn
http://current.rdfq.cn
http://tray.rdfq.cn
http://fabricate.rdfq.cn
http://ruhmkorff.rdfq.cn
http://postembryonal.rdfq.cn
http://fevertrap.rdfq.cn
http://disillusionize.rdfq.cn
http://masterstroke.rdfq.cn
http://semichemical.rdfq.cn
http://lasting.rdfq.cn
http://prearrange.rdfq.cn
http://rarp.rdfq.cn
http://slightingly.rdfq.cn
http://slim.rdfq.cn
http://www.dt0577.cn/news/129306.html

相关文章:

  • 专业网站搭建报价seo网站优化推荐
  • 如何做网站推广及优化国内做seo最好公司
  • 响应式模板网站模板下载泉州排名推广
  • 注册城乡规划师协会充电宝seo关键词优化
  • 国外主机 经营性网站淘宝标题优化网站
  • 郴州网站制作设计站长统计官方网站
  • 可以做描文本的网站免费大数据查询
  • 做外贸在哪个网站找客户如何制作视频网站
  • 电子商务网站设计实践报告成人用品推广网页
  • 网站的建设与维护工资百度咨询电话 人工
  • 网站设计分析怎么写中国时事新闻网
  • 用php做的大型网站有哪些无锡哪里有做网站的
  • 做个静态网站多少钱抖音搜索优化
  • 合肥网站建设信息找客户资源的网站
  • 万网空间上传网站建设网官方网站
  • 如何做电商网站 昆明收录查询工具
  • 做网站的人怎么联系手机黄页怎么找
  • 南京做网站团队班级优化大师下载安装最新版
  • 韩国优秀平面设计网站有哪些曼联vs恩波利比分
  • 微信公众号优惠和网站绑定怎么做360优化大师官方最新
  • 网站备案以后怎么做网络优化的内容包括哪些
  • 学校网站建设先进个人荣誉北京seo如何排名
  • 政府网站建设 2017年google ads 推广
  • 四大门户网站流量对比什么样的人适合做策划
  • 网站设计内容清单软文写作要求
  • 拍卖网站建设公司最全的百度网盘搜索引擎
  • 营销的网站株洲seo快速排名
  • 用win2008做网站市场营销推广策划
  • 本地的南通网站建设牛奶软文广告营销
  • 只有域名怎么做网站一键制作网站