New user to maven. Loving it so far. But I've encountered a real hair puller.
I have a controller project that uses maven to manage its dependencies. One of its dependencies is on a library (dba.library) that is also built using maven. The library has two release branches (current versions are 2.1.10 and 2.2.5). I'm in the process of switching the controller from using the 2.1 release of the library to using the 2.2 release. mvn -version output: Maven version: 2.0.8 Java version: 1.5.0_10] OS name: "linux" version: "2.4.21-32.0.1.el" arch: "i386" Family: "unix" The controller pom.xml had the following dependency: <dependency> <groupId>com.metro1</groupId> <artifactId>dba.library</artifactId> <version>[2.1,2.2)</version> <optional>true</optional> </dependency> Which worked just fine. It consistently gives me the 2.1.10 version of the jar. I changed it to: <dependency> <groupId>com.metro1</groupId> <artifactId>dba.library</artifactId> <version>[2.2,2.3)</version> <optional>true</optional> </dependency> Thinking this would give me the 2.2.5 version of the jar. Instead, I got the following errors: [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Failed to resolve artifact. The artifact has no valid ranges com.metro1:dba.library:jar:2.2.5 Path to dependency: 1) com.metro1:skynet-controller:jar:3.6.8-SNAPSHOT If I change the dependency to specify the current build of the 2.2 dba.library: <dependency> <groupId>com.metro1</groupId> <artifactId>dba.library</artifactId> <version>2.2.5</version> <optional>true</optional> </dependency> Then the dependency is picked up just fine. Am I doing something wrong? For additional info, here's the maven-metadata-central.xml file for dba.library from my local repository: <?xml version="1.0" encoding="UTF-8"?><metadata> <groupId>com.metro1</groupId> <artifactId>dba.library</artifactId> <version>2.1.10</version> <versioning> <release>2.2.5</release> <versions> <version>2.1.10</version> <version>2.2.5</version> </versions> <lastUpdated>20080109183939</lastUpdated> </versioning> </metadata> And here's maven-metadata-local.xml: <?xml version="1.0" encoding="UTF-8"?><metadata> <groupId>com.metro1</groupId> <artifactId>dba.library</artifactId> <version>2.1.10</version> <versioning> <versions> <version>2.1.10</version> <version>2.2.5</version> </versions> <lastUpdated>20080109183936</lastUpdated> </versioning> </metadata> Any help would be appreciated.