新建Maven project项目时,需要选择archetype。
那么,什么是archetype?
archetype的意思就是模板原型的意思,原型是一个Maven项目模板工具包。一个原型被定义为从其中相同类型的所有其它事情是由一个原始图案或模型。名称配合,因为我们正在努力提供一种系统,该系统提供了一种生成Maven项目的一致的手段。原型将帮助作者为用户创建Maven项目模板,并为用户提供了手段,产生的这些项目模板参数化的版本。
建立Maven项目时,网上建议的分别是
1、cocoon-22-archetype-webapp
2、maven-archetype-quickstart
3、maven-archetype-webapp
那么为什么是这三种模板呢?这三种模板分别代表什么意思呢?
1、cocoon-22-archetype-webapp
建好项目后,项目的结构如下:
可以看到,这个项目结构里包含了applicationContext.xml、log4j.xml、web.xml
pom.xml的内容如下:
<?xml version="1.0" encoding="UTF-8"?>
<!--Licensed to the Apache Software Foundation (ASF) under oneor more contributor license agreements. See the NOTICE filedistributed with this work for additional informationregarding copyright ownership. The ASF licenses this fileto you under the Apache License, Version 2.0 (the"License"); you may not use this file except in compliancewith the License. You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0Unless required by applicable law or agreed to in writing,software distributed under the License is distributed on an"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANYKIND, either express or implied. See the License for thespecific language governing permissions and limitationsunder the License.
-->
<!-- $Id: pom.xml 642118 2008-03-28 08:04:16Z reinhard $ -->
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><packaging>war</packaging><name>springboot-cocoon</name><groupId>com.study.cx</groupId><artifactId>springboot-cocoon</artifactId><version>0.0.1-SNAPSHOT</version><build><plugins><plugin><groupId>org.mortbay.jetty</groupId><artifactId>maven-jetty-plugin</artifactId><version>6.1.7</version><conf