简体   繁体   中英

Maven: Could not find artifact javax.servlet:jsp-api:jar:2.4 in central

I want to add jsp-api 2.4 as a dependency to my project. So I add the following code to my pom.xml as described on mvnrepository.com

<dependency>
  <groupId>javax.servlet</groupId>
  <artifactId>jsp-api</artifactId>
  <version>2.4</version>
</dependency>

But I keep getting the following error on mvn package :

[ERROR] Failed to execute goal on project sefs: Could not resolve dependencies for project ru.jofsey:sefs:war:1.0-SNAPSHOT: Could not find artifact javax.servlet:jsp-api:jar:2.4 in central ( https://repo.maven.apache.org/maven2 ) -> [Help 1]

Here is the newest JSP version that can be found in Maven central:

<dependency>
    <groupId>javax.servlet.jsp</groupId>
    <artifactId>javax.servlet.jsp-api</artifactId>
    <version>2.3.1</version>
</dependency>

It appears that version 2.4 is not in central, but is in the "jboss 3rd-party" repository. If you add configuration for this repo, it should work. There are a few ways to do this, depending for example whether you're using a repo manager. You could specify it in your settings.xml, or in the pom.xml for the project you're building.

When using mvnrepository.com be sure to pay attention to the Repositories field in the table above the tabs that show the pom markup.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM