Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Buckminster dev » Custom materialization of Maven artifacts
Custom materialization of Maven artifacts [message #489414] Fri, 02 October 2009 21:19 Go to next message
Steve Jerman is currently offline Steve Jerman
Messages: 5
Registered: July 2009
Junior Member
Hi,

I am implementing some functionality for the Tigerstripe project which downloads a Maven artifact from a repo based on a CQUERY and install it into a 'special' place in the file system (which is relative to the Eclipse install).

I have a custom component type and understand, I think, how to customize the 'reader' side of things.

My question is how do I customize the materialization? I see there is an extension point for materialization, so I assume I can define my own and use the filesystem materializer as a template, but How do I say that 'this component should use this materializer for artifacts where source=false'?

Thanks for any help.
Steve

[Updated on: Fri, 02 October 2009 21:20]

Report message to a moderator

Re: Custom materialization of Maven artifacts [message #489419 is a reply to message #489414] Fri, 02 October 2009 21:59 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas Hallgren
Messages: 3229
Registered: July 2009
Senior Member
Hi Steve,
You ask a very good question. Unfortunately, the answer is that you cannot do that yet. The only way to control
materialization selection is through name patterns in the mspec.

The way I would like to solve this is to expose some data from a resolution as properties and then allow filters in the
mspec nodes. The selected provider could for instance set properties for 'readerType' and 'source'. The 'componentType'
and other relevant information could also be set. An mspec node could then declare a filter instead of (or in addition
to) the pattern. Your example could then be declared as:

<mspecNode filter="(&(source=false)(componentType=<your type>))" materializer="<your materializer>" />

Would that be of help to you?

Regards,
Thomas Hallgren


On 10/02/2009 11:20 PM, Steve Jerman wrote:
> Hi,
>
> I am implementing some functionality for the Tigerstripe project which
> downloads a Maven artifact from a repo based on a CQUERY and install it
> into a 'special' place in the file system (which is relative to the
> Eclipse install).
>
> I have a custom component type and understand, I think, how to customize
> the 'reader' side of things.
>
> My question is how do I customize the materialization? I see there is an
> extension point for materialization, so I assume I can define my own and
> use the filesystem materializer as a template, but How do I say that
> 'this component should use this materializer for artifacts where
> source=false'?
>
> Thanks for any help.
> Steve
Re: Custom materialization of Maven artifacts [message #489420 is a reply to message #489419] Fri, 02 October 2009 22:08 Go to previous messageGo to next message
Henrik Lindberg is currently offline Henrik Lindberg
Messages: 2500
Registered: July 2009
Senior Member
I got a crazy idea.

What if you set a property on source components, and that you use this
property in the matching in the MSPEC. But that is perhaps too late.

I like the filter idea otherwise - and it is a step in the direction of
b3. We should expose at least the "materialization options" source and
mutable (you may want to do different things depending on both of those).

- henrik

On 10/2/09 11:59 PM, Thomas Hallgren wrote:
> Hi Steve,
> You ask a very good question. Unfortunately, the answer is that you
> cannot do that yet. The only way to control materialization selection is
> through name patterns in the mspec.
>
> The way I would like to solve this is to expose some data from a
> resolution as properties and then allow filters in the mspec nodes. The
> selected provider could for instance set properties for 'readerType' and
> 'source'. The 'componentType' and other relevant information could also
> be set. An mspec node could then declare a filter instead of (or in
> addition to) the pattern. Your example could then be declared as:
>
> <mspecNode filter="(&(source=false)(componentType=<your type>))"
> materializer="<your materializer>" />
>
> Would that be of help to you?
>
> Regards,
> Thomas Hallgren
>
>
> On 10/02/2009 11:20 PM, Steve Jerman wrote:
>> Hi,
>>
>> I am implementing some functionality for the Tigerstripe project which
>> downloads a Maven artifact from a repo based on a CQUERY and install it
>> into a 'special' place in the file system (which is relative to the
>> Eclipse install).
>>
>> I have a custom component type and understand, I think, how to customize
>> the 'reader' side of things.
>>
>> My question is how do I customize the materialization? I see there is an
>> extension point for materialization, so I assume I can define my own and
>> use the filesystem materializer as a template, but How do I say that
>> 'this component should use this materializer for artifacts where
>> source=false'?
>>
>> Thanks for any help.
>> Steve
>
Re: Custom materialization of Maven artifacts [message #489931 is a reply to message #489419] Tue, 06 October 2009 14:17 Go to previous messageGo to next message
Steve Jerman is currently offline Steve Jerman
Messages: 5
Registered: July 2009
Junior Member
Hi,

I'm 70% sure I wrote a reply yesterday.. maybe I forgot to hit send...

Anyway, if I look at what I want to do...

I would like to be able to have a single file that defines both the artifacts and their dependencies and gives me the abilty to override the default materiazation behavior.Having to edit the MSPEC to tweak materialization is a little 'after the fact. I guess what I am saying is that I like the general concept of what you are suggestion but why can't it be in the CQUERY as opposed to the MSPEC.

Few other points whilst I am at it...

1) Why cant we specify multiple root nodes in a CQUERY? If I am trying to materialize a workspace I may want to pull in unrelated projects.

2) Am I right in thinking that the Maven2 materializer can't deal with classifiers?

Steve

Re: Custom materialization of Maven artifacts [message #489952 is a reply to message #489931] Tue, 06 October 2009 15:08 Go to previous messageGo to next message
Thomas Hallgren is currently offline Thomas Hallgren
Messages: 3229
Registered: July 2009
Senior Member
On 10/06/2009 04:17 PM, Steve Jerman wrote:
> Hi,
>
> I'm 70% sure I wrote a reply yesterday.. maybe I forgot to hit send...
>
> Anyway, if I look at what I want to do...
>
> I would like to be able to have a single file that defines both the
> artifacts and their dependencies and gives me the abilty to override the
> default materiazation behavior.Having to edit the MSPEC to tweak
> materialization is a little 'after the fact. I guess what I am saying is
> that I like the general concept of what you are suggestion but why can't
> it be in the CQUERY as opposed to the MSPEC.
>
The CQUERY describes the actions to take during the resolution. The MSPEC is about what to do once the resolution has
completed and it's time to download. The intermediate result can be saved as a Bill Of Materials (BOM) and materialized
in different ways on different machines.

We have a bugzilla where we discuss a more composite format, i.e. one file that contains it all. See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286367

> Few other points whilst I am at it...
>
> 1) Why cant we specify multiple root nodes in a CQUERY? If I am trying
> to materialize a workspace I may want to pull in unrelated projects.
>
Good question. Add yourself as CC on https://bugs.eclipse.org/bugs/show_bug.cgi?id=286487

> 2) Am I right in thinking that the Maven2 materializer can't deal with
> http://maven.apache.org/ref/2.2.1/maven-model/maven.html#cla ss_dependency?
>
The resolver will traverse dependencies. Not all the semantics are covered though. We use groupId, artifactId, version.

Regards,
Thomas Hallgren
Re: Custom materialization of Maven artifacts [message #489962 is a reply to message #489952] Tue, 06 October 2009 15:54 Go to previous messageGo to next message
Steve Jerman is currently offline Steve Jerman
Messages: 5
Registered: July 2009
Junior Member
Thanks Thomas.

Quote:

The CQUERY describes the actions to take during the resolution. The MSPEC is about what to do once the resolution has
completed and it's time to download. The intermediate result can be saved as a Bill Of Materials (BOM) and materialized
in different ways on different machines.

We have a bugzilla where we discuss a more composite format, i.e. one file that contains it all. See:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=286367


Interesting
Quote:

> Few other points whilst I am at it...
>
> 1) Why cant we specify multiple root nodes in a CQUERY? If I am trying
> to materialize a workspace I may want to pull in unrelated projects.
>
Good question. Add yourself as CC on https://bugs.eclipse.org/bugs/show_bug.cgi?id=286487


Thanks - will do.
Quote:

> 2) Am I right in thinking that the Maven2 materializer can't deal with
> http://maven.apache.org/ref/2.2.1/maven-model/maven.html#cla ss_dependency?
>
The resolver will traverse dependencies. Not all the semantics are covered though. We use groupId, artifactId, version.


I actually need to use the classifier ( I generate a Jar and a Zip (as a 'GEN' classifier) from our maven build.
Re: Custom materialization of Maven artifacts [message #489966 is a reply to message #489962] Tue, 06 October 2009 16:17 Go to previous message
Thomas Hallgren is currently offline Thomas Hallgren
Messages: 3229
Registered: July 2009
Senior Member
On 10/06/2009 05:54 PM, Steve Jerman wrote:

>> The resolver will traverse dependencies. Not all the semantics are
>> covered though. We use groupId, artifactId, version.
>
> I actually need to use the classifier ( I generate a Jar and a Zip (as a
> 'GEN' classifier) from our maven build.

I suggest you add a bugzilla enhancement request for this.

Regards,
Thomas Hallgren
Previous Topic:Headless (JUnit) launching
Next Topic:[buckminster-dev] Welcome Johannes Utzig as a new tools.buckminster Committer
Goto Forum:
  


Current Time: Mon Oct 20 21:19:14 GMT 2014

Powered by FUDForum. Page generated in 0.02124 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software