The Gilbert Arenas Dagger
The Gilbert Arenas Dagger

Reputation: 12731

Dependency Version Format: ${version.XXX}

In my pom.xml file, I have a lot of references to the dependency version using the format {version.XXX}. For example:

    <dependency>
        <groupId>com.extjs</groupId>
        <artifactId>gxt</artifactId>
        <version>${version.gxt}</version>
    </dependency>

I'm having a hard time finding information on this kind of format. My assumption is that this is used for handling scenarios where you have multiple dependencies that reference the same artifactId. This would allow us to only maintain the version information in one place. So ${version.XXX} would mean something like "find the version attribute for the XXX artificatId referenced somewhere else".

My questions:

  1. Is my assumption correct? If not please correct me!
  2. If my assumption is correct, then are there certain rules that have to be followed to use this correctly? For example, must you first list a dependency containing a pom.xml that provides the XXX artifact version information before listing a dependency that uses the ${version.XXX} format?

Upvotes: 0

Views: 687

Answers (1)

tddmonkey
tddmonkey

Reputation: 21184

This is just a property replacement, so somewhere in either this pom or in one of the parents you must list the version as a property, like this:

<properties>
    <version.gxt>your version goes here</version.gxt>
</properties>

Upvotes: 2

Related Questions