You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Stephen Connolly <st...@gmail.com> on 2009/04/22 18:49:48 UTC

Re: ArtifactMetadataSource.retrieveAvailableVersions and only repositories

Bump!

Brett, Jason, Benjamin, Brian, anyone?

-Stephen

2009/4/21 Stephen Connolly <st...@gmail.com>

> Came across this one while investigating
> http://jira.codehaus.org/browse/MVERSIONS-19
>
> This is a strange one...
>
> in versions-maven-plugin:
>
>
> http://mojo.codehaus.org/versions-maven-plugin/xref/org/codehaus/mojo/versions/api/DefaultVersionsHelper.html#186
>
> We ask the ArtifactMetadataSource to give us a list of available
> versions... that is this method:
>
>
> http://maven.apache.org/ref/current/xref/org/apache/maven/project/artifact/MavenMetadataSource.html#495
>
> This method creates a RepositoryMetadata object of type:
>
>
> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#31
>
> This metadata object is passed to the RepositoryMetadataManager:
>
>
> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#58
>
> Which asks the RepositoryMetadata object if it is a snapshot...
>
>
> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#69
>
> but our metadata object can never be a snapshot:
>
>
> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#81
>
> So the end result is that we never look in repositories which have releases
> disabled... not sure if this is a Maven bug or if we should be using a
> different method.
>
> i.e. if I have:
>
> <repository>
>   <id>my-snapshot-repository</id>
>   <name>My Snapshot Repository</name>
>   <url>http://my.repo/snapshot</url>
>   <releases>
>      <enabled>*false*</enabled>
>   </releases>
>    <snapshots>
>      <enabled>true</enabled>
>    </snapshots>
> </repository>
>
> then my-snapshot-repository will never be searched, but if I have
>
> <repository>
>   <id>my-snapshot-repository</id>
>   <name>My Snapshot Repository</name>
>   <url>http://my.repo/snapshot</url>
>   <releases>
>      <enabled>*true*</enabled>
>   </releases>
>    <snapshots>
>      <enabled>true</enabled>
>    </snapshots>
> </repository>
>
> then it will!
>
> Should I raise an issue against Maven or is this just a case of calling the
> wrong method.
>
>

Re: [mojo-dev] Re: ArtifactMetadataSource.retrieveAvailableVersions and only repositories

Posted by Stephen Connolly <st...@gmail.com>.
I fear that fixing this may require the addition of another method, rather
than tweaking the "return false;"...

of course that would be a change to the public API which is probably not
do-able before 3.x

which probably means i'm going to have to do a copy and paste in
versions-maven-plugin... but then I'm wondering what  the impacte of
resolving metadata from snapshot repositories would be on the local
repository...

-Stephen

2009/4/22 Stephen Connolly <st...@gmail.com>

> Do you want me to raise an issue....
>
> I'd write an integration test only I'm not sure if this is FAD or a bug
>
> -Stephen
>
> 2009/4/22 Brian Fox <br...@infinity.nu>
>
>  It definately sounds strange to me, but without debugging through that
>> code it's hard to say for sure.
>>
>>
>> Stephen Connolly wrote:
>>
>> Bump!
>>
>> Brett, Jason, Benjamin, Brian, anyone?
>>
>> -Stephen
>>
>> 2009/4/21 Stephen Connolly <st...@gmail.com>
>>
>>> Came across this one while investigating
>>> http://jira.codehaus.org/browse/MVERSIONS-19
>>>
>>> This is a strange one...
>>>
>>> in versions-maven-plugin:
>>>
>>>
>>> http://mojo.codehaus.org/versions-maven-plugin/xref/org/codehaus/mojo/versions/api/DefaultVersionsHelper.html#186
>>>
>>> We ask the ArtifactMetadataSource to give us a list of available
>>> versions... that is this method:
>>>
>>>
>>> http://maven.apache.org/ref/current/xref/org/apache/maven/project/artifact/MavenMetadataSource.html#495
>>>
>>> This method creates a RepositoryMetadata object of type:
>>>
>>>
>>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#31
>>>
>>> This metadata object is passed to the RepositoryMetadataManager:
>>>
>>>
>>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#58
>>>
>>> Which asks the RepositoryMetadata object if it is a snapshot...
>>>
>>>
>>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#69
>>>
>>> but our metadata object can never be a snapshot:
>>>
>>>
>>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#81
>>>
>>> So the end result is that we never look in repositories which have
>>> releases disabled... not sure if this is a Maven bug or if we should be
>>> using a different method.
>>>
>>> i.e. if I have:
>>>
>>> <repository>
>>>   <id>my-snapshot-repository</id>
>>>   <name>My Snapshot Repository</name>
>>>   <url>http://my.repo/snapshot</url>
>>>   <releases>
>>>      <enabled>*false*</enabled>
>>>   </releases>
>>>    <snapshots>
>>>      <enabled>true</enabled>
>>>    </snapshots>
>>> </repository>
>>>
>>> then my-snapshot-repository will never be searched, but if I have
>>>
>>> <repository>
>>>   <id>my-snapshot-repository</id>
>>>   <name>My Snapshot Repository</name>
>>>   <url>http://my.repo/snapshot</url>
>>>   <releases>
>>>      <enabled>*true*</enabled>
>>>   </releases>
>>>    <snapshots>
>>>      <enabled>true</enabled>
>>>    </snapshots>
>>> </repository>
>>>
>>> then it will!
>>>
>>> Should I raise an issue against Maven or is this just a case of calling
>>> the wrong method.
>>>
>>>
>>
>

