简体   繁体   English

javax.servlet .lastUpdated问题

[英]javax.servlet .lastUpdated issue

I have the following dependencies in pom.xml: 我在pom.xml中具有以下依赖关系:

  <properties>
      <javax.servlet.version>3.1.0</javax.servlet.version>
  </properties>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>servlet-api</artifactId>
        <version>${javax.servlet.version}</version>
    </dependency>
  </dependencies>

When I run nvm clean install in my project, in my ~/.m2/repository/javax/servlet/servlet-api/3.1.0/ maven creates servlet-api-3.1.0.jar.lastUpdated and servlet-api-3.1.0.pom.lastUpdated 当我在项目中运行nvm clean install时,在我的~/.m2/repository/javax/servlet/servlet-api/3.1.0/ maven创建了servlet-api-3.1.0.jar.lastUpdatedservlet-api-3.1.0.pom.lastUpdated

Why does maven create servlet-api-3.1.0.jar.lastUpdated instead of servlet-api-3.1.0.jar ? 为什么maven创建servlet-api-3.1.0.jar.lastUpdated而不是servlet-api-3.1.0.jar

Because download servlet-api-3.1.0.jar failed from network. 因为从网络下载servlet-api-3.1.0.jar失败。
you can see the debug,and find wihch reason lead to download failed. 您可以看到调试信息,并找到导致下载失败的原因。

maven find jar process: maven查找jar过程:
1.from your loacal responsitory ( .m2 dir) 1.来自您的地方责任( .m2目录)
2.if not found,will find from there(where your pom.xml setting) 2.如果找不到,将从那里找到(您的pom.xml设置在哪里)

<repositories>
    <repository>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <id>public</id>
        <name>Public Repositories</name>
        <url>http://yourOwnRepository/nexus/content/repositories/thirdparty/</url>
    </repository>
</repositories>

3.if not found,will find from your maven settings.xml config 3.如果找不到,将从您的Maven settings.xml配置中找到

4.if not fond,will find from default maven repository 4.如果不喜欢,将从默认的Maven仓库中找到

perhaps your should use class whose artifactId is javax.servlet-api rather than servlet-api.I met the problem, eventually found the class i used is in javax.servlet-api . 也许您应该使用其artifactId为javax.servlet-api而不是servlet-api的类。我遇到了问题,最终发现我使用的类位于javax.servlet-api中。 see here, the detailed explanation Difference between javax.servlet-api.jar vs servlet-api.jar 参见此处,详细说明javax.servlet-api.jar与servlet-api.jar之间的区别

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

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