You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@servicemix.apache.org by Scott Came <sc...@search.org> on 2011/06/21 21:09:47 UTC

Resource-only bundles

Is there an example somewhere of a bundle project that includes only resources (no Java classes) to make them available to other bundles?

I have a file a.txt.  I put it in src/main/resources/dir1/dir2/a.txt.  Then I put this in my pom:

	<build>
		<defaultGoal>install</defaultGoal>
		<plugins>
			<plugin>
				<groupId>org.apache.felix</groupId>
				<artifactId>maven-bundle-plugin</artifactId>
				<extensions>true</extensions>
				<configuration>
					<instructions>
						<Export-Package>dir1/dir2</Export-Package>
					</instructions>
				</configuration>
			</plugin>
		</plugins>
	</build>

My intention is then to import this package in another bundle, then within Java code in that other bundle use Pax Classpath to get a stream to a.txt and process from there.

But I am blocked at creating the bundle.  When I do a mvn install on the above project/pom, it builds the bundle just fine, and puts dir1/dir2/a.txt in the bundle jar.  But there is no Export Package header in the manifest.  And as you'd expect after I install the bundle and do "headers [bundleid]" I do not see an Export-Package header there.

Any ideas as to what I'm doing wrong?

Thanks.
--Scott

RE: Resource-only bundles

Posted by Scott Came <sc...@search.org>.
Yes, dots instead of slashes did the trick.  Thanks for the help.

-----Original Message-----
From: Gert Vanthienen [mailto:gert.vanthienen@gmail.com] 
Sent: Thursday, June 23, 2011 1:13 AM
To: users@servicemix.apache.org
Subject: Re: Resource-only bundles

L.S.,

Could you try using dir1.dir2 for the Export-Package configuration instruction?  Don't have anything here to try it myself first, but I think that's how we export other configuration entries in our own bundles.

Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



On Tue, Jun 21, 2011 at 9:09 PM, Scott Came <sc...@search.org> wrote:
> Is there an example somewhere of a bundle project that includes only resources (no Java classes) to make them available to other bundles?
>
> I have a file a.txt.  I put it in src/main/resources/dir1/dir2/a.txt.  Then I put this in my pom:
>
>        <build>
>                <defaultGoal>install</defaultGoal>
>                <plugins>
>                        <plugin>
>                                <groupId>org.apache.felix</groupId>
>                                
> <artifactId>maven-bundle-plugin</artifactId>
>                                <extensions>true</extensions>
>                                <configuration>
>                                        <instructions>
>                                                
> <Export-Package>dir1/dir2</Export-Package>
>                                        </instructions>
>                                </configuration>
>                        </plugin>
>                </plugins>
>        </build>
>
> My intention is then to import this package in another bundle, then within Java code in that other bundle use Pax Classpath to get a stream to a.txt and process from there.
>
> But I am blocked at creating the bundle.  When I do a mvn install on the above project/pom, it builds the bundle just fine, and puts dir1/dir2/a.txt in the bundle jar.  But there is no Export Package header in the manifest.  And as you'd expect after I install the bundle and do "headers [bundleid]" I do not see an Export-Package header there.
>
> Any ideas as to what I'm doing wrong?
>
> Thanks.
> --Scott
>



Re: Resource-only bundles

Posted by Gert Vanthienen <ge...@gmail.com>.
L.S.,

Could you try using dir1.dir2 for the Export-Package configuration
instruction?  Don't have anything here to try it myself first, but I
think that's how we export other configuration entries in our own
bundles.

Regards,

Gert Vanthienen
------------------------
FuseSource
Web: http://fusesource.com
Blog: http://gertvanthienen.blogspot.com/



On Tue, Jun 21, 2011 at 9:09 PM, Scott Came <sc...@search.org> wrote:
> Is there an example somewhere of a bundle project that includes only resources (no Java classes) to make them available to other bundles?
>
> I have a file a.txt.  I put it in src/main/resources/dir1/dir2/a.txt.  Then I put this in my pom:
>
>        <build>
>                <defaultGoal>install</defaultGoal>
>                <plugins>
>                        <plugin>
>                                <groupId>org.apache.felix</groupId>
>                                <artifactId>maven-bundle-plugin</artifactId>
>                                <extensions>true</extensions>
>                                <configuration>
>                                        <instructions>
>                                                <Export-Package>dir1/dir2</Export-Package>
>                                        </instructions>
>                                </configuration>
>                        </plugin>
>                </plugins>
>        </build>
>
> My intention is then to import this package in another bundle, then within Java code in that other bundle use Pax Classpath to get a stream to a.txt and process from there.
>
> But I am blocked at creating the bundle.  When I do a mvn install on the above project/pom, it builds the bundle just fine, and puts dir1/dir2/a.txt in the bundle jar.  But there is no Export Package header in the manifest.  And as you'd expect after I install the bundle and do "headers [bundleid]" I do not see an Export-Package header there.
>
> Any ideas as to what I'm doing wrong?
>
> Thanks.
> --Scott
>