Search with several artifacts (same GAV, different type/extension)

classic Classic list List threaded Threaded
14 messages Options
Reply | Threaded
Open this post in threaded view
|

Search with several artifacts (same GAV, different type/extension)

Julien HENRY
Hi,

We have an issue while searching artifacts in Nexus UI. We have some Maven projects with several artifacts attached to the build and deployed to Nexus. The artifacts have different type (=extension) but no classifier.
For example for a project named projectA, we publish on Nexus:
  - projectA-X.Y.Z.pom
  - projectA-X.Y.Z.jar
  - projectA-X.Y.Z.csv
  - projectA-X.Y.Z.zip

When we wants to use one of these artifacts as dependency it works fine to declare for example:

<dependency>
  <groupId>xxx</groupId>
  <artifactId>projectA</artifactId>
  <version>X.Y.Z</version>
  <type>csv</type>
</dependency>


But when doing a search in Nexus (either by GAV or by keyword), only one artifact (in addition to pom) is displayed. Most of the time this is the csv, but sometimes it can be another type. I suppose this is because of the way indexing is done by lucene. My guess is that lucene will only index one artifact in addition to the pom.
Is this behavior intended? Is it possible to have all artifacts indexed and visible in search?

Regards,

Julien
Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák
Hi Julien,

This violates the repository layout... so in short: no help.

See exactly same issues:
http://jira.codehaus.org/browse/MINDEXER-19

In short, Maven Indexer with this layout is unable to find out which
one is the "main" artifact....
As per layout, a GAV might have one main and many "secondary"
artifacts (those with classifier).

Thanks,
~t~

On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]> wrote:

> Hi,
>
> We have an issue while searching artifacts in Nexus UI. We have some Maven
> projects with several artifacts attached to the build and deployed to Nexus.
> The artifacts have different type (=extension) but no classifier.
> For example for a project named projectA, we publish on Nexus:
>   - projectA-X.Y.Z.pom
>   - projectA-X.Y.Z.jar
>   - projectA-X.Y.Z.csv
>   - projectA-X.Y.Z.zip
> When we wants to use one of these artifacts as dependency it works fine to
> declare for example:
> <dependency>
>   <groupId>xxx</groupId>
>   <artifactId>projectA</artifactId>
>   <version>X.Y.Z</version>
>   <type>csv</type>
> </dependency>
>
> But when doing a search in Nexus (either by GAV or by keyword), only one
> artifact (in addition to pom) is displayed. Most of the time this is the
> csv, but sometimes it can be another type. I suppose this is because of the
> way indexing is done by lucene. My guess is that lucene will only index one
> artifact in addition to the pom.
> Is this behavior intended? Is it possible to have all artifacts indexed and
> visible in search?
>
> Regards,
>
> Julien
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Julien HENRY
Thanks Tamas,

We will try to fix our custom packaging type to add classifier to secondary artifacts.

Do you confirm that the extension of the main artifact can be different than packaging declared in pom?

Will the following layout be correctly indexed?


projectA-X.Y.Z.pom (with packaging=custom_jar)
projectA-X.Y.Z.jar (main artifact)
projectA-X.Y.Z-foo.csv
projectA-X.Y.Z-bundle.zip

Regards,

Julien

>________________________________
>De : Tamás Cservenák <[hidden email]>
>À : [hidden email]
>Envoyé le : Vendredi 14 Octobre 2011 14h53
>Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
>Hi Julien,
>
>This violates the repository layout... so in short: no help.
>
>See exactly same issues:
>http://jira.codehaus.org/browse/MINDEXER-19
>
>In short, Maven Indexer with this layout is unable to find out which
>one is the "main" artifact....
>As per layout, a GAV might have one main and many "secondary"
>artifacts (those with classifier).
>
>Thanks,
>~t~
>
>On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]> wrote:
>> Hi,
>>
>> We have an issue while searching artifacts in Nexus UI. We have some Maven
>> projects with several artifacts attached to the build and deployed to Nexus.
>> The artifacts have different type (=extension) but no classifier.
>> For example for a project named projectA, we publish on Nexus:
>>   - projectA-X.Y.Z.pom
>>   - projectA-X.Y.Z.jar
>>   - projectA-X.Y.Z.csv
>>   - projectA-X.Y.Z.zip
>> When we wants to use one of these artifacts as dependency it works fine to
>> declare for example:
>> <dependency>
>>   <groupId>xxx</groupId>
>>   <artifactId>projectA</artifactId>
>>   <version>X.Y.Z</version>
>>   <type>csv</type>
>> </dependency>
>>
>> But when doing a search in Nexus (either by GAV or by keyword), only one
>> artifact (in addition to pom) is displayed. Most of the time this is the
>> csv, but sometimes it can be another type. I suppose this is because of the
>> way indexing is done by lucene. My guess is that lucene will only index one
>> artifact in addition to the pom.
>> Is this behavior intended? Is it possible to have all artifacts indexed and
>> visible in search?
>>
>> Regards,
>>
>> Julien
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Julien HENRY
In reply to this post by Tamás Cservenák
Hi again,

I read carefully [1], and at the end you can see:

> So two projects with the same group ID and artifact ID, but different packaging are not valid together.

> However, two dependencies with
different types are. Therefore the common use case of having tlds with
the same group/artifact ID will work, eg:
> /taglibs/1.2.2/taglibs-1.2.2.pom
> /taglibs/1.2.2/taglibs-1.2.2.jar
> /taglibs/1.2.2/taglibs-1.2.2.tld
> /taglibs/1.2.2/taglibs-html-1.2.2.jar

So it seems to show that having several artifacts with no classifier but different types is a valid use case. Note that I don't understand the point of taglibs-html-1.2.2.jar (different artifactId ???)


WDYT?


Regards,

Julien


[1] http://docs.codehaus.org/display/MAVEN/Repository+Layout+-+Final



----- Mail original -----

> De : Tamás Cservenák <[hidden email]>
> À : [hidden email]
> Cc :
> Envoyé le : Vendredi 14 Octobre 2011 14h53
> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
> Hi Julien,
>
> This violates the repository layout... so in short: no help.
>
> See exactly same issues:
> http://jira.codehaus.org/browse/MINDEXER-19
>
> In short, Maven Indexer with this layout is unable to find out which
> one is the "main" artifact....
> As per layout, a GAV might have one main and many "secondary"
> artifacts (those with classifier).
>
> Thanks,
> ~t~
>
> On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]> wrote:
>>  Hi,
>>
>>  We have an issue while searching artifacts in Nexus UI. We have some Maven
>>  projects with several artifacts attached to the build and deployed to
> Nexus.
>>  The artifacts have different type (=extension) but no classifier.
>>  For example for a project named projectA, we publish on Nexus:
>>    - projectA-X.Y.Z.pom
>>    - projectA-X.Y.Z.jar
>>    - projectA-X.Y.Z.csv
>>    - projectA-X.Y.Z.zip
>>  When we wants to use one of these artifacts as dependency it works fine to
>>  declare for example:
>>  <dependency>
>>    <groupId>xxx</groupId>
>>    <artifactId>projectA</artifactId>
>>    <version>X.Y.Z</version>
>>    <type>csv</type>
>>  </dependency>
>>
>>  But when doing a search in Nexus (either by GAV or by keyword), only one
>>  artifact (in addition to pom) is displayed. Most of the time this is the
>>  csv, but sometimes it can be another type. I suppose this is because of the
>>  way indexing is done by lucene. My guess is that lucene will only index one
>>  artifact in addition to the pom.
>>  Is this behavior intended? Is it possible to have all artifacts indexed and
>>  visible in search?
>>
>>  Regards,
>>
>>  Julien
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák
Well, this needs a bit longer explanation.

While the "having several artifacts with no classifier but different
types" use case is valid from _maven_ side, it is a bit harder on
indexer side (this is true to standalone indexer CLI but also the one
embedded into Nexus). Let me explain:

It's about custom packaging. Without maven build as "context" (this is
what Indexer does, just inspects the POM and other files it founds),
it is hard to deduce what the _extension_ is based on packaging set in
the POM.

Typical example is "nexus-plugin" packaging, a custom packaging for
developing plugins that actually produces a JAR as main artifact. And
while scanning, you have two routes to find a "pair" (POM+Artifact),
the POM->MainArtifact and the MainArtifact->POM way.

To go the POM->MainArtifact route, one would need to perform following steps:

1) locate POM, is easy (has no classifier and extension is ".pom")
2) parse POM, get the packaging from it, is easy
3) deduce the extension that given packaging produces, heh
4) locate the main artifact file, by stripping the ".pom" part from
POM file name and adding the packaging extension

So as you see, step 3 is impossible without having Maven specific
parts, that you don't know. Maven does know about packaging because if
you are using a custom packaging in your build, you are also
registering the extension in build (this or some parent POM). But
Indexer has no means to perform these calculations. Indexer cannot
fetch all the plugins providing build extensions to get the packaging
from there... (other problems: build extensions might not provide
packaging, meaning, it's not even simple from which plugin in your POM
the build extension comes if you have multiple of those set). Proper
solution would be then to find the extension defined in _effective_
POM of the current artifact being indexed, getting the ArtifactHandler
from it, etc.... would be involved but also slow to implement
(multiple downloads would be needed in case of a proxy repository, or
in case of hosted one, you again, don't have the context... the POM
might be a "product", while tooling of yours are in completely
different repo, etc).

So, to ease the problem, Indexer actually does the MainArtifact->POM route:

