今天配置了maven,想使用maven管理web项目
配置了maven后,我想更改本地maven库的位置,于是更改了apache-maven-3.2.1\conf\setting.xml
<localRepository>D:\maven_repository\repo</localRepository>把本地库设置在了D:\maven_repository\repo
在intellij idea12 中新建了web项目,添加了maven support
然后更改了设置如上图
<?xml version="1.0" encoding="UTF-8"?><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/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>web.springdemo</groupId> <artifactId>springdemo01</artifactId> <version>1.0-SNAPSHOT</version> <dependencies> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-core</artifactId> <version>4.0.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-web</artifactId> <version>4.0.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-webmvc</artifactId> <version>4.0.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-beans</artifactId> <version>4.0.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context</artifactId> <version>4.0.3.RELEASE</version> </dependency> <dependency> <groupId>org.springframework</groupId> <artifactId>spring-context-support</artifactId> <version>4.0.3.RELEASE</version> </dependency> </dependencies></project>
pom.xml 如上
但是我运行clean时,报错了,22:27:40 Error running springdemo01 [clean]: D:\maven_repository\repo is not a valid Maven home directory. Configure Maven home呃,只能收求大家解救啦