首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >json-schema-验证器的Maven依赖问题

json-schema-验证器的Maven依赖问题
EN

Stack Overflow用户
提问于 2017-06-16 05:05:32
回答 1查看 1.4K关注 0票数 1

我在我的pom.xml中使用了两个依赖项。

代码语言:javascript
复制
 <dependency>
        <groupId>com.github.fge</groupId>
        <artifactId>json-schema-validator</artifactId>
        <version>2.2.6</version>
    </dependency>
    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.5.0-b01</version>
    </dependency>

但是对于json模式验证器来说,javax.mail (版本1.4.3)已经是一个依赖项了。当我的应用程序启动时,我的邮件服务(版本1.5.0-b01)根本无法工作。但是,当我移除json模式验证器依赖项时,邮件服务就完全正常了。有人能帮我解决这个问题吗?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-16 07:05:28

转到您的项目并使用以下方法查看依赖关系树:

代码语言:javascript
复制
$ mvn dependency:tree
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.greg 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-dependency-plugin:2.8:tree (default-cli) @ example-jar ---
[INFO] com.greg:example-jar:jar:1.0-SNAPSHOT
[INFO] +- com.github.fge:json-schema-validator:jar:2.2.6:compile
[INFO] |  +- com.google.code.findbugs:jsr305:jar:3.0.0:compile
[INFO] |  +- joda-time:joda-time:jar:2.3:compile
[INFO] |  +- com.googlecode.libphonenumber:libphonenumber:jar:6.2:compile
[INFO] |  +- com.github.fge:json-schema-core:jar:1.2.5:compile
[INFO] |  |  +- com.github.fge:uri-template:jar:0.9:compile
[INFO] |  |  |  +- com.github.fge:msg-simple:jar:1.1:compile
[INFO] |  |  |  |  \- com.github.fge:btf:jar:1.2:compile
[INFO] |  |  |  \- com.google.guava:guava:jar:16.0.1:compile
[INFO] |  |  +- com.github.fge:jackson-coreutils:jar:1.8:compile
[INFO] |  |  |  \- com.fasterxml.jackson.core:jackson-databind:jar:2.2.3:compile
[INFO] |  |  |     +- com.fasterxml.jackson.core:jackson-annotations:jar:2.2.3:compile
[INFO] |  |  |     \- com.fasterxml.jackson.core:jackson-core:jar:2.2.3:compile
[INFO] |  |  \- org.mozilla:rhino:jar:1.7R4:compile
[INFO] |  +- javax.mail:mailapi:jar:1.4.3:compile
[INFO] |  \- net.sf.jopt-simple:jopt-simple:jar:4.6:compile
[INFO] \- javax.mail:mail:jar:1.5.0-b01:compile
[INFO]    \- javax.activation:activation:jar:1.1:compile
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.819 s
[INFO] Finished at: 2017-06-16T08:01:10+01:00
[INFO] Final Memory: 14M/174M
[INFO] ------------------------------------------------------------------------

所以我猜你是想确保你能得到最新版本的javax.mail

代码语言:javascript
复制
<dependency>
    <groupId>com.github.fge</groupId>
    <artifactId>json-schema-validator</artifactId>
    <version>2.2.6</version>
    <exclusions>
      <exclusion>
         <groupId>javax.mail</groupId>
         <artifactId>mailapi</artifactId>
      </exclusion>
    </exclusions>
</dependency>
<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>mail</artifactId>
    <version>1.5.0-b01</version>
</dependency>
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44581207

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档