1、maven 仓库
可以用系统默认的仓库也可以,用自己构建的仓库,具体方法:
修改文件:D:\apache-maven-3.0.3\conf\settings.xml 里面的 <localRepository>path</localRepository> ,这里的 path 就是默认是系统默认的.m2路径,你也可以指向你自己构建的数据仓库,例: <localRepository>D:\.m2\repository</localRepository>
2、Maven Dependencies
在 pom.xml 文件中配置相关的依赖,如果你是连着网,就自动会去下载,从而引用到你所在的工程下面。
3、Failed to execute goal org.apache.maven.plugins: Compilation failure
出现这种错误一般就是你的 jdk 环境有问题, 多去从这方便找原因
4、用 jetty 启动的时候,出现此错误:No plugin found for prefix 'jetty' in the current project
一般在 pom.xml 添加如下代码
<plugin>
<groupId>org.mortbay.jetty</groupId>
<artifactId>maven-jetty-plugin</artifactId>
<version>6.1.10</version>
</plugin>
5、maven 本地仓库上传
a、选择 Repositories
b、选择 3rd party
c、选择 Artifact Upload
d、GAV Definition 选择 GAV Parameters
e、填写基本信息,上传即可下载
6、maven 依赖中 scope 的含义,这篇文章讲解的比较详细