Java – no version Maven dependency

Recently, I have been developing some improvements in some pre - development projects, which is what I found Many dependencies in the POM file have no version specified, but they have been resolved The project consists of one root module and two sub modules Using the aggregator pattern means that there is no dependency management part The upper project simply aggregates two modules, which is what it does The subproject does not involve parents They have different parents What I can't understand is that the subprojects themselves and their parents (in fact, they don't have dependency management or) specify some version of dependencies For example:

<dependency>
    <groupId>javax.mail</groupId>
    <artifactId>javax.mail-api</artifactId>
</dependency>
<dependency>
    <groupId>com.sun.mail</groupId>
    <artifactId>javax.mail</artifactId>
</dependency>
<dependency>
    <groupId>com.sun.mail</groupId>
    <artifactId>imap</artifactId>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>jcl-over-slf4j</artifactId>
</dependency>
<dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>jul-to-slf4j</artifactId>
</dependency>
<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-classic</artifactId>
</dependency>

Can someone help me find out? Maven seems to handle version control with some default policies

Solution

OK, I think I'll answer it myself Of course, I looked at dependencies: the tree, but all the dependencies I mentioned are the first level members of the tree I didn't notice immediately that dependency management does not exist in the parent item, but it exists in the child module. It contains more interesting things:

<dependency>
            <groupId>io.spring.platform</groupId>
            <artifactId>platform-bom</artifactId>
            <version>1.0.2.RELEASE</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>

I have never used the spring IO platform before, so this is a new concept for me It turns out that the platform contains many preconfigured dependencies: http://docs.spring.io/platform/docs/current/reference/htmlsingle/#appendix -dependency-versions

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>