Re: [mojo-dev] Re: ArtifactMetadataSource.retrieveAvailableVersions and only repositories

Posted by Stephen Connolly <st...@gmail.com>.
Do you want me to raise an issue....

I'd write an integration test only I'm not sure if this is FAD or a bug

-Stephen

2009/4/22 Brian Fox <br...@infinity.nu>

>  It definately sounds strange to me, but without debugging through that
> code it's hard to say for sure.
>
>
> Stephen Connolly wrote:
>
> Bump!
>
> Brett, Jason, Benjamin, Brian, anyone?
>
> -Stephen
>
> 2009/4/21 Stephen Connolly <st...@gmail.com>
>
>> Came across this one while investigating
>> http://jira.codehaus.org/browse/MVERSIONS-19
>>
>> This is a strange one...
>>
>> in versions-maven-plugin:
>>
>>
>> http://mojo.codehaus.org/versions-maven-plugin/xref/org/codehaus/mojo/versions/api/DefaultVersionsHelper.html#186
>>
>> We ask the ArtifactMetadataSource to give us a list of available
>> versions... that is this method:
>>
>>
>> http://maven.apache.org/ref/current/xref/org/apache/maven/project/artifact/MavenMetadataSource.html#495
>>
>> This method creates a RepositoryMetadata object of type:
>>
>>
>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#31
>>
>> This metadata object is passed to the RepositoryMetadataManager:
>>
>>
>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#58
>>
>> Which asks the RepositoryMetadata object if it is a snapshot...
>>
>>
>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#69
>>
>> but our metadata object can never be a snapshot:
>>
>>
>> http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#81
>>
>> So the end result is that we never look in repositories which have
>> releases disabled... not sure if this is a Maven bug or if we should be
>> using a different method.
>>
>> i.e. if I have:
>>
>> <repository>
>>   <id>my-snapshot-repository</id>
>>   <name>My Snapshot Repository</name>
>>   <url>http://my.repo/snapshot</url>
>>   <releases>
>>      <enabled>*false*</enabled>
>>   </releases>
>>    <snapshots>
>>      <enabled>true</enabled>
>>    </snapshots>
>> </repository>
>>
>> then my-snapshot-repository will never be searched, but if I have
>>
>> <repository>
>>   <id>my-snapshot-repository</id>
>>   <name>My Snapshot Repository</name>
>>   <url>http://my.repo/snapshot</url>
>>   <releases>
>>      <enabled>*true*</enabled>
>>   </releases>
>>    <snapshots>
>>      <enabled>true</enabled>
>>    </snapshots>
>> </repository>
>>
>> then it will!
>>
>> Should I raise an issue against Maven or is this just a case of calling
>> the wrong method.
>>
>>
>

Re: [mojo-dev] Re: ArtifactMetadataSource.retrieveAvailableVersions and only repositories

Posted by Brian Fox <br...@infinity.nu>.
It definately sounds strange to me, but without debugging through that 
code it's hard to say for sure.

Stephen Connolly wrote:
> Bump!
>
> Brett, Jason, Benjamin, Brian, anyone?
>
> -Stephen
>
> 2009/4/21 Stephen Connolly <stephen.alan.connolly@gmail.com 
> <ma...@gmail.com>>
>
>     Came across this one while investigating
>     http://jira.codehaus.org/browse/MVERSIONS-19
>
>     This is a strange one...
>
>     in versions-maven-plugin:
>
>     http://mojo.codehaus.org/versions-maven-plugin/xref/org/codehaus/mojo/versions/api/DefaultVersionsHelper.html#186
>
>     We ask the ArtifactMetadataSource to give us a list of available
>     versions... that is this method:
>
>     http://maven.apache.org/ref/current/xref/org/apache/maven/project/artifact/MavenMetadataSource.html#495
>
>     This method creates a RepositoryMetadata object of type:
>
>     http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#31
>
>     This metadata object is passed to the RepositoryMetadataManager:
>
>     http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#58
>
>     Which asks the RepositoryMetadata object if it is a snapshot...
>
>     http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/DefaultRepositoryMetadataManager.html#69
>
>     but our metadata object can never be a snapshot:
>
>     http://maven.apache.org/ref/current/xref/org/apache/maven/artifact/repository/metadata/ArtifactRepositoryMetadata.html#81
>
>     So the end result is that we never look in repositories which have
>     releases disabled... not sure if this is a Maven bug or if we
>     should be using a different method.
>
>     i.e. if I have:
>
>     <repository>
>       <id>my-snapshot-repository</id>
>       <name>My Snapshot Repository</name>
>       <url>http://my.repo/snapshot^ </url>
>       <releases>
>          <enabled>*false*</enabled>
>       </releases>
>        <snapshots>
>          <enabled>true</enabled>
>        </snapshots>
>     </repository>
>
>     then my-snapshot-repository will never be searched, but if I have
>
>     <repository>
>       <id>my-snapshot-repository</id>
>       <name>My Snapshot Repository</name>
>       <url>http://my.repo/snapshot^ </url>
>       <releases>
>          <enabled>*true*</enabled>
>       </releases>
>        <snapshots>
>          <enabled>true</enabled>
>        </snapshots>
>     </repository>
>
>     then it will!
>
>     Should I raise an issue against Maven or is this just a case of
>     calling the wrong method.
>
>