'What will the version be when I don't specify it in the Maven's pom.xml?

Recently I wrote a project with maven, but I have a question about the version in maven pom.xml.

If I write such a dependency

<dependency>
    <groupId>foo</groupId>
    <artifactId>bar</artifactId>
     <!--No version here-->
</dependency>

what will the version be

  1. in a simple project, no subproject

  2. as a dependency in another project and that project use foo-bar-1.0.0



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source