0) assume there is only one "main artifact" (the one without classifier)
1) pick a file in version directory that does not have classifier,
assume it's the main artifact
2) locate the POM for it, by stripping the whatever extension it has
and adding the ".pom" extension.

And this is what does not work in your case.

So, in short: custom packaging can be introduced by anyone, and is
used a lot out there. Indexer in contrary, does not know about those
custom packagings, nor to what extensions they "map" to.

So, there IS a band aid for this, but is not USED in scanning part,
since it would require users to manually maintain a "registry" of
packaging2extension mapping...

So it was "which finger to bite"... and as we realized, your use case
is rare, rarer then the use of custom packaging.... So far two users
reported this a problem, you are 2nd ;)

Thanks,
~t~


On Fri, Oct 14, 2011 at 3:25 PM, Julien HENRY <[hidden email]> wrote:

> Hi again,
>
> I read carefully [1], and at the end you can see:
>
>> So two projects with the same group ID and artifact ID, but different packaging are not valid together.
>
>> However, two dependencies with
> different types are. Therefore the common use case of having tlds with
> the same group/artifact ID will work, eg:
>> /taglibs/1.2.2/taglibs-1.2.2.pom
>> /taglibs/1.2.2/taglibs-1.2.2.jar
>> /taglibs/1.2.2/taglibs-1.2.2.tld
>> /taglibs/1.2.2/taglibs-html-1.2.2.jar
>
> So it seems to show that having several artifacts with no classifier but different types is a valid use case. Note that I don't understand the point of taglibs-html-1.2.2.jar (different artifactId ???)
>
>
> WDYT?
>
>
> Regards,
>
> Julien
>
>
> [1] http://docs.codehaus.org/display/MAVEN/Repository+Layout+-+Final
>
>
>
> ----- Mail original -----
>> De : Tamás Cservenák <[hidden email]>
>> À : [hidden email]
>> Cc :
>> Envoyé le : Vendredi 14 Octobre 2011 14h53
>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>
>> Hi Julien,
>>
>> This violates the repository layout... so in short: no help.
>>
>> See exactly same issues:
>> http://jira.codehaus.org/browse/MINDEXER-19
>>
>> In short, Maven Indexer with this layout is unable to find out which
>> one is the "main" artifact....
>> As per layout, a GAV might have one main and many "secondary"
>> artifacts (those with classifier).
>>
>> Thanks,
>> ~t~
>>
>> On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]> wrote:
>>>  Hi,
>>>
>>>  We have an issue while searching artifacts in Nexus UI. We have some Maven
>>>  projects with several artifacts attached to the build and deployed to
>> Nexus.
>>>  The artifacts have different type (=extension) but no classifier.
>>>  For example for a project named projectA, we publish on Nexus:
>>>    - projectA-X.Y.Z.pom
>>>    - projectA-X.Y.Z.jar
>>>    - projectA-X.Y.Z.csv
>>>    - projectA-X.Y.Z.zip
>>>  When we wants to use one of these artifacts as dependency it works fine to
>>>  declare for example:
>>>  <dependency>
>>>    <groupId>xxx</groupId>
>>>    <artifactId>projectA</artifactId>
>>>    <version>X.Y.Z</version>
>>>    <type>csv</type>
>>>  </dependency>
>>>
>>>  But when doing a search in Nexus (either by GAV or by keyword), only one
>>>  artifact (in addition to pom) is displayed. Most of the time this is the
>>>  csv, but sometimes it can be another type. I suppose this is because of the
>>>  way indexing is done by lucene. My guess is that lucene will only index one
>>>  artifact in addition to the pom.
>>>  Is this behavior intended? Is it possible to have all artifacts indexed and
>>>  visible in search?
>>>
>>>  Regards,
>>>
>>>  Julien
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Julien HENRY
In reply to this post by Julien HENRY
Answering to myself: no. I have manually added classifier to secondary artifacts to have the following in my Nexus repo:
> projectA-X.Y.Z.pom (with packaging=custom_jar)
> projectA-X.Y.Z.jar (main artifact)
> projectA-X.Y.Z-foo.csv
> projectA-X.Y.Z-bundle.zip

I have updated the index then doing a GAV search on projectA returns 4 results:
pom, csv, foo.csv, bundle.zip

I can't see the jar, and I have instead an invalid csv...

What's wrong?

Regards,

Julien


----- Mail original -----

> De : Julien HENRY <[hidden email]>
> À : "[hidden email]" <[hidden email]>
> Cc :
> Envoyé le : Vendredi 14 Octobre 2011 15h13
> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
>T hanks Tamas,
>
> We will try to fix our custom packaging type to add classifier to secondary
> artifacts.
>
> Do you confirm that the extension of the main artifact can be different than
> packaging declared in pom?
>
> Will the following layout be correctly indexed?
>
>
> projectA-X.Y.Z.pom (with packaging=custom_jar)
> projectA-X.Y.Z.jar (main artifact)
> projectA-X.Y.Z-foo.csv
> projectA-X.Y.Z-bundle.zip
>
> Regards,
>
> Julien
>
>> ________________________________
>> De : Tamás Cservenák <[hidden email]>
>> À : [hidden email]
>> Envoyé le : Vendredi 14 Octobre 2011 14h53
>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different
> type/extension)
>>
>> Hi Julien,
>>
>> This violates the repository layout... so in short: no help.
>>
>> See exactly same issues:
>> http://jira.codehaus.org/browse/MINDEXER-19
>>
>> In short, Maven Indexer with this layout is unable to find out which
>> one is the "main" artifact....
>> As per layout, a GAV might have one main and many "secondary"
>> artifacts (those with classifier).
>>
>> Thanks,
>> ~t~
>>
>> On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]>
> wrote:
>>>  Hi,
>>>
>>>  We have an issue while searching artifacts in Nexus UI. We have some
> Maven
>>>  projects with several artifacts attached to the build and deployed to
> Nexus.
>>>  The artifacts have different type (=extension) but no classifier.
>>>  For example for a project named projectA, we publish on Nexus:
>>>    - projectA-X.Y.Z.pom
>>>    - projectA-X.Y.Z.jar
>>>    - projectA-X.Y.Z.csv
>>>    - projectA-X.Y.Z.zip
>>>  When we wants to use one of these artifacts as dependency it works fine
> to
>>>  declare for example:
>>>  <dependency>
>>>    <groupId>xxx</groupId>
>>>    <artifactId>projectA</artifactId>
>>>    <version>X.Y.Z</version>
>>>    <type>csv</type>
>>>  </dependency>
>>>
>>>  But when doing a search in Nexus (either by GAV or by keyword), only
> one
>>>  artifact (in addition to pom) is displayed. Most of the time this is
> the
>>>  csv, but sometimes it can be another type. I suppose this is because of
> the
>>>  way indexing is done by lucene. My guess is that lucene will only index
> one
>>>  artifact in addition to the pom.
>>>  Is this behavior intended? Is it possible to have all artifacts indexed
> and
>>>  visible in search?
>>>
>>>  Regards,
>>>
>>>  Julien
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák
In reply to this post by Tamás Cservenák
Forgot to tell about the "band aid":
http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-artifact/src/main/java/org/apache/maven/index/artifact/DefaultArtifactPackagingMapper.java?view=markup

So, this is a "registry" of packaging to extension mapping, and as is
is used in Nexus too. To "register" custom packagings, you need to
create a "packaging2extension-mapping.properties" file in /conf
directory of Nexus and just have lines like

nexus-plugin=jar
foo=zip
etc

2011/10/14 Tamás Cservenák <[hidden email]>:

