BARJ
BARJ

Reputation: 2002

Maven. Find versions of included dependencies by dependency

Is it possible, given a dependency such as shown below to determine the versions of included dependencies:

<!-- https://mvnrepository.com/artifact/org.apache.tomcat.embed/tomcat-embed-core -->
<dependency>
    <groupId>org.apache.tomcat.embed</groupId>
    <artifactId>tomcat-embed-core</artifactId>
    <version>8.5.6</version>
</dependency>

For example, can we determine which version of javax.servlet-api tomcat-embed-core uses as dependency?

I would like to use the same version of javax.servlet-api in a sub-module. But I don't want to include the whole tomcat-embed-core dependency just to get the right version of javax.servlet.api.

(Optional question: Is there an easy way to do this in IntelliJ?)

Upvotes: 0

Views: 69

Answers (1)

Essex Boy
Essex Boy

Reputation: 7950

In Intelij you can right click on the pom -> maven -> show effective pom.

Or I would say best is from the command line:

mvn dependency:list | grep tomcat

Upvotes: 1

Related Questions