1

我正在使用 Maven 3.3。我是否需要添加任何特殊的存储库来访问 servlet-api 3.0.1 jar?我已将此添加到我的 pom.xml 文件中

<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
    <version>3.0.1</version>
    <scope>provided</scope>
</dependency>

但是当我尝试进行构建时出现此错误...

[ERROR] Failed to execute goal on project core: Could not resolve dependencies for project org.collegeboard.springboard:core:jar:99.0.0-SNAPSHOT: Could not find artifact javax.servlet:servlet-api:jar:3.0.1 in thirdparty (https://nexus.getmyco.com/nexus/content/repositories/thirdparty/) -> [Help 1]

我需要这个依赖,因为我被告知另一个依赖(spring-test-4.0.6.RELEASE)需要这个。

4

1 回答 1

1

看spring-test-4.0.6.RELEASE的pom:http ://search.maven.org/#artifactdetails|org.springframework|spring-test|4.0.6.RELEASE|jar

它实际上取决于以下几点:

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>javax.servlet-api</artifactId>
  <version>3.0.1</version>
  <scope>compile</scope>
  <optional>true</optional>
</dependency>
于 2017-05-05T14:46:04.350 回答