> Well, this needs a bit longer explanation.
>
> While the "having several artifacts with no classifier but different
> types" use case is valid from _maven_ side, it is a bit harder on
> indexer side (this is true to standalone indexer CLI but also the one
> embedded into Nexus). Let me explain:
>
> It's about custom packaging. Without maven build as "context" (this is
> what Indexer does, just inspects the POM and other files it founds),
> it is hard to deduce what the _extension_ is based on packaging set in
> the POM.
>
> Typical example is "nexus-plugin" packaging, a custom packaging for
> developing plugins that actually produces a JAR as main artifact. And
> while scanning, you have two routes to find a "pair" (POM+Artifact),
> the POM->MainArtifact and the MainArtifact->POM way.
>
> To go the POM->MainArtifact route, one would need to perform following steps:
>
> 1) locate POM, is easy (has no classifier and extension is ".pom")
> 2) parse POM, get the packaging from it, is easy
> 3) deduce the extension that given packaging produces, heh
> 4) locate the main artifact file, by stripping the ".pom" part from
> POM file name and adding the packaging extension
>
> So as you see, step 3 is impossible without having Maven specific
> parts, that you don't know. Maven does know about packaging because if
> you are using a custom packaging in your build, you are also
> registering the extension in build (this or some parent POM). But
> Indexer has no means to perform these calculations. Indexer cannot
> fetch all the plugins providing build extensions to get the packaging
> from there... (other problems: build extensions might not provide
> packaging, meaning, it's not even simple from which plugin in your POM
> the build extension comes if you have multiple of those set). Proper
> solution would be then to find the extension defined in _effective_
> POM of the current artifact being indexed, getting the ArtifactHandler
> from it, etc.... would be involved but also slow to implement
> (multiple downloads would be needed in case of a proxy repository, or
> in case of hosted one, you again, don't have the context... the POM
> might be a "product", while tooling of yours are in completely
> different repo, etc).
>
> So, to ease the problem, Indexer actually does the MainArtifact->POM route:
>
> 0) assume there is only one "main artifact" (the one without classifier)
> 1) pick a file in version directory that does not have classifier,
> assume it's the main artifact
> 2) locate the POM for it, by stripping the whatever extension it has
> and adding the ".pom" extension.
>
> And this is what does not work in your case.
>
> So, in short: custom packaging can be introduced by anyone, and is
> used a lot out there. Indexer in contrary, does not know about those
> custom packagings, nor to what extensions they "map" to.
>
> So, there IS a band aid for this, but is not USED in scanning part,
> since it would require users to manually maintain a "registry" of
> packaging2extension mapping...
>
> So it was "which finger to bite"... and as we realized, your use case
> is rare, rarer then the use of custom packaging.... So far two users
> reported this a problem, you are 2nd ;)
>
> Thanks,
> ~t~
>
>
> On Fri, Oct 14, 2011 at 3:25 PM, Julien HENRY <[hidden email]> wrote:
>> Hi again,
>>
>> I read carefully [1], and at the end you can see:
>>
>>> So two projects with the same group ID and artifact ID, but different packaging are not valid together.
>>
>>> However, two dependencies with
>> different types are. Therefore the common use case of having tlds with
>> the same group/artifact ID will work, eg:
>>> /taglibs/1.2.2/taglibs-1.2.2.pom
>>> /taglibs/1.2.2/taglibs-1.2.2.jar
>>> /taglibs/1.2.2/taglibs-1.2.2.tld
>>> /taglibs/1.2.2/taglibs-html-1.2.2.jar
>>
>> So it seems to show that having several artifacts with no classifier but different types is a valid use case. Note that I don't understand the point of taglibs-html-1.2.2.jar (different artifactId ???)
>>
>>
>> WDYT?
>>
>>
>> Regards,
>>
>> Julien
>>
>>
>> [1] http://docs.codehaus.org/display/MAVEN/Repository+Layout+-+Final
>>
>>
>>
>> ----- Mail original -----
>>> De : Tamás Cservenák <[hidden email]>
>>> À : [hidden email]
>>> Cc :
>>> Envoyé le : Vendredi 14 Octobre 2011 14h53
>>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>>
>>> Hi Julien,
>>>
>>> This violates the repository layout... so in short: no help.
>>>
>>> See exactly same issues:
>>> http://jira.codehaus.org/browse/MINDEXER-19
>>>
>>> In short, Maven Indexer with this layout is unable to find out which
>>> one is the "main" artifact....
>>> As per layout, a GAV might have one main and many "secondary"
>>> artifacts (those with classifier).
>>>
>>> Thanks,
>>> ~t~
>>>
>>> On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]> wrote:
>>>>  Hi,
>>>>
>>>>  We have an issue while searching artifacts in Nexus UI. We have some Maven
>>>>  projects with several artifacts attached to the build and deployed to
>>> Nexus.
>>>>  The artifacts have different type (=extension) but no classifier.
>>>>  For example for a project named projectA, we publish on Nexus:
>>>>    - projectA-X.Y.Z.pom
>>>>    - projectA-X.Y.Z.jar
>>>>    - projectA-X.Y.Z.csv
>>>>    - projectA-X.Y.Z.zip
>>>>  When we wants to use one of these artifacts as dependency it works fine to
>>>>  declare for example:
>>>>  <dependency>
>>>>    <groupId>xxx</groupId>
>>>>    <artifactId>projectA</artifactId>
>>>>    <version>X.Y.Z</version>
>>>>    <type>csv</type>
>>>>  </dependency>
>>>>
>>>>  But when doing a search in Nexus (either by GAV or by keyword), only one
>>>>  artifact (in addition to pom) is displayed. Most of the time this is the
>>>>  csv, but sometimes it can be another type. I suppose this is because of the
>>>>  way indexing is done by lucene. My guess is that lucene will only index one
>>>>  artifact in addition to the pom.
>>>>  Is this behavior intended? Is it possible to have all artifacts indexed and
>>>>  visible in search?
>>>>
>>>>  Regards,
>>>>
>>>>  Julien
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák
In reply to this post by Julien HENRY
add following line to band aid:
custom_jar = jar

and _repair_ indexes, not just update.


Thanks,
~t~

On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]> wrote:

> Answering to myself: no. I have manually added classifier to secondary artifacts to have the following in my Nexus repo:
>> projectA-X.Y.Z.pom (with packaging=custom_jar)
>> projectA-X.Y.Z.jar (main artifact)
>> projectA-X.Y.Z-foo.csv
>> projectA-X.Y.Z-bundle.zip
>
> I have updated the index then doing a GAV search on projectA returns 4 results:
> pom, csv, foo.csv, bundle.zip
>
> I can't see the jar, and I have instead an invalid csv...
>
> What's wrong?
>
> Regards,
>
> Julien
>
>
> ----- Mail original -----
>> De : Julien HENRY <[hidden email]>
>> À : "[hidden email]" <[hidden email]>
>> Cc :
>> Envoyé le : Vendredi 14 Octobre 2011 15h13
>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>
>>T hanks Tamas,
>>
>> We will try to fix our custom packaging type to add classifier to secondary
>> artifacts.
>>
>> Do you confirm that the extension of the main artifact can be different than
>> packaging declared in pom?
>>
>> Will the following layout be correctly indexed?
>>
>>
>> projectA-X.Y.Z.pom (with packaging=custom_jar)
>> projectA-X.Y.Z.jar (main artifact)
>> projectA-X.Y.Z-foo.csv
>> projectA-X.Y.Z-bundle.zip
>>
>> Regards,
>>
>> Julien
>>
>>> ________________________________
>>> De : Tamás Cservenák <[hidden email]>
>>> À : [hidden email]
>>> Envoyé le : Vendredi 14 Octobre 2011 14h53
>>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different
>> type/extension)
>>>
>>> Hi Julien,
>>>
>>> This violates the repository layout... so in short: no help.
>>>
>>> See exactly same issues:
>>> http://jira.codehaus.org/browse/MINDEXER-19
>>>
>>> In short, Maven Indexer with this layout is unable to find out which
>>> one is the "main" artifact....
>>> As per layout, a GAV might have one main and many "secondary"
>>> artifacts (those with classifier).
>>>
>>> Thanks,
>>> ~t~
>>>
>>> On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY <[hidden email]>
>> wrote:
>>>>  Hi,
>>>>
>>>>  We have an issue while searching artifacts in Nexus UI. We have some
>> Maven
>>>>  projects with several artifacts attached to the build and deployed to
>> Nexus.
>>>>  The artifacts have different type (=extension) but no classifier.
>>>>  For example for a project named projectA, we publish on Nexus:
>>>>    - projectA-X.Y.Z.pom
>>>>    - projectA-X.Y.Z.jar
>>>>    - projectA-X.Y.Z.csv
>>>>    - projectA-X.Y.Z.zip
>>>>  When we wants to use one of these artifacts as dependency it works fine
>> to
>>>>  declare for example:
>>>>  <dependency>
>>>>    <groupId>xxx</groupId>
>>>>    <artifactId>projectA</artifactId>
>>>>    <version>X.Y.Z</version>
>>>>    <type>csv</type>
>>>>  </dependency>
>>>>
>>>>  But when doing a search in Nexus (either by GAV or by keyword), only
>> one
>>>>  artifact (in addition to pom) is displayed. Most of the time this is
>> the
>>>>  csv, but sometimes it can be another type. I suppose this is because of
>> the
>>>>  way indexing is done by lucene. My guess is that lucene will only index
>> one
>>>>  artifact in addition to the pom.
>>>>  Is this behavior intended? Is it possible to have all artifacts indexed
>> and
>>>>  visible in search?
>>>>
>>>>  Regards,
>>>>
>>>>  Julien
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>>
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Julien HENRY
Many thanks Tamas,

I did as you suggested (packaging2extension-mapping.properties and repair index). It is nearly perfect.


Going back to the case when I have several artifact with no classifier.
>  projectA-X.Y.Z.pom (with packaging=custom_jar)
>  projectA-X.Y.Z.jar (main artifact)
>  projectA-X.Y.Z.csv
>  projectA-X.Y.Z.zip

Previously only csv was indexed. Now thanks to the mapping it is the jar (which is better since this is the main artifact).

I understand your point about the issue with POM -> MainArtifact. So I also understand why you do MainArtifact -> POM (with the need of the mapping hint when there are several candidates for main artifact). What I don't understand is why you don't index other candidate after you have indexed POM and MainArtifact?

Could be MainArtifact -> POM -> Other artifacts (with or without classifier)?

In this case the search would return all artifacts (pom, jar, csv, zip).


I don't know what part of the code is involved but since you are already indexing secondary artifacts with classifier, why not also index artifacts without classifier (minus MainArtifact that was already indexed). Am I missing something?

Regards,

Julien



----- Mail original -----

