You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by "James Nord (JIRA)" <ji...@apache.org> on 2019/06/15 13:55:00 UTC

[jira] [Comment Edited] (MNG-6678) locked version range to a timestamped snapshot does not work

    [ https://issues.apache.org/jira/browse/MNG-6678?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16864691#comment-16864691 ] 

James Nord edited comment on MNG-6678 at 6/15/19 1:54 PM:
----------------------------------------------------------

> You cannot supply a snapshot with a timestamp 

Huh a SNAPSHOT is a version that ends with "-SNAPSHOT" or a timestamp "YYYYMMDD.HHMMSS-#" 

You can grab [https://github.com/jtnord/maven-test-project] and run "mvn deploy" and then you should see it in the logs as being deployed as something like "1.0.0-20190615.160423-1"   (you may want to change the deployment URL to a repo that will be consulted for resolution)

Take the version unique snapshot version (timestamp) and then use that in a range in another project
{noformat}
<dependencies>
  <dependency>
    <groupId>org.jenkins-ci.test</groupId>
    <artifactId>module-5</artifactId>
    <!-- change this to match what was just deployed -->
    <version>[0.0.1-20190615.160423-1]</version>
  </dependency>
</dependencies>

{noformat}
try and build that - and observe the failure

remove the range specifier so you are just using a version hint.
{noformat}
<dependencies>
  <dependency>
    <groupId>org.jenkins-ci.test</groupId>
    <artifactId>module-5</artifactId>
    <!-- change this to match what was just deployed -->
    <version>0.0.1-20190615.160423-1</version>
  </dependency>
</dependencies>
{noformat}
 

try and build that and observe that it works as expected.

 


was (Author: jnord_cbs):
> You cannot supply a snapshot with a timestamp 

Huh a SNAPSHOT is a version that ends with "-SNAPSHOT" or a timestamp "YYYYMMDD.HHMMSS-#" 

You can grab [https://github.com/jtnord/maven-test-project] and run "mvn deploy" and then you should see it in the logs as being deployed as something like "1.0.0-20190615.160423-1"   (you may want to change the deployment URL to a repo that will be consulted for resolution)

Take the version unique snapshot version (timestamp) and then use that in a range in another project


{noformat}
<dependencies>
  <dependency>
    <groupId>org.jenkins-ci.test</groupId>
    <artifactId>module-5</artifactId>
    <!-- change this to match what was just deployed -->
    <version>[0.0.1-20190615.160423-1]</version>
  </dependency>
</dependencies>

{noformat}
try and build that - and observe the failure

remove the range specifier so you are just using a version hint.
{noformat}
<dependencies>
  <dependency>
    <groupId>org.jenkins-ci.test</groupId>
    <artifactId>module-5</artifactId>
    <!-- change this to match what was just deployed -->
    <version>0.0.1-20190615.160423-1</version>
  </dependency>
</dependencies>
{noformat}
 

try and build that and observe that it works as expected.

 

> locked version range to a timestamped snapshot does not work
> ------------------------------------------------------------
>
>                 Key: MNG-6678
>                 URL: https://issues.apache.org/jira/browse/MNG-6678
>             Project: Maven
>          Issue Type: Bug
>          Components: Artifacts and Repositories
>    Affects Versions: 3.6.0
>            Reporter: James Nord
>            Priority: Major
>             Fix For: waiting-for-feedback
>
>
> I had built and deployed a snapshot to our internal repo mananger (nexus) and then attempted to force the use of that artifact in a downstream project by using an explicit version range for that artifact.
> However when I tried to do this maven complained the version range could not be satisfied.
> for example the snapshot deployed with timestamp {{2.176.1.3-20190613.140544-1}} and the range I tried to use was {{[2.176.1.3-20190613.140544-1]}} 
> in the {{maven-metadata.xml}} from the artifact root in the repo I see 2.176.1.3-SNAPSHOT is mentioned, and looking in the {{maven-metadata.xml}} for the 2.176.1.3-SNAPSHOT I do see it contains that in the list of {{snapshotVersions}}
> This appears to be to be a bug that the versionRange does not correctly identify a timestamped version as a SNAPSHOT and thus resolve the metadata for the snapshot correctly to see what versions of that SNAPSHOT are available.
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)