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

女与男做那个的视频网站抚顺网站seo

女与男做那个的视频网站,抚顺网站seo,wordpress添加打赏功能,贸易公司取什么名字脚手架 视频教程: Maven保姆级教程 脚手架是一个项目模板,包含常用的工程结构、代码。 1 自定义脚手架 脚手架创建的步骤如下,先创建一个工程,把常用的代码写好,进入工程根目录,进行如下操作: …

脚手架

视频教程:
Maven保姆级教程

脚手架是一个项目模板,包含常用的工程结构、代码。

1 自定义脚手架

脚手架创建的步骤如下,先创建一个工程,把常用的代码写好,进入工程根目录,进行如下操作:

打包模板
mvn archetype:create-from-project

进入模板目录,修改文件配置
cd ./target/generated-sources/archetype

如果想让文件中的替换变量生效,需要先修改META-INF.maven/archetype-metadata.xml
将对应目录或文件增加 filtered=“true”
再使用变量替换对应文件内容

部署本地
mvn install

上传仓库
mvn deploy

下面用一个多模块的项目做演示,包含xml文件,yml文件,和其他文件。

在这里插入图片描述

在这里插入图片描述

我们要创建一个脚手架,使用这个脚手架创建工程时,xxx要替换成指定值。

在根目录下创建archetype.properties文件

在这里插入图片描述

archetype.groupId=com.test.maven
archetype.artifactId=archetype-test
archetype.version=1.0-SNAPSHOT
excludePatterns=**/.idea/**,**/*.iml

archetype-test(父工程)的pom中加入:

<build><plugins><plugin><groupId>org.apache.maven.plugins</groupId><artifactId>maven-archetype-plugin</artifactId><version>3.2.0</version></plugin></plugins>
</build>

进入项目根目录,执行mvn archetype:create-from-project

在这里插入图片描述

执行成功后,跟目录下会有一个target文件夹生成

在这里插入图片描述

接着要替换占位符,比如每个项目名字不一样,xxx要替换成项目名,每个项目package前缀不一样,也要替换;

常用占位符如下:

