maven依赖jar版本不同于pom.xml规范

snvhrwxg  于 2021-07-06  发布在  Java
关注(0)|答案(1)|浏览(419)

我不断地得到:Java.Noo.Fiel.NoujFielExtExc:C:\程序文件\ Apache软件基金会\ Tomcat 9 \ WTPWebApps\WebAPP\WebINF\Lab\JaveSon DavaBIND-2 .2.9JAR异常。我在pom.xml文件中有依赖版本2.9.6,但在maven dependencies文件夹中有jackson-databind-2.11.2.jar。
有人知道原因或者怎么解决吗?为什么jackson-databind-2.11.2.jar会出现在这里?
这是我的pom.xml文件:

  1. <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  2. xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  3. <modelVersion>4.0.0</modelVersion>
  4. <groupId>com.ipomoea</groupId>
  5. <artifactId>WebApp</artifactId>
  6. <version>0.0.1-SNAPSHOT</version>
  7. <packaging>war</packaging>
  8. <name>Webapp</name>
  9. <!-- FIXME change it to the project's website -->
  10. <url>http://www.example.com</url>
  11. <properties>
  12. <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  13. <maven.compiler.source>1.7</maven.compiler.source>
  14. <maven.compiler.target>1.7</maven.compiler.target>
  15. </properties>
  16. <dependencies>
  17. <dependency>
  18. <groupId>junit</groupId>
  19. <artifactId>junit</artifactId>
  20. <version>4.11</version>
  21. <scope>test</scope>
  22. </dependency>
  23. <dependency>
  24. <groupId>javax.servlet</groupId>
  25. <artifactId>javax.servlet-api</artifactId>
  26. <version>3.1.0</version>
  27. </dependency>
  28. <!-- https://mvnrepository.com/artifact/javax.activation/activation -->
  29. <dependency>
  30. <groupId>javax.activation</groupId>
  31. <artifactId>activation</artifactId>
  32. <version>1.1.1</version>
  33. </dependency>
  34. <dependency>
  35. <!-- Reference JPA provider, substitute with another JPA provider as desired-->
  36. <groupId>org.eclipse.persistence</groupId>
  37. <artifactId>eclipselink</artifactId>
  38. <version>2.7.7</version>
  39. </dependency>
  40. <!-- https://mvnrepository.com/artifact/org.hibernate/hibernate-core -->
  41. <dependency>
  42. <groupId>org.hibernate</groupId>
  43. <artifactId>hibernate-core</artifactId>
  44. <version>5.4.18.Final</version>
  45. </dependency>
  46. <dependency>
  47. <groupId>mysql</groupId>
  48. <artifactId>mysql-connector-java</artifactId>
  49. <version>8.0.11</version>
  50. </dependency>
  51. <!-- FIDO --><!-- https://mvnrepository.com/artifact/com.yubico/webauthn-server-core -->
  52. <dependency>
  53. <groupId>com.yubico</groupId>
  54. <artifactId>webauthn-server-core</artifactId>
  55. <version>1.6.1</version>
  56. </dependency>
  57. <dependency>
  58. <groupId>com.yubico</groupId>
  59. <artifactId>webauthn-server-attestation</artifactId>
  60. <!--Check for the latest version at Maven Central-->
  61. <version>1.2.0</version>
  62. <scope>compile</scope>
  63. </dependency>
  64. <!-- https://mvnrepository.com/artifact/org.bouncycastle/bcprov-jdk15on -->
  65. <dependency>
  66. <groupId>org.bouncycastle</groupId>
  67. <artifactId>bcprov-jdk15on</artifactId>
  68. <version>1.66</version>
  69. </dependency>
  70. <dependency>
  71. <groupId>com.upokecenter</groupId>
  72. <artifactId>cbor</artifactId>
  73. <version>4.2.0</version>
  74. </dependency>
  75. <!-- https://mvnrepository.com/artifact/org.checkerframework/checker-qual -->
  76. <dependency>
  77. <groupId>org.checkerframework</groupId>
  78. <artifactId>checker-qual</artifactId>
  79. <version>2.11.1</version>
  80. </dependency>
  81. <!-- https://mvnrepository.com/artifact/javax.ws.rs/javax.ws.rs-api -->
  82. <dependency>
  83. <groupId>javax.ws.rs</groupId>
  84. <artifactId>javax.ws.rs-api</artifactId>
  85. <version>2.0</version>
  86. </dependency>
  87. <!-- https://mvnrepository.com/artifact/com.yubico/yubico-util -->
  88. <dependency>
  89. <groupId>com.yubico</groupId>
  90. <artifactId>yubico-util</artifactId>
  91. <version>1.6.4</version>
  92. </dependency>
  93. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.datatype/jackson-datatype-jdk8 -->
  94. <dependency>
  95. <groupId>com.fasterxml.jackson.datatype</groupId>
  96. <artifactId>jackson-datatype-jdk8</artifactId>
  97. <version>2.11.2</version>
  98. </dependency>
  99. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-core -->
  100. <dependency>
  101. <groupId>com.fasterxml.jackson.core</groupId>
  102. <artifactId>jackson-core</artifactId>
  103. <version>2.9.9</version>
  104. </dependency>
  105. <!-- https://mvnrepository.com/artifact/commons-codec/commons-codec -->
  106. <dependency>
  107. <groupId>commons-codec</groupId>
  108. <artifactId>commons-codec</artifactId>
  109. <version>1.9</version>
  110. </dependency><!-- https://mvnrepository.com/artifact/com.augustcellars.cose/cose-java -->
  111. <dependency>
  112. <groupId>com.augustcellars.cose</groupId>
  113. <artifactId>cose-java</artifactId>
  114. <version>0.9.4</version>
  115. </dependency>
  116. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
  117. <dependency>
  118. <groupId>com.fasterxml.jackson.core</groupId>
  119. <artifactId>jackson-annotations</artifactId>
  120. <version>2.9.0</version>
  121. </dependency>
  122. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.dataformat/jackson-dataformat-cbor -->
  123. <dependency>
  124. <groupId>com.fasterxml.jackson.dataformat</groupId>
  125. <artifactId>jackson-dataformat-cbor</artifactId>
  126. <version>2.9.6</version>
  127. </dependency>
  128. <!-- https://mvnrepository.com/artifact/commons-logging/commons-logging -->
  129. <dependency>
  130. <groupId>commons-logging</groupId>
  131. <artifactId>commons-logging</artifactId>
  132. <version>1.2</version>
  133. </dependency>
  134. <!-- https://mvnrepository.com/artifact/org.apache.httpcomponents/httpclient -->
  135. <dependency>
  136. <groupId>org.apache.httpcomponents</groupId>
  137. <artifactId>httpclient</artifactId>
  138. <version>4.5.2</version>
  139. </dependency>
  140. <!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-databind -->
  141. <dependency>
  142. <groupId>com.fasterxml.jackson.core</groupId>
  143. <artifactId>jackson-databind</artifactId>
  144. <version>2.9.6</version>
  145. </dependency>
  146. </dependencies>
  147. <build>
  148. <finalName>WebApp</finalName>
  149. <pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
  150. <plugins>
  151. <plugin>
  152. <artifactId>maven-clean-plugin</artifactId>
  153. <version>3.1.0</version>
  154. </plugin>
  155. <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_war_packaging -->
  156. <plugin>
  157. <artifactId>maven-resources-plugin</artifactId>
  158. <version>3.0.2</version>
  159. </plugin>
  160. <plugin>
  161. <artifactId>maven-compiler-plugin</artifactId>
  162. <version>3.8.0</version>
  163. </plugin>
  164. <plugin>
  165. <artifactId>maven-surefire-plugin</artifactId>
  166. <version>2.22.1</version>
  167. </plugin>
  168. <plugin>
  169. <artifactId>maven-war-plugin</artifactId>
  170. <version>3.2.2</version>
  171. </plugin>
  172. <plugin>
  173. <artifactId>maven-install-plugin</artifactId>
  174. <version>2.5.2</version>
  175. </plugin>
  176. <plugin>
  177. <artifactId>maven-deploy-plugin</artifactId>
  178. <version>2.8.2</version>
  179. </plugin>
  180. </plugins>
  181. </pluginManagement>
  182. </build>
  183. </project>
ruarlubt

ruarlubt1#

如果您使用的是eclipse,您可以右键单击您的项目,然后单击maven>updateproject…,然后选中forceupdateofsnapshots/releases复选框,然后单击ok。
如果您在项目上使用intellij右键单击,那么maven>reimport
最终,您可以在项目的根目录中尝试通过终端 mvn clean install 或者如果你的项目中有maven Package 器 mvnw clean install 在窗口或 ./mvnw clean install 在linux上。

相关问题