> De : Tamás Cservenák <[hidden email]>
> À : [hidden email]
> Cc :
> Envoyé le : Vendredi 14 Octobre 2011 15h58
> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
> add following line to band aid:
> custom_jar = jar
>
> and _repair_ indexes, not just update.
>
>
> Thanks,
> ~t~
>
> On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]> wrote:
>>  Answering to myself: no. I have manually added classifier to secondary
> artifacts to have the following in my Nexus repo:
>>>  projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>  projectA-X.Y.Z.jar (main artifact)
>>>  projectA-X.Y.Z-foo.csv
>>>  projectA-X.Y.Z-bundle.zip
>>
>>  I have updated the index then doing a GAV search on projectA returns 4
> results:
>>  pom, csv, foo.csv, bundle.zip
>>
>>  I can't see the jar, and I have instead an invalid csv...
>>
>>  What's wrong?
>>
>>  Regards,
>>
>>  Julien
>>
>>
>>  ----- Mail original -----
>>>  De : Julien HENRY <[hidden email]>
>>>  À : "[hidden email]" <[hidden email]>
>>>  Cc :
>>>  Envoyé le : Vendredi 14 Octobre 2011 15h13
>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
> different type/extension)
>>>
>>> T hanks Tamas,
>>>
>>>  We will try to fix our custom packaging type to add classifier to
> secondary
>>>  artifacts.
>>>
>>>  Do you confirm that the extension of the main artifact can be different
> than
>>>  packaging declared in pom?
>>>
>>>  Will the following layout be correctly indexed?
>>>
>>>
>>>  projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>  projectA-X.Y.Z.jar (main artifact)
>>>  projectA-X.Y.Z-foo.csv
>>>  projectA-X.Y.Z-bundle.zip
>>>
>>>  Regards,
>>>
>>>  Julien
>>>
>>>>  ________________________________
>>>>  De : Tamás Cservenák <[hidden email]>
>>>>  À : [hidden email]
>>>>  Envoyé le : Vendredi 14 Octobre 2011 14h53
>>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
> different
>>>  type/extension)
>>>>
>>>>  Hi Julien,
>>>>
>>>>  This violates the repository layout... so in short: no help.
>>>>
>>>>  See exactly same issues:
>>>>  http://jira.codehaus.org/browse/MINDEXER-19
>>>>
>>>>  In short, Maven Indexer with this layout is unable to find out
> which
>>>>  one is the "main" artifact....
>>>>  As per layout, a GAV might have one main and many
> "secondary"
>>>>  artifacts (those with classifier).
>>>>
>>>>  Thanks,
>>>>  ~t~
>>>>
>>>>  On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY
> <[hidden email]>
>>>  wrote:
>>>>>   Hi,
>>>>>
>>>>>   We have an issue while searching artifacts in Nexus UI. We
> have some
>>>  Maven
>>>>>   projects with several artifacts attached to the build and
> deployed to
>>>  Nexus.
>>>>>   The artifacts have different type (=extension) but no
> classifier.
>>>>>   For example for a project named projectA, we publish on Nexus:
>>>>>     - projectA-X.Y.Z.pom
>>>>>     - projectA-X.Y.Z.jar
>>>>>     - projectA-X.Y.Z.csv
>>>>>     - projectA-X.Y.Z.zip
>>>>>   When we wants to use one of these artifacts as dependency it
> works fine
>>>  to
>>>>>   declare for example:
>>>>>   <dependency>
>>>>>     <groupId>xxx</groupId>
>>>>>     <artifactId>projectA</artifactId>
>>>>>     <version>X.Y.Z</version>
>>>>>     <type>csv</type>
>>>>>   </dependency>
>>>>>
>>>>>   But when doing a search in Nexus (either by GAV or by
> keyword), only
>>>  one
>>>>>   artifact (in addition to pom) is displayed. Most of the time
> this is
>>>  the
>>>>>   csv, but sometimes it can be another type. I suppose this is
> because of
>>>  the
>>>>>   way indexing is done by lucene. My guess is that lucene will
> only index
>>>  one
>>>>>   artifact in addition to the pom.
>>>>>   Is this behavior intended? Is it possible to have all
> artifacts indexed
>>>  and
>>>>>   visible in search?
>>>>>
>>>>>   Regards,
>>>>>
>>>>>   Julien
>>>>>
>>>>
>>>>
> ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: [hidden email]
>>>>  For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>>
>>>>
>>>
>>>  ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: [hidden email]
>>>  For additional commands, e-mail: [hidden email]
>>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: [hidden email]
>>  For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák
That's another shortcoming how Lucene Documents are organized in Maven Indexer.

Index is GAV based (and using "baseVersion" for V).

Every "main" artifact (GAV + C being empty/null) is one record.
Every "secondary" artifact (GAVC) is one record.

and _uniqueness_ is enforced.

Simply put, Indexer has the "logical" view on repository, is GAV based
and not path based. Meaning, the count of records on index does NOT
match the count of files being indexed.

This could be "cured" by having extending the Key to GAVT (T=type),
but again, Indexer does not KNOW the type (type != extension) of the
artifact.

http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java?view=markup


Thanks
~t~

On Fri, Oct 14, 2011 at 4:38 PM, Julien HENRY <[hidden email]> wrote:

> Many thanks Tamas,
>
> I did as you suggested (packaging2extension-mapping.properties and repair index). It is nearly perfect.
>
>
> Going back to the case when I have several artifact with no classifier.
>>  projectA-X.Y.Z.pom (with packaging=custom_jar)
>>  projectA-X.Y.Z.jar (main artifact)
>>  projectA-X.Y.Z.csv
>>  projectA-X.Y.Z.zip
>
> Previously only csv was indexed. Now thanks to the mapping it is the jar (which is better since this is the main artifact).
>
> I understand your point about the issue with POM -> MainArtifact. So I also understand why you do MainArtifact -> POM (with the need of the mapping hint when there are several candidates for main artifact). What I don't understand is why you don't index other candidate after you have indexed POM and MainArtifact?
>
> Could be MainArtifact -> POM -> Other artifacts (with or without classifier)?
>
> In this case the search would return all artifacts (pom, jar, csv, zip).
>
>
> I don't know what part of the code is involved but since you are already indexing secondary artifacts with classifier, why not also index artifacts without classifier (minus MainArtifact that was already indexed). Am I missing something?
>
> Regards,
>
> Julien
>
>
>
> ----- Mail original -----
>> De : Tamás Cservenák <[hidden email]>
>> À : [hidden email]
>> Cc :
>> Envoyé le : Vendredi 14 Octobre 2011 15h58
>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>
>> add following line to band aid:
>> custom_jar = jar
>>
>> and _repair_ indexes, not just update.
>>
>>
>> Thanks,
>> ~t~
>>
>> On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]> wrote:
>>>  Answering to myself: no. I have manually added classifier to secondary
>> artifacts to have the following in my Nexus repo:
>>>>  projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>  projectA-X.Y.Z.jar (main artifact)
>>>>  projectA-X.Y.Z-foo.csv
>>>>  projectA-X.Y.Z-bundle.zip
>>>
>>>  I have updated the index then doing a GAV search on projectA returns 4
>> results:
>>>  pom, csv, foo.csv, bundle.zip
>>>
>>>  I can't see the jar, and I have instead an invalid csv...
>>>
>>>  What's wrong?
>>>
>>>  Regards,
>>>
>>>  Julien
>>>
>>>
>>>  ----- Mail original -----
>>>>  De : Julien HENRY <[hidden email]>
>>>>  À : "[hidden email]" <[hidden email]>
>>>>  Cc :
>>>>  Envoyé le : Vendredi 14 Octobre 2011 15h13
>>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
>> different type/extension)
>>>>
>>>> T hanks Tamas,
>>>>
>>>>  We will try to fix our custom packaging type to add classifier to
>> secondary
>>>>  artifacts.
>>>>
>>>>  Do you confirm that the extension of the main artifact can be different
>> than
>>>>  packaging declared in pom?
>>>>
>>>>  Will the following layout be correctly indexed?
>>>>
>>>>
>>>>  projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>  projectA-X.Y.Z.jar (main artifact)
>>>>  projectA-X.Y.Z-foo.csv
>>>>  projectA-X.Y.Z-bundle.zip
>>>>
>>>>  Regards,
>>>>
>>>>  Julien
>>>>
>>>>>  ________________________________
>>>>>  De : Tamás Cservenák <[hidden email]>
>>>>>  À : [hidden email]
>>>>>  Envoyé le : Vendredi 14 Octobre 2011 14h53
>>>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
>> different
>>>>  type/extension)
>>>>>
>>>>>  Hi Julien,
>>>>>
>>>>>  This violates the repository layout... so in short: no help.
>>>>>
>>>>>  See exactly same issues:
>>>>>  http://jira.codehaus.org/browse/MINDEXER-19
>>>>>
>>>>>  In short, Maven Indexer with this layout is unable to find out
>> which
>>>>>  one is the "main" artifact....
>>>>>  As per layout, a GAV might have one main and many
>> "secondary"
>>>>>  artifacts (those with classifier).
>>>>>
>>>>>  Thanks,
>>>>>  ~t~
>>>>>
>>>>>  On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY
>> <[hidden email]>
>>>>  wrote:
>>>>>>   Hi,
>>>>>>
>>>>>>   We have an issue while searching artifacts in Nexus UI. We
>> have some
>>>>  Maven
>>>>>>   projects with several artifacts attached to the build and
>> deployed to
>>>>  Nexus.
>>>>>>   The artifacts have different type (=extension) but no
>> classifier.
>>>>>>   For example for a project named projectA, we publish on Nexus:
>>>>>>     - projectA-X.Y.Z.pom
>>>>>>     - projectA-X.Y.Z.jar
>>>>>>     - projectA-X.Y.Z.csv
>>>>>>     - projectA-X.Y.Z.zip
>>>>>>   When we wants to use one of these artifacts as dependency it
>> works fine
>>>>  to
>>>>>>   declare for example:
>>>>>>   <dependency>
>>>>>>     <groupId>xxx</groupId>
>>>>>>     <artifactId>projectA</artifactId>
>>>>>>     <version>X.Y.Z</version>
>>>>>>     <type>csv</type>
>>>>>>   </dependency>
>>>>>>
>>>>>>   But when doing a search in Nexus (either by GAV or by
>> keyword), only
>>>>  one
>>>>>>   artifact (in addition to pom) is displayed. Most of the time
>> this is
>>>>  the
>>>>>>   csv, but sometimes it can be another type. I suppose this is
>> because of
>>>>  the
>>>>>>   way indexing is done by lucene. My guess is that lucene will
>> only index
>>>>  one
>>>>>>   artifact in addition to the pom.
>>>>>>   Is this behavior intended? Is it possible to have all
>> artifacts indexed
>>>>  and
>>>>>>   visible in search?
>>>>>>
>>>>>>   Regards,
>>>>>>
>>>>>>   Julien
>>>>>>
>>>>>
>>>>>
>> ---------------------------------------------------------------------
>>>>>  To unsubscribe, e-mail: [hidden email]
>>>>>  For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: [hidden email]
>>>>  For additional commands, e-mail: [hidden email]
>>>>
>>>
>>>  ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: [hidden email]
>>>  For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Julien HENRY
Would it be possible to have index based on GAVCE (where E is extension)? I know extension doesn't have any meaning from Maven point of view, but it could help in this case.



