简体   繁体   English

Maven:在中央找不到工件javax.servlet:jsp-api:jar:2.4

[英]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. 我想将jsp-api 2.4作为依赖项添加到我的项目中。 So I add the following code to my pom.xml as described on mvnrepository.com 因此,按照mvnrepository.com所述,将以下代码添加到pom.xml

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

But I keep getting the following error on mvn package : 但是我在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] [错误]无法在项目sef上执行目标:无法解析项目ru.jofsey:sefs:war:1.0-SNAPSHOT的依赖项:在中央( https:/无法找到工件javax.servlet:jsp-api:jar:2.4 /repo.maven.apache.org/maven2 )-> [帮助1]

Here is the newest JSP version that can be found in Maven central: 这是可以在Maven Central中找到的最新JSP版本:

<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. 似乎版本2.4不在中央,但在“ jboss 3rd-party”存储库中。 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. 您可以在settings.xml或正在构建的项目的pom.xml中指定它。

When using mvnrepository.com be sure to pay attention to the Repositories field in the table above the tabs that show the pom markup. 使用mvnrepository.com时,请务必注意显示pom标记的选项卡上方表格中的“ 存储库”字段。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 maven中最新的javax.servlet.jsp jsp-api版本是否稳定? - Is the latest javax.servlet.jsp jsp-api version in maven stable? 在中央(https://repo.maven.apache.org/maven2)中找不到工件javax.sql:jdbc-stdext:jar:2.0 - Could not find artifact javax.sql:jdbc-stdext:jar:2.0 in central (https://repo.maven.apache.org/maven2) servlet-api 2.5和jsp-api 2.1受maven依赖 - servlet-api 2.5 & jsp-api 2.1 coming under maven dependancies 如何解决 Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)? - How do I resolve Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)? Maven:已部署javax.servlet规范 - Maven: javax.servlet specification deployed OSGi:无法解析 javax.servlet - OSGi: Could not resolve javax.servlet 在中央找不到工件 sun-jaxb:jaxb-api:jar:2.2 - Could not find artifact sun-jaxb:jaxb-api:jar:2.2 in central 在中央找不到工件 gnu.trove:trove:jar:3.0.3 (https://repo.maven.apache.org/maven2) - Could not find artifact gnu.trove:trove:jar:3.0.3 in central (https://repo.maven.apache.org/maven2) 在指定路径找不到工件 javax.jnlp:jnlp-api:jar:5.0 - Could not find artifact javax.jnlp:jnlp-api:jar:5.0 at specified path Spring无法使用javax.servlet编译JSP - Spring can't compile jsp with javax.servlet
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM