我是 Maven 和 Eclipse 的新手。我们一直在使用 Netbeans 并在我们的项目中手动安装 jars。
我认为 Maven 的目的是根据您的依赖项下载所需的 jar?
在一个新项目中,我在dependencies
pom.xml 文件的节点下添加了以下内容:
<!-- Java dependencies -->
<dependency>
<groupId>javax.annotation</groupId>
<artifactId>com.springsource.javax.annotation</artifactId>
</dependency>
<!-- Spring dependencies -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>org.springframework.orm</artifactId>
</dependency>
<!-- Spring Security dependencies -->
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>org.springframework.security.config</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>org.springframework.security.core</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>org.springframework.security.taglibs</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.security</groupId>
<artifactId>org.springframework.security.web</artifactId>
</dependency>
<!-- Other dependencies -->
<dependency>
<groupId>com.mysql.jdbc</groupId>
<artifactId>com.springsource.com.mysql.jdbc</artifactId>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>com.springsource.org.apache.commons.dbcp</artifactId>
<scope>runtime</scope>
</dependency>
但我得到的只是:
项目构建错误:javax.annotation:com.springsource.javax.annotation:jar 的“dependencies.dependency.version”缺失。
……
我究竟做错了什么?