1,在conf/setting.xml中添加mirror
View Code
<mirror> <id>ibiblio.org</id> <name>ibiblio Mirror of http://repo1.maven.org/maven2/</name> <url>http://mirrors.ibiblio.org/pub/mirrors/maven2</url> <mirrorOf>central</mirrorOf> <!-- United States, North Carolina --> </mirror> <mirror> <id>jboss-public-repository-group</id> <mirrorOf>central</mirrorOf> <name>JBoss Public Repository Group</name> <url>http://repository.jboss.org/nexus/content/groups/public</url> </mirror>
2,pom.xml提示
View Code
ArtifactTransferException: Failure to transfer org.slf4j:slf4j-api:jar:1.5.8 from http://mirrors.ibiblio.org/pub/mirrors/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of ibiblio.org has elapsed or updates are forced. Original error:
Could not transfer artifact org.slf4j:slf4j-api:jar:1.5.8 from/to ibiblio.org (http://mirrors.ibiblio.org/pub/mirrors/maven2): Access denied to http://mirrors.ibiblio.org/pub/mirrors/maven2/org/slf4j/slf4j-api/1.5.8/slf4j-api-1.5.8.jar. Error code 403, Forbidden
解决方法:清空本地仓库中的未成功下载的slf4j文件,然后重新下载。
3,添加Oracle Driver到本地仓库
用如下命令安装:mvn install:install-file -DgroupId=com.oracle -DartifactId=ojdbc14 -Dversion=10.2.0.1.0 -Dpackaging=jar -Dfile=D:\1\classes12.jar
然后在pom.xml中添加依赖
View Code
1 <dependency> 2 <groupId>com.oracle</groupId> 3 <artifactId>ojdbc14</artifactId> 4 <version>10.2.0.1.0</version> 5 </dependency>
4,new Maven Project时候没有maven-archetype-quickstart这一项,可以找到maven-archetype-quickstart-1.1.jar[url:http://mirrors.ibiblio.org/maven2/org/apache/maven/archetypes/maven-archetype-quickstart/1.1/maven-archetype-quickstart-1.1.jar]的url,然后添加。如下图