简体   繁体   中英

Difference between "mvn dependency:tree" and http://repo.maven.org dependency details

In my project there is a Java Class which does:

import javax.activation.DataHandler;

My POM only has this dependency:

<dependency>
                <groupId>javax.mail</groupId>
                <artifactId>mail</artifactId>
                <version>1.5.0-b01</version>
</dependency>

Build (mvn clean install) is working, because:

mvn dependency:tree

[INFO] --- maven-dependency-plugin:2.8:tree (default-cli)
[INFO] \- javax.mail:mail:jar:1.5.0-b01:compile
[INFO]    \- javax.activation:activation:jar:1.1:compile

But why does

https://mvnrepository.com/artifact/javax.mail/mail/1.5.0-b01

and also

https://repo1.maven.org/maven2/javax/mail/mail/1.5.0-b01/mail-1.5.0-b01.pom

say there are no dependencies ???

Another question:

Why does javax.mail:mail:jar:1.5.0-b01 (from 2013) not depend on the latest javax.activation:activation:jar:1.1.1 (from 2009)?

Because mvnrepository has it wrong, "javax.mail:mail:jar:1.5.0-b01" version does have dependency to "javax.activation:activation:jar:1.1", it's in it's parent:

Don't depend on mvnrepository very much, the truth is always in pom files. Btw. javalibs shows you the dependency:

Why the newest javax.mail version doesn't contain dependency to activation-api is probably due to transition to jakarta artifacts ... old javax dependencies cannot depend on new jakarta dependencies because Oracle said so ... :-( Newest javax.mail and activation artifacts are these:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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