①创建Maven项目,首先选择创建后的工作区——项目存放的地址。
②选择Maven项目的模板(quikstart或者webapp等等),这个时候有的时候会发现没有选项
一个是通过添加URL网址下载,另外一个下载本地。当然是选择下载到本地的xml文件,官网的文件地址为:
http://repo1.maven.org/maven2/archetype-catalog.xml。(温馨提示:ctrl + s)下载保存
不过问题来了,源文件大小为7M多,里面的配置文件代码更是数不胜数。如果使用Eclipse加载该文件windows -> Maven ->Archetypes -> Add Local Catalog:
然后创建新的Maven项目,进入选择模板(Select an Archetype),你会发现加载不完,还没等到你要的Maven模板,你所分配给eclipse的内存就会爆满,出现错误、卡死。
这个时候就需要取其精华了,在本地建立一个xml文件archetype-catalog.xml,命名一样就可以,内容我已经帮你截取出来了:
org.apache.maven.archetypes
maven-archetype-archetype
1.4
An archetype which contains a sample archetype.
org.apache.maven.archetypes
maven-archetype-archetype
1.3
An archetype which contains a sample archetype.
org.apache.maven.archetypes
maven-archetype-archetype
1.0
An archetype which contains a sample archetype.
org.apache.maven.archetypes
maven-archetype-archetype
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-j2ee-simple
1.4
An archetype which contains a simplified sample J2EE application.
org.apache.maven.archetypes
maven-archetype-j2ee-simple
1.3
An archetype which contains a simplified sample J2EE application.
org.apache.maven.archetypes
maven-archetype-j2ee-simple
1.0
An archetype which contains a simplifed sample J2EE application.
org.apache.maven.archetypes
maven-archetype-j2ee-simple
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-marmalade-mojo
1.0-alpha-3
org.apache.maven.archetypes
maven-archetype-marmalade-mojo
1.0-alpha-2
org.apache.maven.archetypes
maven-archetype-marmalade-mojo
1.0-alpha-1
org.apache.maven.archetypes
maven-archetype-mojo
1.0
An archetype which contains a sample a sample Maven plugin.
org.apache.maven.archetypes
maven-archetype-mojo
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-mojo
1.0-alpha-3
org.apache.maven.archetypes
maven-archetype-mojo
1.0-alpha-2
org.apache.maven.archetypes
maven-archetype-mojo
1.0-alpha-1
org.apache.maven.archetypes
maven-archetype-plugin
1.4
An archetype which contains a sample Maven plugin.
org.apache.maven.archetypes
maven-archetype-plugin
1.3
An archetype which contains a sample Maven plugin.
org.apache.maven.archetypes
maven-archetype-plugin
1.2
An archetype which contains a sample Maven plugin.
org.apache.maven.archetypes
maven-archetype-plugin
1.1
An archetype which contains a sample Maven plugin.
org.apache.maven.archetypes
maven-archetype-plugin
1.0
An archetype which contains a sample Maven plugin.
org.apache.maven.archetypes
maven-archetype-plugin-site
1.4
An archetype which contains a sample Maven plugin site. This archetype can be layered upon an
existing Maven plugin project.
org.apache.maven.archetypes
maven-archetype-plugin-site
1.3
An archetype which contains a sample Maven plugin site. This archetype can be layered upon an
existing Maven plugin project.
org.apache.maven.archetypes
maven-archetype-plugin-site
1.1
An archetype which contains a sample Maven plugin site. This archetype can be layered upon an
existing Maven plugin project.
org.apache.maven.archetypes
maven-archetype-plugin-site
1.0
An archetype which contains a sample Maven plugin site. This archetype can be layered upon an
existing Maven plugin project.
org.apache.maven.archetypes
maven-archetype-portlet
1.4
An archetype which contains a sample JSR-268 Portlet.
org.apache.maven.archetypes
maven-archetype-portlet
1.3
An archetype which contains a sample JSR-268 Portlet.
org.apache.maven.archetypes
maven-archetype-portlet
1.0.1
An archetype which contains a sample JSR-268 Portlet.
org.apache.maven.archetypes
maven-archetype-portlet
1.0
An archetype which contains a sample JSR-268 Portlet.
org.apache.maven.archetypes
maven-archetype-portlet
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-profiles
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-quickstart
1.4
An archetype which contains a sample Maven project.
org.apache.maven.archetypes
maven-archetype-quickstart
1.3
An archetype which contains a sample Maven project.
org.apache.maven.archetypes
maven-archetype-quickstart
1.1
An archetype which contains a sample Maven project.
org.apache.maven.archetypes
maven-archetype-quickstart
1.0
An archetype which contains a sample Maven project.
org.apache.maven.archetypes
maven-archetype-quickstart
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-quickstart
1.0-alpha-3
org.apache.maven.archetypes
maven-archetype-quickstart
1.0-alpha-2
org.apache.maven.archetypes
maven-archetype-quickstart
1.0-alpha-1
org.apache.maven.archetypes
maven-archetype-simple
1.4
An archetype which contains a simple Maven project.
org.apache.maven.archetypes
maven-archetype-simple
1.3
An archetype which contains a simple Maven project.
org.apache.maven.archetypes
maven-archetype-site
1.4
An archetype which contains a sample Maven site which demonstrates some of the supported document types like
APT, XDoc, and FML and demonstrates how to i18n your site. This archetype can be layered
upon an existing Maven project.
org.apache.maven.archetypes
maven-archetype-site
1.3
An archetype which contains a sample Maven site which demonstrates some of the supported document types like
APT, XDoc, and FML and demonstrates how to i18n your site. This archetype can be layered
upon an existing Maven project.
org.apache.maven.archetypes
maven-archetype-site
1.1
An archetype which contains a sample Maven site which demonstrates some of the supported document types like
APT, XDoc, and FML and demonstrates how to i18n your site. This archetype can be layered
upon an existing Maven project.
org.apache.maven.archetypes
maven-archetype-site
1.0
An archetype which contains a sample Maven site which demonstrates some of the supported document types like
APT, XDoc, and FML and demonstrates how to i18n your site. This archetype can be layered
upon an existing Maven project.
org.apache.maven.archetypes
maven-archetype-site
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-site
1.0-alpha-2
org.apache.maven.archetypes
maven-archetype-site-simple
1.4
An archetype which contains a sample Maven site.
org.apache.maven.archetypes
maven-archetype-site-simple
1.3
An archetype which contains a sample Maven site.
org.apache.maven.archetypes
maven-archetype-site-simple
1.1
An archetype which contains a sample Maven site.
org.apache.maven.archetypes
maven-archetype-site-simple
1.0
An archetype which contains a sample Maven site.
org.apache.maven.archetypes
maven-archetype-site-simple
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-site-skin
1.4
An archetype which contains a sample Maven Site Skin.
org.apache.maven.archetypes
maven-archetype-site-skin
1.3
An archetype which contains a sample Maven Site Skin.
org.apache.maven.archetypes
maven-archetype-webapp
1.4
An archetype which contains a sample Maven Webapp project.
org.apache.maven.archetypes
maven-archetype-webapp
1.3
An archetype which contains a sample Maven Webapp project.
org.apache.maven.archetypes
maven-archetype-webapp
1.0
An archetype which contains a sample Maven Webapp project.
org.apache.maven.archetypes
maven-archetype-webapp
1.0-alpha-4
org.apache.maven.archetypes
maven-archetype-webapp
1.0-alpha-3
org.apache.maven.archetypes
maven-archetype-webapp
1.0-alpha-2
org.apache.maven.archetypes
maven-archetype-webapp
1.0-alpha-1
org.apache.myfaces.buildtools
myfaces-archetype-codi-jsf12
1.0.4
Archetype to create a new JSF 1.2 webapp based on MyFaces CODI
org.apache.myfaces.buildtools
myfaces-archetype-codi-jsf12
1.0.3
Archetype to create a new JSF 1.2 webapp based on MyFaces CODI
重新选择本地该文件,配置即可:
PS:如果觉得你想用更低的Version,请在xml文件里面删除高版本即可显示没删除的低版本。
觉得有帮助的话就点个赞呗,也给我一丢丢小动力~
我的第一个MyBatis整合Spring程序