You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by Bertrand Delacretaz <bd...@apache.org> on 2015/06/15 15:07:12 UTC

slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Hi,

I have created a module with packaging=slingfeature at [1], used in
Crankstart testing.

Shouldn't my provisioning model's txt file be deployed with the
"slingfeature" classfier?

It looks like it doesn't have a classifier:

  [INFO] Installing
....m2/repository/org/apache/sling/org.apache.sling.cransktart.test.model/1.9.9-SNAPSHOT/org.apache.sling.cransktart.test.model-1.9.9-SNAPSHOT.txt
  [INFO] ...org.apache.sling.cransktart.test.model-1.9.9-SNAPSHOT.pom
  [INFO] ...org.apache.sling.cransktart.test.model-1.9.9-SNAPSHOT-sources.jar

-Bertrand

[1] https://svn.apache.org/repos/asf/sling/trunk/contrib/crankstart/test-model

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Carsten Ziegeler <cz...@apache.org>.
Am 16.06.15 um 17:46 schrieb Bertrand Delacretaz:
> On Tue, Jun 16, 2015 at 11:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
>> Am 16.06.15 um 11:19 schrieb Bertrand Delacretaz:
>>> ... That doesn't work for my contrib/crankstart/test-model model - as you
>>> say it's the main artifact of that module so it's deployed without the
>>> "slingfeature" type or classifier, it's just a "txt" type artifact.
>>
>> That happens if you're not using Maven :)
>>
>> Maven has a mapping for slingfeature -> txt for the extension
> 
> Ah ok, defined in the last two <component> elements here, right?
> 
> https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/resources/META-INF/plexus/components.xml

Yes,

> 
>> ...I suggest you do the same mapping as maven does, it's really a simple
>> type mapping for two types (slingfeature and slingstart)....
> 
> Considering all artifacts having the "txt" type as being of the
> "slingfeature" type?

No, the other way round :) All artifacts of type slingfeature have the
extension txt. Same for slingstart.
So in your model you have:
  com.foo/artifact.bar/1.0.0/slingfeature

.> mvn relative path : com/foo/artifact.bar/1.0.0/artifact.bar-1.0.0.txt

Carsten

> 
> That would work. Considering all "jar" as being "slingstart" wouldn't
> work as the jar artifacts that Crankstart uses are supposed to be
> bundles, but I don't think I need that at the moment.
> 
> -Bertrand
> 


-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Tue, Jun 16, 2015 at 11:39 AM, Carsten Ziegeler <cz...@apache.org> wrote:
> Am 16.06.15 um 11:19 schrieb Bertrand Delacretaz:
>>... That doesn't work for my contrib/crankstart/test-model model - as you
>> say it's the main artifact of that module so it's deployed without the
>> "slingfeature" type or classifier, it's just a "txt" type artifact.
>
> That happens if you're not using Maven :)
>
> Maven has a mapping for slingfeature -> txt for the extension

Ah ok, defined in the last two <component> elements here, right?

https://svn.apache.org/repos/asf/sling/trunk/tooling/maven/slingstart-maven-plugin/src/main/resources/META-INF/plexus/components.xml

> ...I suggest you do the same mapping as maven does, it's really a simple
> type mapping for two types (slingfeature and slingstart)....

Considering all artifacts having the "txt" type as being of the
"slingfeature" type?

That would work. Considering all "jar" as being "slingstart" wouldn't
work as the jar artifacts that Crankstart uses are supposed to be
bundles, but I don't think I need that at the moment.

-Bertrand

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Carsten Ziegeler <cz...@apache.org>.
Am 16.06.15 um 11:19 schrieb Bertrand Delacretaz:
> Hi Carsten,
> 
> On Mon, Jun 15, 2015 at 3:29 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>> Am 15.06.15 um 15:18 schrieb Bertrand Delacretaz:
>>> ...you get a bunch of Maven artifact URLs and need
>>> to sort them out into bundles, Sling provisioning models, etc.
>>>
>> Yes, that's what the type is used for, so  in your model you have
>>   {groupId}/{artifactId}/{version}/slingfeature
> 
> That doesn't work for my contrib/crankstart/test-model model - as you
> say it's the main artifact of that module so it's deployed without the
> "slingfeature" type or classifier, it's just a "txt" type artifact.

That happens if you're not using Maven :)

Maven has a mapping for slingfeature -> txt for the extension

> 
> To resolve it in my (crankstart) model I need this, which is fed later
> in pax url for resolving:
> 
>   org.apache.sling/org.apache.sling.cransktart.test.model/1.9.9-SNAPSHOT/txt
> 
> So it's impossible to know from that URL that it's a provisioning
> model artifact. IIUC the slingstart-maven-plugin uses the artifact's
> packaging info to find out, but in my case the packaging is not
> available - pax url only supports type and classifier
> (https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol).
> 
> For now, as a workaround I added
> "nested.models=org.apache.sling.cransktart.test.model" variable to my
> provisioning model, to be able to find out at runtime that it's a
> provisioning model that I can merge.
> 
> Do you see a better solution to identify provisioning model artifacts
> such as this one from their model artifact "urls" ?
>

