You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@archiva.apache.org by Per Arnold Blaasmo <Pe...@atmel.com> on 2012/03/13 12:40:58 UTC

Supporting ivy repo

Hi guys! I am still trying to get this Ivy repository support. Its been
on and of working with it, but...

I have some problem understand where in the code the choice of the
repository gets taken.
It seems to me that there is somewhat hard coded to choose the 'default'
(which is maven2) different places in the code.

I have added so that it is possible to configure the repository layout
to be configured to be 'ivy'.
So I though I should try to get it to show artifacts using the classes
in the new ivy plugin, but it always uses the classes/beans in the
maven2 plugin.
Any one care to hint me in the correct direction?

I tried to trace it from this stack trace:
     java.lang.IllegalArgumentException: Not a valid artifact path in a
Maven 2 repository, filename 'ivy-3.0.0.129.xml' doesn't start with
artifact ID 'avr8-utils'
    
org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator.getArtifactFromId(Maven2RepositoryPathTranslator.java:190)
    
org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.getArtifactFromFile(Maven2RepositoryStorage.java:586)
    
org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.readArtifactsMetadata(Maven2RepositoryStorage.java:566)
    
org.apache.archiva.metadata.repository.DefaultMetadataResolver.resolveArtifacts(DefaultMetadataResolver.java:367)
    
org.apache.archiva.web.action.ShowArtifactAction.getProjectVersionMetadata(ShowArtifactAction.java:197)
    
org.apache.archiva.web.action.ShowArtifactAction.handleArtifact(ShowArtifactAction.java:133)
    
org.apache.archiva.web.action.ShowArtifactAction.artifact(ShowArtifactAction.java:121)

>From this it seems to me that it makes a choice somewhere in
DefaultMetadataResolver.java
Or in 'ShowArtifact.jsp' i find:
<c:set var="mavenFacet"
value="${model.facets['org.apache.archiva.metadata.repository.storage.maven2.project']}"
/>
That seems to hardcode mave2 project. I am a little unsure of the facets
role in the big picture yet and how that possible controls the choice of
repository.

Also there seems to be some comments her  and there in different modules
about 'FIXME' to support different repos.

Have I just taken on a to big task here or?

Regards
Per A.

-- 
Per Arnold Blåsmo
Senior Design Engineer, Atmel Norway



Re: Supporting ivy repo

Posted by Per Arnold Blaasmo <pe...@atmel.com>.
On 14. mars 2012 09:00, Olivier Lamy wrote:
> 2012/3/13 Per Arnold Blaasmo <Pe...@atmel.com>:
>> Hi guys! I am still trying to get this Ivy repository support. Its been
>> on and of working with it, but...
>>
>> I have some problem understand where in the code the choice of the
>> repository gets taken.
>> It seems to me that there is somewhat hard coded to choose the 'default'
>> (which is maven2) different places in the code.
> some (all) of us come from the maven land :P

I come from the embedded land developing software tools for embedded
developers. Guess there is some distance to travel from embedded land to
maven land ;-)

>>
>> Have I just taken on a to big task here or?
> Yup you have taken a "medium" task here :-).
OK, I guess that is the hard way to learn something new :-)

> I wanted to work on that (a plugin mechanism) after I finish the ui
> rewrite. The goal will be to have an extension point (called it
> "repository type") where display repository content will use the
> plugin mechanism too.
OK, I look forward to that.
> But I agree it's not yet done  :-)
No, it's not :-) There seems to be the notion of plugins in Archiva, but
no plugin mechanism?

> I tend to say reusing the current classes/bean to display ivy repo
> content can be the good direction but you will have to extends/change
> some for ivy purpose.
Yes, that is what I have started with. The "Ivy Plugin" compiles and are
added to the finished artifact, but not called/used anywhere yet.

I am working on rewriting it to cope with ivy-specifics.

Per A.

Re: Supporting ivy repo

Posted by Olivier Lamy <ol...@apache.org>.
2012/3/13 Per Arnold Blaasmo <Pe...@atmel.com>:
> Hi guys! I am still trying to get this Ivy repository support. Its been
> on and of working with it, but...
>
> I have some problem understand where in the code the choice of the
> repository gets taken.
> It seems to me that there is somewhat hard coded to choose the 'default'
> (which is maven2) different places in the code.
some (all) of us come from the maven land :P
>
> I have added so that it is possible to configure the repository layout
> to be configured to be 'ivy'.
> So I though I should try to get it to show artifacts using the classes
> in the new ivy plugin, but it always uses the classes/beans in the
> maven2 plugin.
> Any one care to hint me in the correct direction?
>
> I tried to trace it from this stack trace:
>     java.lang.IllegalArgumentException: Not a valid artifact path in a
> Maven 2 repository, filename 'ivy-3.0.0.129.xml' doesn't start with
> artifact ID 'avr8-utils'
>
> org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryPathTranslator.getArtifactFromId(Maven2RepositoryPathTranslator.java:190)
>
> org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.getArtifactFromFile(Maven2RepositoryStorage.java:586)
>
> org.apache.archiva.metadata.repository.storage.maven2.Maven2RepositoryStorage.readArtifactsMetadata(Maven2RepositoryStorage.java:566)
>
> org.apache.archiva.metadata.repository.DefaultMetadataResolver.resolveArtifacts(DefaultMetadataResolver.java:367)
>
> org.apache.archiva.web.action.ShowArtifactAction.getProjectVersionMetadata(ShowArtifactAction.java:197)
>
> org.apache.archiva.web.action.ShowArtifactAction.handleArtifact(ShowArtifactAction.java:133)
>
> org.apache.archiva.web.action.ShowArtifactAction.artifact(ShowArtifactAction.java:121)
>
> From this it seems to me that it makes a choice somewhere in
> DefaultMetadataResolver.java
> Or in 'ShowArtifact.jsp' i find:
> <c:set var="mavenFacet"
> value="${model.facets['org.apache.archiva.metadata.repository.storage.maven2.project']}"
> />
> That seems to hardcode mave2 project. I am a little unsure of the facets
> role in the big picture yet and how that possible controls the choice of
> repository.
>
> Also there seems to be some comments her  and there in different modules
> about 'FIXME' to support different repos.
>
> Have I just taken on a to big task here or?
Yup you have taken a "medium" task here :-).
I wanted to work on that (a plugin mechanism) after I finish the ui
rewrite. The goal will be to have an extension point (called it
"repository type") where display repository content will use the
plugin mechanism too.
But I agree it's not yet done  :-)
I tend to say reusing the current classes/bean to display ivy repo
content can be the good direction but you will have to extends/change
some for ivy purpose.

>
> Regards
> Per A.
>
> --
> Per Arnold Blåsmo
> Senior Design Engineer, Atmel Norway
>
>



-- 
Olivier Lamy
Talend: http://coders.talend.com
http://twitter.com/olamy | http://linkedin.com/in/olamy