Re: Maven fails to resolve version range for import
I can recommend not using version ranges, because they break build reproducibility. If you use a specific version and a tool like Dependabot or Renovate to create pull requests for updates, you’ll have a reproducible build without having to keep an eye out for updates yourself. Nils. > Op 27 jul. 2022, om 13:44 heeft Jacques Etienne Beaudet > het volgende geschreven: > > Please see issue > https://issues.apache.org/jira/plugins/servlet/mobile#issue/MNG-4463 and will > be resolved in maven 4 if I'm not mistaken. > On Jul 27, 2022, 7:40 AM -0400, [Quipsy] Markus Karg , wrote: >> I think I found a bug in Maven, but I am not sure. Maybe I am doing >> something wrong, so Maven Committers, please judge the following case: >> >> A version range in a dependency like... >> >> >> org.glassfish.jersey.core >> jersey-server >> [2.0.0, 3.0.0) >> >> >> mvn dependency:tree >> >> ...results in a correctly resolved output... >> >> ... >> +- org.glassfish.jersey.core:jersey-server:jar:3.0.0-RC2:compile >> ... >> >> But when instead using the same version range IN AN IMPORTED BOM, then... >> >> >> >> org.glassfish.jersey >> jersey-bom >> [2.0.0, 3.0.0) >> pom >> import >> >> >> >> >> org.glassfish.jersey.core >> jersey-server >> >> >> mvn dependency:tree >> >> ...results in this error message as it was not resolved: >> >> downloading from xxx: >> http://xxx:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom >> >> Non-resolvable import POM: Could not find artifact >> org.glassfish.jersey:jersey-bom:pom:[2.0.0, 3.0.0) >> >> In fact, calling curl -i >> http://nexus:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom >> tells us that such a URL does not exist: HTTP/1.1 400 Invalid repository >> path. >> >> So am I doing or assuming something wrong here (e. g. possibly includes >> deliberately will not resolve version ranges) or is that simply a bug in >> Maven (which I should report in the issue tracker)? >> >> Thanks! >> -Markus - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Maven fails to resolve version range for import
ok From: [Quipsy] Markus Karg Sent: Wednesday, July 27, 2022 7:41 AM To: Maven Users List Subject: Maven fails to resolve version range for import I think I found a bug in Maven, but I am not sure. Maybe I am doing something wrong, so Maven Committers, please judge the following case: A version range in a dependency like... org.glassfish.jersey.core jersey-server [2.0.0, 3.0.0) mvn dependency:tree ...results in a correctly resolved output... ... +- org.glassfish.jersey.core:jersey-server:jar:3.0.0-RC2:compile ... But when instead using the same version range IN AN IMPORTED BOM, then... org.glassfish.jersey jersey-bom [2.0.0, 3.0.0) pom import org.glassfish.jersey.core jersey-server mvn dependency:tree ...results in this error message as it was not resolved: downloading from xxx: http://xxx:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom MG>which tree will only see if your repository has already been declared in parent pom MG>the beauty of the configuration for repository in parent-pom is visibility will not depend on a specific build profile Maven – Guide to using Multiple Repositories (apache.org)<https://maven.apache.org/guides/mini/guide-multiple-repositories.html> Maven – Guide to using Multiple Repositories<https://maven.apache.org/guides/mini/guide-multiple-repositories.html> In fact the -P option will take a CSV list of profiles to activate if you wish to activate multiple profiles simultaneously.. Note: The settings descriptor documentation can be found on the Maven Local Settings Model Website.. Repository Order. Remote repository URLs are queried in the following order for artifacts until one returns a valid result: ... maven.apache.org Non-resolvable import POM: Could not find artifact org.glassfish.jersey:jersey-bom:pom:[2.0.0, 3.0.0) In fact, calling curl -i http://nexus:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom tells us that such a URL does not exist: HTTP/1.1 400 Invalid repository path. So am I doing or assuming something wrong here (e. g. possibly includes deliberately will not resolve version ranges) or is that simply a bug in Maven (which I should report in the issue tracker)? MG>OTOH if you are setting up repo under a profile then you will need to activate the repo myprofile .. MG>then activate the profile containing the repository with MG>mvn -Pmyprofile Maven – Guide to using Multiple Repositories (apache.org)<https://maven.apache.org/guides/mini/guide-multiple-repositories.html> MG>nexus is particular about which nx-user can access what repo...have you tried to contact the creator of nexus repository to find out which user curl should use to resolve repository-path ? Users (sonatype.com)<https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/users> Users - Sonatype<https://help.sonatype.com/repomanager3/nexus-repository-administration/access-control/users> Figure: Creating or Editing a User. The ID can be defined upon initial creation and remains fixed thereafter. In addition you can specify the users First Name, Last Name and Email address.You also must enter and confirm a Password.. The Status allows you to set an account to be Disabled or Active.The Roles control allows you to add and remove defined roles to the user and therefore control the ... help.sonatype.com Maven – Guide to using Multiple Repositories<https://maven.apache.org/guides/mini/guide-multiple-repositories.html> In fact the -P option will take a CSV list of profiles to activate if you wish to activate multiple profiles simultaneously.. Note: The settings descriptor documentation can be found on the Maven Local Settings Model Website.. Repository Order. Remote repository URLs are queried in the following order for artifacts until one returns a valid result: ... maven.apache.org MG>IN CONCLUSION MG>if you are using correct nexus nx-user MG>AND you are not referencing a repository which is specific only to 1 build MG>then you have indeed found a bug with version range and should report bug with your full test-case ! Thanks! -Markus MG>gruss~
Re: Maven fails to resolve version range for import
Please see issue https://issues.apache.org/jira/plugins/servlet/mobile#issue/MNG-4463 and will be resolved in maven 4 if I'm not mistaken. On Jul 27, 2022, 7:40 AM -0400, [Quipsy] Markus Karg , wrote: > I think I found a bug in Maven, but I am not sure. Maybe I am doing something > wrong, so Maven Committers, please judge the following case: > > A version range in a dependency like... > > > org.glassfish.jersey.core > jersey-server > [2.0.0, 3.0.0) > > > mvn dependency:tree > > ...results in a correctly resolved output... > > ... > +- org.glassfish.jersey.core:jersey-server:jar:3.0.0-RC2:compile > ... > > But when instead using the same version range IN AN IMPORTED BOM, then... > > > > org.glassfish.jersey > jersey-bom > [2.0.0, 3.0.0) > pom > import > > > > > org.glassfish.jersey.core > jersey-server > > > mvn dependency:tree > > ...results in this error message as it was not resolved: > > downloading from xxx: > http://xxx:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom > > Non-resolvable import POM: Could not find artifact > org.glassfish.jersey:jersey-bom:pom:[2.0.0, 3.0.0) > > In fact, calling curl -i > http://nexus:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom > tells us that such a URL does not exist: HTTP/1.1 400 Invalid repository > path. > > So am I doing or assuming something wrong here (e. g. possibly includes > deliberately will not resolve version ranges) or is that simply a bug in > Maven (which I should report in the issue tracker)? > > Thanks! > -Markus
Maven fails to resolve version range for import
I think I found a bug in Maven, but I am not sure. Maybe I am doing something wrong, so Maven Committers, please judge the following case: A version range in a dependency like... org.glassfish.jersey.core jersey-server [2.0.0, 3.0.0) mvn dependency:tree ...results in a correctly resolved output... ... +- org.glassfish.jersey.core:jersey-server:jar:3.0.0-RC2:compile ... But when instead using the same version range IN AN IMPORTED BOM, then... org.glassfish.jersey jersey-bom [2.0.0, 3.0.0) pom import org.glassfish.jersey.core jersey-server mvn dependency:tree ...results in this error message as it was not resolved: downloading from xxx: http://xxx:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom Non-resolvable import POM: Could not find artifact org.glassfish.jersey:jersey-bom:pom:[2.0.0, 3.0.0) In fact, calling curl -i http://nexus:8081/content/groups/public/org/glassfish/jersey/jersey-bom/%5B2.0.0,%203.0.0)/jersey-bom-%5B2.0.0,%203.0.0).pom tells us that such a URL does not exist: HTTP/1.1 400 Invalid repository path. So am I doing or assuming something wrong here (e. g. possibly includes deliberately will not resolve version ranges) or is that simply a bug in Maven (which I should report in the issue tracker)? Thanks! -Markus