Maven Archetype
1. 从project创建archetype
在项目根目录下,运行
mvn archetype:create-from-project
创建的archetype工程在app_folder/target/generated-sources/archetype 目录下,其中archetype-resources包含用来创建原型项目的文件,META-INF/maven/archetype-metadata.xml
是用来对文件结构进行详细描述的源文件。
2. Archetype的一些built-in参数
| Variable | Meaning |
|---|---|
| __rootArtifactId__ | 做文件夹名替换用,例如__rootArtifactId__-dal |
| ${rootArtifactId} |
Already explained above, it holds the value entered by the user as the project name (the value that maven ask as the artifactId: inthe prompt when the user runs the archetype) |
${artifactId} |
If your project is composed by one module, this variable will have the same value as ${rootArtifactId}, but if the project containsseveral modules, this variable will be replaced by the module name inside every module folder, for example: given a module named portlet-domain inside a project namedportlet,all the files inside this module folder that are to be filtered will have the value of the variable ${artifactId} replaced by portlet-domainwhereasthe ${rootArtifactId} variable will be replaced by portlet |
${package} |
The user provided package for the project, also prompted by maven when the user runs the archetype |
${packageInPathFormat} |
The same value as ${package} variable but replacing '.' with the character'/',e.g:, for the package com.foo.bar this variable is com/foo/bar |
${groupId} |
The user supplied groupId for the project, prompted by maven when the user runs the archetype |
${version} |
The user supplied version for the project, prompted by maven when the user runs the archetype |
folder after the project is created, is where you need to tweak what you want generated and how.
- id – This is the name of the module that will be generated.
- dir – the template dir
- name – the artifact Id that will be put in the pom file.
版权声明:本文为博主原创文章,未经博主允许不得转载。
Maven Archetype的更多相关文章
- maven archetype二三事
maven plugin 创建maven archetype 骨架的plugin是 <plugin> <groupId>org.apache.maven.plugins< ...
- maven archetype生成自定义项目原型(模板)
maven archetype可以将一个项目做成项目原型,之后只需要以此原型来创建项目,那么初始创建的项目便具有原型项目中的一切配置和代码.通俗讲就是一个项目模板. eclipse中那些快速生成mav ...
- Maven-003-私人定制 maven archetype
在使用 Maven 创建项目模块的时候,依据其默认的 archetype 模板,创建出的目录.及默认的单元测试工具为 JUnit 3.8.1,而且有些常用的资源文件目录.配置文件(例如:Log4J 的 ...
- 自定义Maven Archetype模板
1. 目的 自定义Maven Archetype模板目的为了把自己辛苦搭建的基础项目可以作为模板, 方便以后可以快速的创建类似项目,免去每次搭建的麻烦 2.把基础项目打包生成archetype项目 在 ...
- Maven Archetype简介以及搭建
为什么会写这篇文章,因为公司先在构建项目骨架都是用的 maven archetype ,身为一个上进的渣渣猿,自己还是有必要了解下这个东西的. Archetype介绍 Archetype 是一个 Ma ...
- 创建并使用maven archetype的随笔
maven骨架archetype的意义在于一些项目的基础项:如引入的maven组件,例如eureka,ribben等,不希望每次新建项目都重复做一遍,还有例如公司规范的log格式,单元测试工具等,在新 ...
- Jersey 2.x 从Maven Archetype 创建一个新项目
创建 Jersey 工程需要使用 Apache 的 Maven 软件工程和管理工具.所有的Jersey产品模块都可以在 Maven中央库 中找到.这样的话 Jersey 可以非常容易和其他基于 Mav ...
- Jersey入门一:从Maven Archetype创建jersey项目
1.用Ctrl+空格调出Spotlight搜索,输入ter调出终端窗口  2.在终端窗口进入将创建jersey项目的目录:  3.输入如下命令,创建一个名为的simple-service项目: m ...
- 使用Maven Archetype创建Java项目模板
1.over view 简而言之,Archetype是一个Maven项目模板工具包.原型被定义为一种原始的模式或模型,所有其他同类的东西都是从中产生的.当我们试图提供一个提供生成Maven项目的一致方 ...
- 老大说新项目的结构和 xxx 项目一样就可以了,我 ……(使用 Maven Archetype 快速创建项目)
前言 又要开发新项目了,还是创建新项目,怎么办?老大说按照 xxx 项目的结构创建一个新项目就可以了. 公众号:liuzhihangs,记录工作学习中的技术.开发及源码笔记:时不时分享一些生活中的见闻 ...
随机推荐
- hadoop 完全分布式 下 datanode无法启动解决方法
问题描述: 在集群模式下更改节点后,启动集群发现 datanode一直启动不起来. 我集群配置:有5个节点,分别为master slave1-5 . 在master以Hadoop用户执行:start- ...
- Solaris 自动挂载
修改文件:vim /etc/vfstab添加命令:/dev/dsk/c2t0d0p0:1 - /media/PARTITION1 pcfs ...
- 修改Oracle字符集为 ZHS16GBK
SQL*Plus: Release 11.2.0.1.0 Production on Wed Aug 10 13:12:48 2016 Copyright (c) 1982, 2009, Oracle ...
- w3svc服务启动 不了,错误 1068:依赖服务或组件无法启动
win10系统,装了iis就是启动不了,报错误 1068:依赖服务或组件无法启动. 各种实验无法使用,最后如下方法解决 运行命令regedit,打开注册表编辑器,进入:HKEY_LOCAL_MACHI ...
- oracle免客户端安装 plsql连接
开发的过程中,往往没有必要在自己的电脑上安装oracle,也实在太大了. 这里介绍一种使用plsql连接oracle的方法,类似于navicat之连接mysql. 先下载plsql,进行安装,这里提供 ...
- oracle查询中文数据出现乱码
首先,在oracle中,输入select userenv('language') from dual,查询出oracle使用的编码方式,我的是SIMPLIFIED CHINESE_CHINA.ZHS1 ...
- WIN7-修改域名
前言:访问本地项目有如下的几种方式,其中通过修改域名配置文件的方式使用的较少,不过在某些项目中也会使用的到(比如:我曾经参与的一个项目使用到SpringCloud框架,需要将每个微服务注册到,服务控制 ...
- 正确理解ThreadLocal
想必很多朋友对 ThreadLocal并不陌生,今天我们就来一起探讨下ThreadLocal的使用方法和实现原理.首先,本文先谈一下对ThreadLocal的理 解,然后根据ThreadLocal类的 ...
- buildroot使用详解
为什么要使用buildroot? (文件系统搭建,强烈建议直接用buildroot,官网[http://buildroot.uclibc.org/]上有使用教程非常详细)文件系统通常要包含很多第三方软 ...
- redis常用总结
1. 使用redis有哪些好处? (1) 速度快,因为数据存在内存中,类似于HashMap,HashMap的优势就是查找和操作的时间复杂度都是O(1) (2) 支持丰富数据类型,支持string,li ...