----- Mail original -----

> De : Tamás Cservenák <[hidden email]>
> À : [hidden email]
> Cc :
> Envoyé le : Vendredi 14 Octobre 2011 16h43
> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
>T hat's another shortcoming how Lucene Documents are organized in Maven
> Indexer.
>
> Index is GAV based (and using "baseVersion" for V).
>
> Every "main" artifact (GAV + C being empty/null) is one record.
> Every "secondary" artifact (GAVC) is one record.
>
> and _uniqueness_ is enforced.
>
> Simply put, Indexer has the "logical" view on repository, is GAV based
> and not path based. Meaning, the count of records on index does NOT
> match the count of files being indexed.
>
> This could be "cured" by having extending the Key to GAVT (T=type),
> but again, Indexer does not KNOW the type (type != extension) of the
> artifact.
>
> http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java?view=markup
>
>
> Thanks
> ~t~
>
> On Fri, Oct 14, 2011 at 4:38 PM, Julien HENRY <[hidden email]> wrote:
>>  Many thanks Tamas,
>>
>>  I did as you suggested (packaging2extension-mapping.properties and repair
> index). It is nearly perfect.
>>
>>
>>  Going back to the case when I have several artifact with no classifier.
>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>   projectA-X.Y.Z.jar (main artifact)
>>>   projectA-X.Y.Z.csv
>>>   projectA-X.Y.Z.zip
>>
>>  Previously only csv was indexed. Now thanks to the mapping it is the jar
> (which is better since this is the main artifact).
>>
>>  I understand your point about the issue with POM -> MainArtifact. So I
> also understand why you do MainArtifact -> POM (with the need of the mapping
> hint when there are several candidates for main artifact). What I don't
> understand is why you don't index other candidate after you have indexed POM
> and MainArtifact?
>>
>>  Could be MainArtifact -> POM -> Other artifacts (with or without
> classifier)?
>>
>>  In this case the search would return all artifacts (pom, jar, csv, zip).
>>
>>
>>  I don't know what part of the code is involved but since you are
> already indexing secondary artifacts with classifier, why not also index
> artifacts without classifier (minus MainArtifact that was already indexed). Am I
> missing something?
>>
>>  Regards,
>>
>>  Julien
>>
>>
>>
>>  ----- Mail original -----
>>>  De : Tamás Cservenák <[hidden email]>
>>>  À : [hidden email]
>>>  Cc :
>>>  Envoyé le : Vendredi 14 Octobre 2011 15h58
>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
> different type/extension)
>>>
>>>  add following line to band aid:
>>>  custom_jar = jar
>>>
>>>  and _repair_ indexes, not just update.
>>>
>>>
>>>  Thanks,
>>>  ~t~
>>>
>>>  On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]>
> wrote:
>>>>   Answering to myself: no. I have manually added classifier to
> secondary
>>>  artifacts to have the following in my Nexus repo:
>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>   projectA-X.Y.Z-foo.csv
>>>>>   projectA-X.Y.Z-bundle.zip
>>>>
>>>>   I have updated the index then doing a GAV search on projectA
> returns 4
>>>  results:
>>>>   pom, csv, foo.csv, bundle.zip
>>>>
>>>>   I can't see the jar, and I have instead an invalid csv...
>>>>
>>>>   What's wrong?
>>>>
>>>>   Regards,
>>>>
>>>>   Julien
>>>>
>>>>
>>>>   ----- Mail original -----
>>>>>   De : Julien HENRY <[hidden email]>
>>>>>   À : "[hidden email]"
> <[hidden email]>
>>>>>   Cc :
>>>>>   Envoyé le : Vendredi 14 Octobre 2011 15h13
>>>>>   Objet : Re: [nexus-user] Search with several artifacts (same
> GAV,
>>>  different type/extension)
>>>>>
>>>>>  T hanks Tamas,
>>>>>
>>>>>   We will try to fix our custom packaging type to add classifier
> to
>>>  secondary
>>>>>   artifacts.
>>>>>
>>>>>   Do you confirm that the extension of the main artifact can be
> different
>>>  than
>>>>>   packaging declared in pom?
>>>>>
>>>>>   Will the following layout be correctly indexed?
>>>>>
>>>>>
>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>   projectA-X.Y.Z-foo.csv
>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>
>>>>>   Regards,
>>>>>
>>>>>   Julien
>>>>>
>>>>>>   ________________________________
>>>>>>   De : Tamás Cservenák <[hidden email]>
>>>>>>   À : [hidden email]
>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 14h53
>>>>>>   Objet : Re: [nexus-user] Search with several artifacts
> (same GAV,
>>>  different
>>>>>   type/extension)
>>>>>>
>>>>>>   Hi Julien,
>>>>>>
>>>>>>   This violates the repository layout... so in short: no
> help.
>>>>>>
>>>>>>   See exactly same issues:
>>>>>>   http://jira.codehaus.org/browse/MINDEXER-19
>>>>>>
>>>>>>   In short, Maven Indexer with this layout is unable to find
> out
>>>  which
>>>>>>   one is the "main" artifact....
>>>>>>   As per layout, a GAV might have one main and many
>>>  "secondary"
>>>>>>   artifacts (those with classifier).
>>>>>>
>>>>>>   Thanks,
>>>>>>   ~t~
>>>>>>
>>>>>>   On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY
>>>  <[hidden email]>
>>>>>   wrote:
>>>>>>>    Hi,
>>>>>>>
>>>>>>>    We have an issue while searching artifacts in Nexus
> UI. We
>>>  have some
>>>>>   Maven
>>>>>>>    projects with several artifacts attached to the build
> and
>>>  deployed to
>>>>>   Nexus.
>>>>>>>    The artifacts have different type (=extension) but no
>>>  classifier.
>>>>>>>    For example for a project named projectA, we publish
> on Nexus:
>>>>>>>      - projectA-X.Y.Z.pom
>>>>>>>      - projectA-X.Y.Z.jar
>>>>>>>      - projectA-X.Y.Z.csv
>>>>>>>      - projectA-X.Y.Z.zip
>>>>>>>    When we wants to use one of these artifacts as
> dependency it
>>>  works fine
>>>>>   to
>>>>>>>    declare for example:
>>>>>>>    <dependency>
>>>>>>>      <groupId>xxx</groupId>
>>>>>>>      <artifactId>projectA</artifactId>
>>>>>>>      <version>X.Y.Z</version>
>>>>>>>      <type>csv</type>
>>>>>>>    </dependency>
>>>>>>>
>>>>>>>    But when doing a search in Nexus (either by GAV or by
>>>  keyword), only
>>>>>   one
>>>>>>>    artifact (in addition to pom) is displayed. Most of
> the time
>>>  this is
>>>>>   the
>>>>>>>    csv, but sometimes it can be another type. I suppose
> this is
>>>  because of
>>>>>   the
>>>>>>>    way indexing is done by lucene. My guess is that
> lucene will
>>>  only index
>>>>>   one
>>>>>>>    artifact in addition to the pom.
>>>>>>>    Is this behavior intended? Is it possible to have all
>>>  artifacts indexed
>>>>>   and
>>>>>>>    visible in search?
>>>>>>>
>>>>>>>    Regards,
>>>>>>>
>>>>>>>    Julien
>>>>>>>
>>>>>>
>>>>>>
>>>  ---------------------------------------------------------------------
>>>>>>   To unsubscribe, e-mail:
> [hidden email]
>>>>>>   For additional commands, e-mail:
> [hidden email]
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>  ---------------------------------------------------------------------
>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>   For additional commands, e-mail: [hidden email]
>>>>>
>>>>
>>>>
>  ---------------------------------------------------------------------
>>>>   To unsubscribe, e-mail: [hidden email]
>>>>   For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>>  ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: [hidden email]
>>>  For additional commands, e-mail: [hidden email]
>>>
>>
>>  ---------------------------------------------------------------------
>>  To unsubscribe, e-mail: [hidden email]
>>  For additional commands, e-mail: [hidden email]
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák
Yes, "raising" E from "attribute only" to into part of the key would
be possible. But currently I have no idea what impact would that have
on indexer integrators...


Thanks,
~t~

On Fri, Oct 14, 2011 at 5:09 PM, Julien HENRY <[hidden email]> wrote:

