2017-06-16 252 views
1

我在我的pom.xml中使用了2個依賴項。json-schema-validator的Maven依賴項問題

<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-schema-validator,javax.mail(版本1.4.3)已經是依賴關係了。當我的應用程序啓動時,我的郵件服務(版本1.5.0-b01)完全不起作用。但是,當我刪除json-schema-validator依賴項時,郵件服務工作得很好。有人可以幫我解決這個問題嗎?

回答

0

轉到您的項目,並期待在依賴關係樹使用:

$ 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的

<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

謝謝你許多!有效!! –

+0

如果json-schema-validator依賴於javax.mail:mailapi,那是一個早已過時的工件。有人應該向json-schema-validator的所有者報告。此外,javax.mail:mail:1.5.0-b01處於過時工件的中間構建中。 [當前版本的JavaMail是com.sun.mail:javax.mail:1.5.6](https://javaee.github.io/javamail/#Download_JavaMail_Release)。 –