You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Chris Andersen <Ch...@metro1.com> on 2008/01/09 20:14:05 UTC

Dependency version range not working. "The artifact has no valid ranges" is given when it certainly looks like it has a valid range.

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.


RE: Dependency version range not working. "The artifact has no valid ranges" is given when it certainly looks like it has a valid range.

Posted by Chris Andersen <Ch...@metro1.com>.
Thanks

-----Original Message-----
From: Michael McCallum [mailto:gholam@apache.org] 
Sent: Thursday, January 10, 2008 10:57 AM
To: Maven Users List
Subject: Re: Dependency version range not working. "The artifact has no
valid ranges" is given when it certainly looks like it has a valid
range.

yes better message would be good

you might want to change your deps to [2.1,2.2-!) other wise if you
someone 
deploys a 2.2-SNAPSHOT its calculated as < 2.2 and included in the range

[2.1,2.2)
 
On Fri, 11 Jan 2008 06:40:16 Chris Andersen wrote:
> Thanks. Looks like I had another library that I was dependent on that
> still had a dependency on the 2.1 branch of the dba.library.
>
> This is actually a good thing as this kind of inconsistent dependency
> could have burned me in runtime. But it would have been nice if maven
> gave me a better error message explaining the problem. The error
> messages said I had "no valid ranges" when in fact I had valid ranges,
> they were just too many of them! It should explicitly say that it has
an
> over constrained dependency.
>
> Thanks again.
>
> -----Original Message-----
> From: Michael McCallum [mailto:gholam@apache.org]
> Sent: Wednesday, January 09, 2008 2:40 PM
> To: Maven Users List
> Subject: Re: Dependency version range not working. "The artifact has
no
> valid ranges" is given when it certainly looks like it has a valid
> range.
>
> For some reason the over constrained exception is hidden try mvn
> dependency:resolve -X
>
> and look for the OverConstrainedException which means you have two non
> overlapping ranges for the same artifact in the resolution tree
>
> On Thu, 10 Jan 2008 08:14:05 Chris Andersen wrote:
> > 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.



-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Dependency version range not working. "The artifact has no valid ranges" is given when it certainly looks like it has a valid range.

Posted by Michael McCallum <gh...@apache.org>.
yes better message would be good

you might want to change your deps to [2.1,2.2-!) other wise if you someone 
deploys a 2.2-SNAPSHOT its calculated as < 2.2 and included in the range 
[2.1,2.2)
 
On Fri, 11 Jan 2008 06:40:16 Chris Andersen wrote:
> Thanks. Looks like I had another library that I was dependent on that
> still had a dependency on the 2.1 branch of the dba.library.
>
> This is actually a good thing as this kind of inconsistent dependency
> could have burned me in runtime. But it would have been nice if maven
> gave me a better error message explaining the problem. The error
> messages said I had "no valid ranges" when in fact I had valid ranges,
> they were just too many of them! It should explicitly say that it has an
> over constrained dependency.
>
> Thanks again.
>
> -----Original Message-----
> From: Michael McCallum [mailto:gholam@apache.org]
> Sent: Wednesday, January 09, 2008 2:40 PM
> To: Maven Users List
> Subject: Re: Dependency version range not working. "The artifact has no
> valid ranges" is given when it certainly looks like it has a valid
> range.
>
> For some reason the over constrained exception is hidden try mvn
> dependency:resolve -X
>
> and look for the OverConstrainedException which means you have two non
> overlapping ranges for the same artifact in the resolution tree
>
> On Thu, 10 Jan 2008 08:14:05 Chris Andersen wrote:
> > 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.



-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


RE: Dependency version range not working. "The artifact has no valid ranges" is given when it certainly looks like it has a valid range.

Posted by Chris Andersen <Ch...@metro1.com>.
Thanks. Looks like I had another library that I was dependent on that
still had a dependency on the 2.1 branch of the dba.library.

This is actually a good thing as this kind of inconsistent dependency
could have burned me in runtime. But it would have been nice if maven
gave me a better error message explaining the problem. The error
messages said I had "no valid ranges" when in fact I had valid ranges,
they were just too many of them! It should explicitly say that it has an
over constrained dependency.

Thanks again.

-----Original Message-----
From: Michael McCallum [mailto:gholam@apache.org] 
Sent: Wednesday, January 09, 2008 2:40 PM
To: Maven Users List
Subject: Re: Dependency version range not working. "The artifact has no
valid ranges" is given when it certainly looks like it has a valid
range.

For some reason the over constrained exception is hidden try mvn 
dependency:resolve -X

and look for the OverConstrainedException which means you have two non 
overlapping ranges for the same artifact in the resolution tree

On Thu, 10 Jan 2008 08:14:05 Chris Andersen wrote:
> 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.



-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Dependency version range not working. "The artifact has no valid ranges" is given when it certainly looks like it has a valid range.

Posted by Michael McCallum <gh...@apache.org>.
For some reason the over constrained exception is hidden try mvn 
dependency:resolve -X

and look for the OverConstrainedException which means you have two non 
overlapping ranges for the same artifact in the resolution tree

On Thu, 10 Jan 2008 08:14:05 Chris Andersen wrote:
> 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.



-- 
Michael McCallum
Enterprise Engineer
mailto:gholam@apache.org

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org