> Would it be possible to have index based on GAVCE (where E is extension)? I know extension doesn't have any meaning from Maven point of view, but it could help in this case.
>
>
>
> ----- Mail original -----
>> De : Tamás Cservenák <[hidden email]>
>> À : [hidden email]
>> Cc :
>> Envoyé le : Vendredi 14 Octobre 2011 16h43
>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>
>>T hat's another shortcoming how Lucene Documents are organized in Maven
>> Indexer.
>>
>> Index is GAV based (and using "baseVersion" for V).
>>
>> Every "main" artifact (GAV + C being empty/null) is one record.
>> Every "secondary" artifact (GAVC) is one record.
>>
>> and _uniqueness_ is enforced.
>>
>> Simply put, Indexer has the "logical" view on repository, is GAV based
>> and not path based. Meaning, the count of records on index does NOT
>> match the count of files being indexed.
>>
>> This could be "cured" by having extending the Key to GAVT (T=type),
>> but again, Indexer does not KNOW the type (type != extension) of the
>> artifact.
>>
>> http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java?view=markup
>>
>>
>> Thanks
>> ~t~
>>
>> On Fri, Oct 14, 2011 at 4:38 PM, Julien HENRY <[hidden email]> wrote:
>>>  Many thanks Tamas,
>>>
>>>  I did as you suggested (packaging2extension-mapping.properties and repair
>> index). It is nearly perfect.
>>>
>>>
>>>  Going back to the case when I have several artifact with no classifier.
>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>   projectA-X.Y.Z.csv
>>>>   projectA-X.Y.Z.zip
>>>
>>>  Previously only csv was indexed. Now thanks to the mapping it is the jar
>> (which is better since this is the main artifact).
>>>
>>>  I understand your point about the issue with POM -> MainArtifact. So I
>> also understand why you do MainArtifact -> POM (with the need of the mapping
>> hint when there are several candidates for main artifact). What I don't
>> understand is why you don't index other candidate after you have indexed POM
>> and MainArtifact?
>>>
>>>  Could be MainArtifact -> POM -> Other artifacts (with or without
>> classifier)?
>>>
>>>  In this case the search would return all artifacts (pom, jar, csv, zip).
>>>
>>>
>>>  I don't know what part of the code is involved but since you are
>> already indexing secondary artifacts with classifier, why not also index
>> artifacts without classifier (minus MainArtifact that was already indexed). Am I
>> missing something?
>>>
>>>  Regards,
>>>
>>>  Julien
>>>
>>>
>>>
>>>  ----- Mail original -----
>>>>  De : Tamás Cservenák <[hidden email]>
>>>>  À : [hidden email]
>>>>  Cc :
>>>>  Envoyé le : Vendredi 14 Octobre 2011 15h58
>>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
>> different type/extension)
>>>>
>>>>  add following line to band aid:
>>>>  custom_jar = jar
>>>>
>>>>  and _repair_ indexes, not just update.
>>>>
>>>>
>>>>  Thanks,
>>>>  ~t~
>>>>
>>>>  On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]>
>> wrote:
>>>>>   Answering to myself: no. I have manually added classifier to
>> secondary
>>>>  artifacts to have the following in my Nexus repo:
>>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>>   projectA-X.Y.Z-foo.csv
>>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>
>>>>>   I have updated the index then doing a GAV search on projectA
>> returns 4
>>>>  results:
>>>>>   pom, csv, foo.csv, bundle.zip
>>>>>
>>>>>   I can't see the jar, and I have instead an invalid csv...
>>>>>
>>>>>   What's wrong?
>>>>>
>>>>>   Regards,
>>>>>
>>>>>   Julien
>>>>>
>>>>>
>>>>>   ----- Mail original -----
>>>>>>   De : Julien HENRY <[hidden email]>
>>>>>>   À : "[hidden email]"
>> <[hidden email]>
>>>>>>   Cc :
>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 15h13
>>>>>>   Objet : Re: [nexus-user] Search with several artifacts (same
>> GAV,
>>>>  different type/extension)
>>>>>>
>>>>>>  T hanks Tamas,
>>>>>>
>>>>>>   We will try to fix our custom packaging type to add classifier
>> to
>>>>  secondary
>>>>>>   artifacts.
>>>>>>
>>>>>>   Do you confirm that the extension of the main artifact can be
>> different
>>>>  than
>>>>>>   packaging declared in pom?
>>>>>>
>>>>>>   Will the following layout be correctly indexed?
>>>>>>
>>>>>>
>>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>>   projectA-X.Y.Z-foo.csv
>>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>>
>>>>>>   Regards,
>>>>>>
>>>>>>   Julien
>>>>>>
>>>>>>>   ________________________________
>>>>>>>   De : Tamás Cservenák <[hidden email]>
>>>>>>>   À : [hidden email]
>>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 14h53
>>>>>>>   Objet : Re: [nexus-user] Search with several artifacts
>> (same GAV,
>>>>  different
>>>>>>   type/extension)
>>>>>>>
>>>>>>>   Hi Julien,
>>>>>>>
>>>>>>>   This violates the repository layout... so in short: no
>> help.
>>>>>>>
>>>>>>>   See exactly same issues:
>>>>>>>   http://jira.codehaus.org/browse/MINDEXER-19
>>>>>>>
>>>>>>>   In short, Maven Indexer with this layout is unable to find
>> out
>>>>  which
>>>>>>>   one is the "main" artifact....
>>>>>>>   As per layout, a GAV might have one main and many
>>>>  "secondary"
>>>>>>>   artifacts (those with classifier).
>>>>>>>
>>>>>>>   Thanks,
>>>>>>>   ~t~
>>>>>>>
>>>>>>>   On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY
>>>>  <[hidden email]>
>>>>>>   wrote:
>>>>>>>>    Hi,
>>>>>>>>
>>>>>>>>    We have an issue while searching artifacts in Nexus
>> UI. We
>>>>  have some
>>>>>>   Maven
>>>>>>>>    projects with several artifacts attached to the build
>> and
>>>>  deployed to
>>>>>>   Nexus.
>>>>>>>>    The artifacts have different type (=extension) but no
>>>>  classifier.
>>>>>>>>    For example for a project named projectA, we publish
>> on Nexus:
>>>>>>>>      - projectA-X.Y.Z.pom
>>>>>>>>      - projectA-X.Y.Z.jar
>>>>>>>>      - projectA-X.Y.Z.csv
>>>>>>>>      - projectA-X.Y.Z.zip
>>>>>>>>    When we wants to use one of these artifacts as
>> dependency it
>>>>  works fine
>>>>>>   to
>>>>>>>>    declare for example:
>>>>>>>>    <dependency>
>>>>>>>>      <groupId>xxx</groupId>
>>>>>>>>      <artifactId>projectA</artifactId>
>>>>>>>>      <version>X.Y.Z</version>
>>>>>>>>      <type>csv</type>
>>>>>>>>    </dependency>
>>>>>>>>
>>>>>>>>    But when doing a search in Nexus (either by GAV or by
>>>>  keyword), only
>>>>>>   one
>>>>>>>>    artifact (in addition to pom) is displayed. Most of
>> the time
>>>>  this is
>>>>>>   the
>>>>>>>>    csv, but sometimes it can be another type. I suppose
>> this is
>>>>  because of
>>>>>>   the
>>>>>>>>    way indexing is done by lucene. My guess is that
>> lucene will
>>>>  only index
>>>>>>   one
>>>>>>>>    artifact in addition to the pom.
>>>>>>>>    Is this behavior intended? Is it possible to have all
>>>>  artifacts indexed
>>>>>>   and
>>>>>>>>    visible in search?
>>>>>>>>
>>>>>>>>    Regards,
>>>>>>>>
>>>>>>>>    Julien
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>  ---------------------------------------------------------------------
>>>>>>>   To unsubscribe, e-mail:
>> [hidden email]
>>>>>>>   For additional commands, e-mail:
>> [hidden email]
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>  ---------------------------------------------------------------------
>>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>>   For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>
>>>>>
>>  ---------------------------------------------------------------------
>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>   For additional commands, e-mail: [hidden email]
>>>>>
>>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: [hidden email]
>>>>  For additional commands, e-mail: [hidden email]
>>>>
>>>
>>>  ---------------------------------------------------------------------
>>>  To unsubscribe, e-mail: [hidden email]
>>>  For additional commands, e-mail: [hidden email]
>>>
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [hidden email]
> For additional commands, e-mail: [hidden email]
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re : [nexus-user] Search with several artifacts (same GAV, different type/extension)

Julien HENRY
Hi Tamás,

Can I open a feature request, even if it is implemented later than sooner?


Regards,

Julien

