You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Saminda Abeyruwan <sa...@gmail.com> on 2008/05/13 22:23:01 UTC
Include resource in maven-bundle-plugin
Hi Devs,
In my pom.xml I have a dependency to a zip file
<dependency>
<groupId>foo</groupId>
<artifactId>bar</artifactId>
<version>SNAPSHOT</version>
<type>zip</type>
</dependency>
This zip file contains resource inside META-INF/rr directory,
Following line is present in maven-bundle-pluing
<Include-Resource>
@bar-SNAPSHOT.zip!/META-INF/rr/*
</Include-Resource>
But the build fails saying
Can not find JAR file bar-SNAPSHOT.zip
[ERROR] Error(s) found in bundle configuration
Is there a way provide a zip file to this location.
Thank you!
Saminda
--
Saminda Abeyruwan
Senior Software Engineer
WSO2 Inc. - www.wso2.org
Re: OBR local resource resolving
Posted by "Richard S. Hall" <he...@ungoverned.org>.
Do I understand correctly that you have a requirement that filters on
symbolicname name, but it not being correctly evaluated? Perhaps you
could show what you are doing as opposed to what you think needs to be
fixed...
In short, requirements are only satisfied by capabilities.
-> richard
Roshan Punnoose wrote:
> I am trying to deploy a repository xml through OBR and I noticed that my
> <require> tags do not work if I am using the "symbolicname" filter. Looking
> through the code, it looks like the LocalRepositoryImpl is adding the header
> properties: symbolicName, version, etc, to the Resource directly, and the
> import package information is being added as capabilities. However, the
> ResolverImpl only looks through the LocalRepositoryImpl's capabilities and
> not the Resource map directly.
>
> Here is the current code:
>
> private List searchLocalResources(Requirement req)
> {
> List matchingCandidates = new ArrayList();
> Resource[] resources = m_local.getResources();
> for (int resIdx = 0; (resources != null) && (resIdx <
> resources.length); resIdx++)
> {
> Capability[] caps = resources[resIdx].getCapabilities();
> for (int capIdx = 0; (caps != null) && (capIdx < caps.length);
> capIdx++)
> {
> if (req.isSatisfied(caps[capIdx]))
> {
> matchingCandidates.add(resources[resIdx]);
> }
> }
> }
>
> return matchingCandidates;
> }
>
>
> Shouldn't the code actually check if the Requirement (req) is satisfied by
> the Resource map (the one that holds the header information: symbolicname,
> version) also, instead of only the capability?
>
> Roshan
>
>
>
OBR local resource resolving
Posted by Roshan Punnoose <rp...@proteus-technologies.com>.
I am trying to deploy a repository xml through OBR and I noticed that my
<require> tags do not work if I am using the "symbolicname" filter. Looking
through the code, it looks like the LocalRepositoryImpl is adding the header
properties: symbolicName, version, etc, to the Resource directly, and the
import package information is being added as capabilities. However, the
ResolverImpl only looks through the LocalRepositoryImpl's capabilities and
not the Resource map directly.
Here is the current code:
private List searchLocalResources(Requirement req)
{
List matchingCandidates = new ArrayList();
Resource[] resources = m_local.getResources();
for (int resIdx = 0; (resources != null) && (resIdx <
resources.length); resIdx++)
{
Capability[] caps = resources[resIdx].getCapabilities();
for (int capIdx = 0; (caps != null) && (capIdx < caps.length);
capIdx++)
{
if (req.isSatisfied(caps[capIdx]))
{
matchingCandidates.add(resources[resIdx]);
}
}
}
return matchingCandidates;
}
Shouldn't the code actually check if the Requirement (req) is satisfied by
the Resource map (the one that holds the header information: symbolicname,
version) also, instead of only the capability?
Roshan
Re: Include resource in maven-bundle-plugin
Posted by Saminda Abeyruwan <sa...@gmail.com>.
Hi Stuart,
Thank you for the reply. I really appreciate it. If the filtering mechanism
could be given for <Embed-Dependency/> whether the artifact is a jar etc,
that would be really helpful. I'll raise a JIRA on this.
Thank you!
Saminda
> <http://jira.codehaus.org/browse/MNG-1683>
>
> however, you could try inlining this artifact using Embed-Dependency:
>
> <Embed-Dependency>bar;inline=true</Embed-Dependency>
>
> unfortunately at the moment this will inline the complete zip - it won't
> allow you to select a subset of the zip, although this feature could be
> added - feel free to raise an feature request for this at:
>
> http://issues.apache.org/jira/browse/FELIX/component/12311143
>
> you can find more details about Embed-Dependency here:
>
> http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
>
> HTH
>
> Is there a way provide a zip file to this location.
> >
> >
> > Thank you!
> >
> > Saminda
> >
> > --
> > Saminda Abeyruwan
> >
> > Senior Software Engineer
> > WSO2 Inc. - www.wso2.org
> >
>
>
>
> --
> Cheers, Stuart
>
--
Saminda Abeyruwan
Senior Software Engineer
WSO2 Inc. - www.wso2.org
Re: Include resource in maven-bundle-plugin
Posted by Stuart McCulloch <st...@jayway.net>.
2008/5/14 Saminda Abeyruwan <sa...@gmail.com>:
> Hi Devs,
>
> In my pom.xml I have a dependency to a zip file
>
> <dependency>
> <groupId>foo</groupId>
> <artifactId>bar</artifactId>
> <version>SNAPSHOT</version>
> <type>zip</type>
> </dependency>
>
> This zip file contains resource inside META-INF/rr directory,
>
> Following line is present in maven-bundle-pluing
>
> <Include-Resource>
> @bar-SNAPSHOT.zip!/META-INF/rr/*
> </Include-Resource>
>
> But the build fails saying
>
> Can not find JAR file bar-SNAPSHOT.zip
> [ERROR] Error(s) found in bundle configuration
>
yes, I tried this just now and it looks like Maven doesn't add the 'zip'
artifact to the compilation classpath, which is why Bnd can't find it.
according to this issue, zipfile support is in Maven 2.1 but not 2.0.x:
http://jira.codehaus.org/browse/MNG-1683
however, you could try inlining this artifact using Embed-Dependency:
<Embed-Dependency>bar;inline=true</Embed-Dependency>
unfortunately at the moment this will inline the complete zip - it won't
allow you to select a subset of the zip, although this feature could be
added - feel free to raise an feature request for this at:
http://issues.apache.org/jira/browse/FELIX/component/12311143
you can find more details about Embed-Dependency here:
http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html
HTH
Is there a way provide a zip file to this location.
>
>
> Thank you!
>
> Saminda
>
> --
> Saminda Abeyruwan
>
> Senior Software Engineer
> WSO2 Inc. - www.wso2.org
>
--
Cheers, Stuart