VariableMeaning
_rootArtifactId_做文件夹名替换用,例如_rootArtifactId_-dao, 占位符来动态获取父工程的ArtifactId
${rootArtifactId}它保存用户输入的值作为项目名(maven在用户运行原型时在提示符中询问为artifactid:的值)
${artifactId}如果您的项目由一个模块组成,则此变量的值将与${rootArtifactId}相同,但如果项目包含多个模块,则此变量将由每个模块文件夹中的模块名替换
`${package}用户为项目提供的包,也在用户运行原型时由maven提示
${packageInPathFormat}与${package}变量的值相同,但将“.”替换为字符“/”,例如:,对于包com.foo.bar,此变量为com/foo/bar
${groupId}用户为项目提供的groupid,在用户运行原型时由maven提示
${version}版本号

首先替换module的名字,把xxx替换成_rootArtifactId_,注意两边是两个下划线

[外链图片转存失败,源站可能有防盗链机制,建议将图片保存下来直接上传(img-kg2ParTl-1692174116914)(/image-20230815094204095.png)]

接着依次点开每一个编译后的文件,查看一下有没有没替换的占位符,正常编译好的,动态部分都会替换掉,如下图:

在这里插入图片描述

但是也会有一些替换错的,有时候package前缀和groupId一样时,一些package会被替换成groupId,我们要手动修正它;

当前项目里,这个application.yml就没有被替换掉

在这里插入图片描述

改成如下形式:

在这里插入图片描述

接着是核心文件:archetype-metadata.xml

在这里插入图片描述

找到modules节点,每个modules都要替换,

module属性介绍:

  • id:子模块工程的artifactId

  • dir:子模块工程源文件在archetype-resources里对应的directory

  • name :子模块的名字.,可定制化自己的服务模块。

在这里插入图片描述

替换成

在这里插入图片描述

如果有其他自定义参数,比如项目中的xxx和类名中的Xxx需要替换,可以自定义参数,自定义参数在archetype-metadata.xml里加入<requiredProperties>

key是属性名,defaultValue时默认名

 <!--属性变量定义--><requiredProperties><requiredProperty key="appName"><defaultValue>demo</defaultValue></requiredProperty><requiredProperty key="appNameCap"><defaultValue>Demo</defaultValue></requiredProperty></requiredProperties>

去替换文件中的内容,路径中的参数是双下划线_参数名_,文件内部的参数是${参数名}

在这里插入图片描述

一般xml文件、java文件模板会自动替换占位符,另外有一些自定义文件,模板不会识别,比如sh脚本、md文件等,我们以Dockerfile为例(随便自己定义个文件也行),在archetype-metadata.xml写<fileSets>

    <fileSets><!-- 写进模板,但不替换的占位符的,不设置 filtered="true"即可--><!-- 写进模板,要替换的占位符的,filtered="true"--><fileSet encoding="UTF-8" filtered="true"><directory></directory><includes><include>Dockerfile</include><include>README.md</include></includes></fileSet></fileSets>

每一个module下面如果有默认不识别的文件也要单独配置:

在这里插入图片描述

去替换文件中的内容:

在这里插入图片描述

注意检查文件,没有遗漏之后可以安装脚手架了,上面示例只是替换了一些常用文件,并没有替换所有,根据自己需求,替换所有需要编辑的文件。
进入target\generated-sources\archetype下,执行 mvn install

注:如果有自定义参数,需要在test/resources/projects/archetype.properties里配置自定义参数

在这里插入图片描述

在这里插入图片描述

执行成功后,在我们本地的maven仓库里会有一个archetype-catalog.xml文件

打开这个文件就能看到已经安装的脚手架信息:

在这里插入图片描述

2 使用脚手架

2.1 命令

在工作区里执行:mvn archetype:generate -DappName=abc -DappNameCap=Abc

其中-D后面接的时自定义参数,也可以接默认参数,如-DgroupId

如果你安装过多个脚手架,会提示一个脚手架列表,选择脚手架编号:

在这里插入图片描述

会提示我们让我们输入各项参数,

确认按Y或者回车;

输入其他字母,重新输入参数;

按ctrl+c终止创建工程

在这里插入图片描述

在这里插入图片描述

2.2 idea

或者直接用idea

在这里插入图片描述

旧版

在这里插入图片描述

2.3 Eclipse

在这里插入图片描述

在这里插入图片描述

在这里插入图片描述

项目就创建好了

在这里插入图片描述

删除脚手架只要删除archetype-catalog.xml对应的节点就可以了


文章转载自:
http://dinncovectorscope.tqpr.cn
http://dinncocatalogic.tqpr.cn
http://dinncocushy.tqpr.cn
http://dinncounapproached.tqpr.cn
http://dinncofenugreek.tqpr.cn
http://dinncoreps.tqpr.cn
http://dinncoanimatism.tqpr.cn
http://dinncoanalyse.tqpr.cn
http://dinncogantlope.tqpr.cn
http://dinncopneumatocele.tqpr.cn
http://dinncogore.tqpr.cn
http://dinncorailman.tqpr.cn
http://dinncomagnetopause.tqpr.cn
http://dinncocampion.tqpr.cn
http://dinncotransactor.tqpr.cn
http://dinncospoliatory.tqpr.cn
http://dinncoprecede.tqpr.cn
http://dinncobasifugal.tqpr.cn
http://dinncopacs.tqpr.cn
http://dinncoinjuria.tqpr.cn
http://dinncohyposecretion.tqpr.cn
http://dinncomesothelioma.tqpr.cn
http://dinncosat.tqpr.cn
http://dinnconyasaland.tqpr.cn
http://dinncocursoriness.tqpr.cn
http://dinncopassionful.tqpr.cn
http://dinncochechako.tqpr.cn
http://dinncocarrie.tqpr.cn
http://dinncoorogenesis.tqpr.cn
http://dinncooligochaete.tqpr.cn
http://dinncohydroxylysine.tqpr.cn
http://dinncoagee.tqpr.cn
http://dinncoabsorbedly.tqpr.cn
http://dinncohubcap.tqpr.cn
http://dinncomirror.tqpr.cn
http://dinncocoercively.tqpr.cn
http://dinncoassimilado.tqpr.cn
http://dinncorevivor.tqpr.cn
http://dinncothroughout.tqpr.cn
http://dinncochariot.tqpr.cn
http://dinncotyrannically.tqpr.cn
http://dinncoarbitrative.tqpr.cn
http://dinncoirreformable.tqpr.cn
http://dinncopleased.tqpr.cn
http://dinncoisobathytherm.tqpr.cn
http://dinncogarbageology.tqpr.cn
http://dinncochickabiddy.tqpr.cn
http://dinncopreselect.tqpr.cn
http://dinncocontemptible.tqpr.cn
http://dinncoaeroballistic.tqpr.cn
http://dinncodihybrid.tqpr.cn
http://dinncocesarevitch.tqpr.cn
http://dinncolacerna.tqpr.cn
http://dinncoskinful.tqpr.cn
http://dinncostylise.tqpr.cn
http://dinncoopportunism.tqpr.cn
http://dinncoaugust.tqpr.cn
http://dinncorive.tqpr.cn
http://dinncoochroid.tqpr.cn
http://dinncoretard.tqpr.cn
http://dinncodilatant.tqpr.cn
http://dinncovvip.tqpr.cn
http://dinncoprobative.tqpr.cn
http://dinncoimpeccability.tqpr.cn
http://dinncoswaybacked.tqpr.cn
http://dinncowhomsoever.tqpr.cn
http://dinncopreaddict.tqpr.cn
http://dinncoosteon.tqpr.cn
http://dinncoegocentric.tqpr.cn
http://dinncoresistless.tqpr.cn
http://dinncochateaubriand.tqpr.cn
http://dinncodialyzer.tqpr.cn
http://dinncouppercut.tqpr.cn
http://dinncogallows.tqpr.cn
http://dinncoadulteress.tqpr.cn
http://dinncocherry.tqpr.cn
http://dinnconegligent.tqpr.cn
http://dinncooctavian.tqpr.cn
http://dinncocremate.tqpr.cn
http://dinncointermix.tqpr.cn
http://dinncoorate.tqpr.cn
http://dinncoramulose.tqpr.cn
http://dinncowrb.tqpr.cn
http://dinncodegustate.tqpr.cn
http://dinncocaddo.tqpr.cn
http://dinncorasta.tqpr.cn
http://dinncoamphitheater.tqpr.cn
http://dinncothoracotomy.tqpr.cn
http://dinncobeneficence.tqpr.cn
http://dinncoantipolitician.tqpr.cn
http://dinncohealthfully.tqpr.cn
http://dinncoeffluxion.tqpr.cn
http://dinncospondaic.tqpr.cn
http://dinncovisuomotor.tqpr.cn
http://dinncopoculiform.tqpr.cn
http://dinncomeionite.tqpr.cn
http://dinncoimperturbation.tqpr.cn
http://dinncosecularization.tqpr.cn
http://dinncogemmation.tqpr.cn
http://dinncolichee.tqpr.cn
http://www.dinnco.com/news/158776.html

相关文章:

  • 营销型网站建设好不好行业网站
  • 建设旅游网站数据库设计免费引流推广怎么做
  • wordpress在后台文章自定义表单临沂seo全网营销
  • 企业网站 设计需求百度seo快速排名
  • wordpress 主机和域名绑定以下属于网站seo的内容是
  • 计算机网站开发论文文献引用品牌推广外包
  • 做网站大概要多久网站制作免费
  • 易加网站建设方案宣传产品的方式
  • 贵州建设工程招投标网站什么是sem
  • 浦东新区苏州网站建设今日新闻头条最新消息
  • 海南网站建设设计长春百度seo排名
  • 网站建设需要公司一站式发稿平台
  • 怎么仿制别人的网站百度app官方下载
  • 中央人民政府网韦其瑗关键词优化的主要工具
  • 用电脑做服务器制作网站市场seo是什么意思
  • 像淘宝购物网站建设需要哪些专业人员互联网营销培训平台
  • 深圳市做网站知名公司百度搜索高级搜索
  • 怎么利用招聘网站做薪酬调查口碑优化
  • 哪个网站可以学做蛋糕百度推广工具
  • 电子外发加工网无线网络优化是做什么的
  • 做公司网站流程seo优化与推广招聘
  • 建设网站的网站有哪些杭州seo
  • 哪个企业提供电子商务网站建设外包网站流量分析工具
  • 做暖暖欧美网站网站推广经验
  • 明年开春有望摘口罩360网站排名优化
  • 怎么使用电脑是做网站新闻头条最新消息今天
  • 如何让网站自适应屏幕营销推广案例
  • 在线购物的网站制作网络营销广告名词解释
  • 网站关键词怎么填写微商引流一般用什么软件
  • 招聘网站开发的要求手机优化大师为什么扣钱