>________________________________
>De : Tamás Cservenák <[hidden email]>
>À : [hidden email]
>Envoyé le : Vendredi 14 Octobre 2011 17h21
>Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
>Yes, "raising" E from "attribute only" to into part of the key would
>be possible. But currently I have no idea what impact would that have
>on indexer integrators...
>
>
>Thanks,
>~t~
>
>On Fri, Oct 14, 2011 at 5:09 PM, Julien HENRY <[hidden email]> wrote:
>> Would it be possible to have index based on GAVCE (where E is extension)? I know extension doesn't have any meaning from Maven point of view, but it could help in this case.
>>
>>
>>
>> ----- Mail original -----
>>> De : Tamás Cservenák <[hidden email]>
>>> À : [hidden email]
>>> Cc :
>>> Envoyé le : Vendredi 14 Octobre 2011 16h43
>>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>>
>>>T hat's another shortcoming how Lucene Documents are organized in Maven
>>> Indexer.
>>>
>>> Index is GAV based (and using "baseVersion" for V).
>>>
>>> Every "main" artifact (GAV + C being empty/null) is one record.
>>> Every "secondary" artifact (GAVC) is one record.
>>>
>>> and _uniqueness_ is enforced.
>>>
>>> Simply put, Indexer has the "logical" view on repository, is GAV based
>>> and not path based. Meaning, the count of records on index does NOT
>>> match the count of files being indexed.
>>>
>>> This could be "cured" by having extending the Key to GAVT (T=type),
>>> but again, Indexer does not KNOW the type (type != extension) of the
>>> artifact.
>>>
>>> http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java?view=markup
>>>
>>>
>>> Thanks
>>> ~t~
>>>
>>> On Fri, Oct 14, 2011 at 4:38 PM, Julien HENRY <[hidden email]> wrote:
>>>>  Many thanks Tamas,
>>>>
>>>>  I did as you suggested (packaging2extension-mapping.properties and repair
>>> index). It is nearly perfect.
>>>>
>>>>
>>>>  Going back to the case when I have several artifact with no classifier.
>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>   projectA-X.Y.Z.csv
>>>>>   projectA-X.Y.Z.zip
>>>>
>>>>  Previously only csv was indexed. Now thanks to the mapping it is the jar
>>> (which is better since this is the main artifact).
>>>>
>>>>  I understand your point about the issue with POM -> MainArtifact. So I
>>> also understand why you do MainArtifact -> POM (with the need of the mapping
>>> hint when there are several candidates for main artifact). What I don't
>>> understand is why you don't index other candidate after you have indexed POM
>>> and MainArtifact?
>>>>
>>>>  Could be MainArtifact -> POM -> Other artifacts (with or without
>>> classifier)?
>>>>
>>>>  In this case the search would return all artifacts (pom, jar, csv, zip).
>>>>
>>>>
>>>>  I don't know what part of the code is involved but since you are
>>> already indexing secondary artifacts with classifier, why not also index
>>> artifacts without classifier (minus MainArtifact that was already indexed). Am I
>>> missing something?
>>>>
>>>>  Regards,
>>>>
>>>>  Julien
>>>>
>>>>
>>>>
>>>>  ----- Mail original -----
>>>>>  De : Tamás Cservenák <[hidden email]>
>>>>>  À : [hidden email]
>>>>>  Cc :
>>>>>  Envoyé le : Vendredi 14 Octobre 2011 15h58
>>>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
>>> different type/extension)
>>>>>
>>>>>  add following line to band aid:
>>>>>  custom_jar = jar
>>>>>
>>>>>  and _repair_ indexes, not just update.
>>>>>
>>>>>
>>>>>  Thanks,
>>>>>  ~t~
>>>>>
>>>>>  On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]>
>>> wrote:
>>>>>>   Answering to myself: no. I have manually added classifier to
>>> secondary
>>>>>  artifacts to have the following in my Nexus repo:
>>>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>>>   projectA-X.Y.Z-foo.csv
>>>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>>
>>>>>>   I have updated the index then doing a GAV search on projectA
>>> returns 4
>>>>>  results:
>>>>>>   pom, csv, foo.csv, bundle.zip
>>>>>>
>>>>>>   I can't see the jar, and I have instead an invalid csv...
>>>>>>
>>>>>>   What's wrong?
>>>>>>
>>>>>>   Regards,
>>>>>>
>>>>>>   Julien
>>>>>>
>>>>>>
>>>>>>   ----- Mail original -----
>>>>>>>   De : Julien HENRY <[hidden email]>
>>>>>>>   À : "[hidden email]"
>>> <[hidden email]>
>>>>>>>   Cc :
>>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 15h13
>>>>>>>   Objet : Re: [nexus-user] Search with several artifacts (same
>>> GAV,
>>>>>  different type/extension)
>>>>>>>
>>>>>>>  T hanks Tamas,
>>>>>>>
>>>>>>>   We will try to fix our custom packaging type to add classifier
>>> to
>>>>>  secondary
>>>>>>>   artifacts.
>>>>>>>
>>>>>>>   Do you confirm that the extension of the main artifact can be
>>> different
>>>>>  than
>>>>>>>   packaging declared in pom?
>>>>>>>
>>>>>>>   Will the following layout be correctly indexed?
>>>>>>>
>>>>>>>
>>>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>>>   projectA-X.Y.Z-foo.csv
>>>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>>>
>>>>>>>   Regards,
>>>>>>>
>>>>>>>   Julien
>>>>>>>
>>>>>>>>   ________________________________
>>>>>>>>   De : Tamás Cservenák <[hidden email]>
>>>>>>>>   À : [hidden email]
>>>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 14h53
>>>>>>>>   Objet : Re: [nexus-user] Search with several artifacts
>>> (same GAV,
>>>>>  different
>>>>>>>   type/extension)
>>>>>>>>
>>>>>>>>   Hi Julien,
>>>>>>>>
>>>>>>>>   This violates the repository layout... so in short: no
>>> help.
>>>>>>>>
>>>>>>>>   See exactly same issues:
>>>>>>>>   http://jira.codehaus.org/browse/MINDEXER-19
>>>>>>>>
>>>>>>>>   In short, Maven Indexer with this layout is unable to find
>>> out
>>>>>  which
>>>>>>>>   one is the "main" artifact....
>>>>>>>>   As per layout, a GAV might have one main and many
>>>>>  "secondary"
>>>>>>>>   artifacts (those with classifier).
>>>>>>>>
>>>>>>>>   Thanks,
>>>>>>>>   ~t~
>>>>>>>>
>>>>>>>>   On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY
>>>>>  <[hidden email]>
>>>>>>>   wrote:
>>>>>>>>>    Hi,
>>>>>>>>>
>>>>>>>>>    We have an issue while searching artifacts in Nexus
>>> UI. We
>>>>>  have some
>>>>>>>   Maven
>>>>>>>>>    projects with several artifacts attached to the build
>>> and
>>>>>  deployed to
>>>>>>>   Nexus.
>>>>>>>>>    The artifacts have different type (=extension) but no
>>>>>  classifier.
>>>>>>>>>    For example for a project named projectA, we publish
>>> on Nexus:
>>>>>>>>>      - projectA-X.Y.Z.pom
>>>>>>>>>      - projectA-X.Y.Z.jar
>>>>>>>>>      - projectA-X.Y.Z.csv
>>>>>>>>>      - projectA-X.Y.Z.zip
>>>>>>>>>    When we wants to use one of these artifacts as
>>> dependency it
>>>>>  works fine
>>>>>>>   to
>>>>>>>>>    declare for example:
>>>>>>>>>    <dependency>
>>>>>>>>>      <groupId>xxx</groupId>
>>>>>>>>>      <artifactId>projectA</artifactId>
>>>>>>>>>      <version>X.Y.Z</version>
>>>>>>>>>      <type>csv</type>
>>>>>>>>>    </dependency>
>>>>>>>>>
>>>>>>>>>    But when doing a search in Nexus (either by GAV or by
>>>>>  keyword), only
>>>>>>>   one
>>>>>>>>>    artifact (in addition to pom) is displayed. Most of
>>> the time
>>>>>  this is
>>>>>>>   the
>>>>>>>>>    csv, but sometimes it can be another type. I suppose
>>> this is
>>>>>  because of
>>>>>>>   the
>>>>>>>>>    way indexing is done by lucene. My guess is that
>>> lucene will
>>>>>  only index
>>>>>>>   one
>>>>>>>>>    artifact in addition to the pom.
>>>>>>>>>    Is this behavior intended? Is it possible to have all
>>>>>  artifacts indexed
>>>>>>>   and
>>>>>>>>>    visible in search?
>>>>>>>>>
>>>>>>>>>    Regards,
>>>>>>>>>
>>>>>>>>>    Julien
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>  ---------------------------------------------------------------------
>>>>>>>>   To unsubscribe, e-mail:
>>> [hidden email]
>>>>>>>>   For additional commands, e-mail:
>>> [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>  ---------------------------------------------------------------------
>>>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>>>   For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>
>>>>>>
>>>  ---------------------------------------------------------------------
>>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>>   For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>>>  To unsubscribe, e-mail: [hidden email]
>>>>>  For additional commands, e-mail: [hidden email]
>>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: [hidden email]
>>>>  For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Re : [nexus-user] Search with several artifacts (same GAV, different type/extension)

Tamás Cservenák

Sure. Just create an issue in MINDEXER jira.

Thanks,
~t~ (phone)

On Oct 17, 2011 9:50 AM, "Julien HENRY" <[hidden email]> wrote:
Hi Tamás,

Can I open a feature request, even if it is implemented later than sooner?


Regards,

Julien

>________________________________
>De : Tamás Cservenák <[hidden email]>
>À : [hidden email]
>Envoyé le : Vendredi 14 Octobre 2011 17h21
>Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>
>Yes, "raising" E from "attribute only" to into part of the key would
>be possible. But currently I have no idea what impact would that have
>on indexer integrators...
>
>
>Thanks,
>~t~
>
>On Fri, Oct 14, 2011 at 5:09 PM, Julien HENRY <[hidden email]> wrote:
>> Would it be possible to have index based on GAVCE (where E is extension)? I know extension doesn't have any meaning from Maven point of view, but it could help in this case.
>>
>>
>>
>> ----- Mail original -----
>>> De : Tamás Cservenák <[hidden email]>
>>> À : [hidden email]
>>> Cc :
>>> Envoyé le : Vendredi 14 Octobre 2011 16h43
>>> Objet : Re: [nexus-user] Search with several artifacts (same GAV, different type/extension)
>>>
>>>T hat's another shortcoming how Lucene Documents are organized in Maven
>>> Indexer.
>>>
>>> Index is GAV based (and using "baseVersion" for V).
>>>
>>> Every "main" artifact (GAV + C being empty/null) is one record.
>>> Every "secondary" artifact (GAVC) is one record.
>>>
>>> and _uniqueness_ is enforced.
>>>
>>> Simply put, Indexer has the "logical" view on repository, is GAV based
>>> and not path based. Meaning, the count of records on index does NOT
>>> match the count of files being indexed.
>>>
>>> This could be "cured" by having extending the Key to GAVT (T=type),
>>> but again, Indexer does not KNOW the type (type != extension) of the
>>> artifact.
>>>
>>> http://svn.apache.org/viewvc/maven/indexer/trunk/indexer-core/src/main/java/org/apache/maven/index/ArtifactInfo.java?view=markup
>>>
>>>
>>> Thanks
>>> ~t~
>>>
>>> On Fri, Oct 14, 2011 at 4:38 PM, Julien HENRY <[hidden email]> wrote:
>>>>  Many thanks Tamas,
>>>>
>>>>  I did as you suggested (packaging2extension-mapping.properties and repair
>>> index). It is nearly perfect.
>>>>
>>>>
>>>>  Going back to the case when I have several artifact with no classifier.
>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>   projectA-X.Y.Z.csv
>>>>>   projectA-X.Y.Z.zip
>>>>
>>>>  Previously only csv was indexed. Now thanks to the mapping it is the jar
>>> (which is better since this is the main artifact).
>>>>
>>>>  I understand your point about the issue with POM -> MainArtifact. So I
>>> also understand why you do MainArtifact -> POM (with the need of the mapping
>>> hint when there are several candidates for main artifact). What I don't
>>> understand is why you don't index other candidate after you have indexed POM
>>> and MainArtifact?
>>>>
>>>>  Could be MainArtifact -> POM -> Other artifacts (with or without
>>> classifier)?
>>>>
>>>>  In this case the search would return all artifacts (pom, jar, csv, zip).
>>>>
>>>>
>>>>  I don't know what part of the code is involved but since you are
>>> already indexing secondary artifacts with classifier, why not also index
>>> artifacts without classifier (minus MainArtifact that was already indexed). Am I
>>> missing something?
>>>>
>>>>  Regards,
>>>>
>>>>  Julien
>>>>
>>>>
>>>>
>>>>  ----- Mail original -----
>>>>>  De : Tamás Cservenák <[hidden email]>
>>>>>  À : [hidden email]
>>>>>  Cc :
>>>>>  Envoyé le : Vendredi 14 Octobre 2011 15h58
>>>>>  Objet : Re: [nexus-user] Search with several artifacts (same GAV,
>>> different type/extension)
>>>>>
>>>>>  add following line to band aid:
>>>>>  custom_jar = jar
>>>>>
>>>>>  and _repair_ indexes, not just update.
>>>>>
>>>>>
>>>>>  Thanks,
>>>>>  ~t~
>>>>>
>>>>>  On Fri, Oct 14, 2011 at 3:56 PM, Julien HENRY <[hidden email]>
>>> wrote:
>>>>>>   Answering to myself: no. I have manually added classifier to
>>> secondary
>>>>>  artifacts to have the following in my Nexus repo:
>>>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>>>   projectA-X.Y.Z-foo.csv
>>>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>>
>>>>>>   I have updated the index then doing a GAV search on projectA
>>> returns 4
>>>>>  results:
>>>>>>   pom, csv, foo.csv, bundle.zip
>>>>>>
>>>>>>   I can't see the jar, and I have instead an invalid csv...
>>>>>>
>>>>>>   What's wrong?
>>>>>>
>>>>>>   Regards,
>>>>>>
>>>>>>   Julien
>>>>>>
>>>>>>
>>>>>>   ----- Mail original -----
>>>>>>>   De : Julien HENRY <[hidden email]>
>>>>>>>   À : "[hidden email]"
>>> <[hidden email]>
>>>>>>>   Cc :
>>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 15h13
>>>>>>>   Objet : Re: [nexus-user] Search with several artifacts (same
>>> GAV,
>>>>>  different type/extension)
>>>>>>>
>>>>>>>  T hanks Tamas,
>>>>>>>
>>>>>>>   We will try to fix our custom packaging type to add classifier
>>> to
>>>>>  secondary
>>>>>>>   artifacts.
>>>>>>>
>>>>>>>   Do you confirm that the extension of the main artifact can be
>>> different
>>>>>  than
>>>>>>>   packaging declared in pom?
>>>>>>>
>>>>>>>   Will the following layout be correctly indexed?
>>>>>>>
>>>>>>>
>>>>>>>   projectA-X.Y.Z.pom (with packaging=custom_jar)
>>>>>>>   projectA-X.Y.Z.jar (main artifact)
>>>>>>>   projectA-X.Y.Z-foo.csv
>>>>>>>   projectA-X.Y.Z-bundle.zip
>>>>>>>
>>>>>>>   Regards,
>>>>>>>
>>>>>>>   Julien
>>>>>>>
>>>>>>>>   ________________________________
>>>>>>>>   De : Tamás Cservenák <[hidden email]>
>>>>>>>>   À : [hidden email]
>>>>>>>>   Envoyé le : Vendredi 14 Octobre 2011 14h53
>>>>>>>>   Objet : Re: [nexus-user] Search with several artifacts
>>> (same GAV,
>>>>>  different
>>>>>>>   type/extension)
>>>>>>>>
>>>>>>>>   Hi Julien,
>>>>>>>>
>>>>>>>>   This violates the repository layout... so in short: no
>>> help.
>>>>>>>>
>>>>>>>>   See exactly same issues:
>>>>>>>>   http://jira.codehaus.org/browse/MINDEXER-19
>>>>>>>>
>>>>>>>>   In short, Maven Indexer with this layout is unable to find
>>> out
>>>>>  which
>>>>>>>>   one is the "main" artifact....
>>>>>>>>   As per layout, a GAV might have one main and many
>>>>>  "secondary"
>>>>>>>>   artifacts (those with classifier).
>>>>>>>>
>>>>>>>>   Thanks,
>>>>>>>>   ~t~
>>>>>>>>
>>>>>>>>   On Fri, Oct 14, 2011 at 2:46 PM, Julien HENRY
>>>>>  <[hidden email]>
>>>>>>>   wrote:
>>>>>>>>>    Hi,
>>>>>>>>>
>>>>>>>>>    We have an issue while searching artifacts in Nexus
>>> UI. We
>>>>>  have some
>>>>>>>   Maven
>>>>>>>>>    projects with several artifacts attached to the build
>>> and
>>>>>  deployed to
>>>>>>>   Nexus.
>>>>>>>>>    The artifacts have different type (=extension) but no
>>>>>  classifier.
>>>>>>>>>    For example for a project named projectA, we publish
>>> on Nexus:
>>>>>>>>>      - projectA-X.Y.Z.pom
>>>>>>>>>      - projectA-X.Y.Z.jar
>>>>>>>>>      - projectA-X.Y.Z.csv
>>>>>>>>>      - projectA-X.Y.Z.zip
>>>>>>>>>    When we wants to use one of these artifacts as
>>> dependency it
>>>>>  works fine
>>>>>>>   to
>>>>>>>>>    declare for example:
>>>>>>>>>    <dependency>
>>>>>>>>>      <groupId>xxx</groupId>
>>>>>>>>>      <artifactId>projectA</artifactId>
>>>>>>>>>      <version>X.Y.Z</version>
>>>>>>>>>      <type>csv</type>
>>>>>>>>>    </dependency>
>>>>>>>>>
>>>>>>>>>    But when doing a search in Nexus (either by GAV or by
>>>>>  keyword), only
>>>>>>>   one
>>>>>>>>>    artifact (in addition to pom) is displayed. Most of
>>> the time
>>>>>  this is
>>>>>>>   the
>>>>>>>>>    csv, but sometimes it can be another type. I suppose
>>> this is
>>>>>  because of
>>>>>>>   the
>>>>>>>>>    way indexing is done by lucene. My guess is that
>>> lucene will
>>>>>  only index
>>>>>>>   one
>>>>>>>>>    artifact in addition to the pom.
>>>>>>>>>    Is this behavior intended? Is it possible to have all
>>>>>  artifacts indexed
>>>>>>>   and
>>>>>>>>>    visible in search?
>>>>>>>>>
>>>>>>>>>    Regards,
>>>>>>>>>
>>>>>>>>>    Julien
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>  ---------------------------------------------------------------------
>>>>>>>>   To unsubscribe, e-mail:
>>> [hidden email]
>>>>>>>>   For additional commands, e-mail:
>>> [hidden email]
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>  ---------------------------------------------------------------------
>>>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>>>   For additional commands, e-mail: [hidden email]
>>>>>>>
>>>>>>
>>>>>>
>>>  ---------------------------------------------------------------------
>>>>>>   To unsubscribe, e-mail: [hidden email]
>>>>>>   For additional commands, e-mail: [hidden email]
>>>>>>
>>>>>>
>>>>>
>>>>>  ---------------------------------------------------------------------
>>>>>  To unsubscribe, e-mail: [hidden email]
>>>>>  For additional commands, e-mail: [hidden email]
>>>>>
>>>>
>>>>  ---------------------------------------------------------------------
>>>>  To unsubscribe, e-mail: [hidden email]
>>>>  For additional commands, e-mail: [hidden email]
>>>>
>>>>
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: [hidden email]
>>> For additional commands, e-mail: [hidden email]
>>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden email]
>> For additional commands, e-mail: [hidden email]
>>
>>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [hidden email]
>For additional commands, e-mail: [hidden email]
>
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]