I suggest you do the same mapping as maven does, it's really a simple
type mapping for two types (slingfeature and slingstart).

Regards
Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Bertrand Delacretaz <bd...@apache.org>.
Hi Carsten,

On Mon, Jun 15, 2015 at 3:29 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Am 15.06.15 um 15:18 schrieb Bertrand Delacretaz:
>> ...you get a bunch of Maven artifact URLs and need
>> to sort them out into bundles, Sling provisioning models, etc.
>>
> Yes, that's what the type is used for, so  in your model you have
>   {groupId}/{artifactId}/{version}/slingfeature

That doesn't work for my contrib/crankstart/test-model model - as you
say it's the main artifact of that module so it's deployed without the
"slingfeature" type or classifier, it's just a "txt" type artifact.

To resolve it in my (crankstart) model I need this, which is fed later
in pax url for resolving:

  org.apache.sling/org.apache.sling.cransktart.test.model/1.9.9-SNAPSHOT/txt

So it's impossible to know from that URL that it's a provisioning
model artifact. IIUC the slingstart-maven-plugin uses the artifact's
packaging info to find out, but in my case the packaging is not
available - pax url only supports type and classifier
(https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol).

For now, as a workaround I added
"nested.models=org.apache.sling.cransktart.test.model" variable to my
provisioning model, to be able to find out at runtime that it's a
provisioning model that I can merge.

Do you see a better solution to identify provisioning model artifacts
such as this one from their model artifact "urls" ?

-Bertrand

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Carsten Ziegeler <cz...@apache.org>.
Am 15.06.15 um 15:18 schrieb Bertrand Delacretaz:
> On Mon, Jun 15, 2015 at 3:12 PM, Carsten Ziegeler <cz...@apache.org> wrote:
>> Your packaging is slingfeature, so this in the main artifact - in maven
>> you usually don't use a classifier for the main artifact..
> 
> Ah ok, thanks - the problem is that Crankstart needs to know that that
> artifact is a slingfeature, based on its Maven coordinates, what's the
> best way to do that?
> 
> Other utilities working with provisioning model artifacts might have
> the same requirement - you get a bunch of Maven artifact URLs and need
> to sort them out into bundles, Sling provisioning models, etc.
> 

Yes, that's what the type is used for, so  in your model you have
  {groupId}/{artifactId}/{version}/slingfeature

This is what the slingstart maven plugin is searching for.

It also handles
  {groupId}/{artifactId}/{version}/slingstart
As the main artifact for a slingstart is the jar, the maven plugin
automatically sets the classifier to "slingfeature" in this case.
Makes it very easier to use in the provisioning model.


Carsten
-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Bertrand Delacretaz <bd...@apache.org>.
On Mon, Jun 15, 2015 at 3:12 PM, Carsten Ziegeler <cz...@apache.org> wrote:
> Your packaging is slingfeature, so this in the main artifact - in maven
> you usually don't use a classifier for the main artifact..

Ah ok, thanks - the problem is that Crankstart needs to know that that
artifact is a slingfeature, based on its Maven coordinates, what's the
best way to do that?

Other utilities working with provisioning model artifacts might have
the same requirement - you get a bunch of Maven artifact URLs and need
to sort them out into bundles, Sling provisioning models, etc.

-Bertrand

Re: slingstart plugin: deployed artifact does not have "slingfeature" classifier?

Posted by Carsten Ziegeler <cz...@apache.org>.
Your packaging is slingfeature, so this in the main artifact - in maven
you usually don't use a classifier for the main artifact

Carsten

Am 15.06.15 um 15:07 schrieb Bertrand Delacretaz:
> Hi,
> 
> I have created a module with packaging=slingfeature at [1], used in
> Crankstart testing.
> 
> Shouldn't my provisioning model's txt file be deployed with the
> "slingfeature" classfier?
> 
> It looks like it doesn't have a classifier:
> 
>   [INFO] Installing
> ....m2/repository/org/apache/sling/org.apache.sling.cransktart.test.model/1.9.9-SNAPSHOT/org.apache.sling.cransktart.test.model-1.9.9-SNAPSHOT.txt
>   [INFO] ...org.apache.sling.cransktart.test.model-1.9.9-SNAPSHOT.pom
>   [INFO] ...org.apache.sling.cransktart.test.model-1.9.9-SNAPSHOT-sources.jar
> 
> -Bertrand
> 
> [1] https://svn.apache.org/repos/asf/sling/trunk/contrib/crankstart/test-model
> 


-- 
Carsten Ziegeler
Adobe Research Switzerland
cziegeler@apache.org