You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Peter Kriens <Pe...@aQute.biz> on 2007/08/13 18:06:41 UTC
Re[6]: Bug in maven-bundle-plugin?
I could filter it out but they can only come from the bundle plugin. I
read the properties and manifest with proper readers that will not
allow the newline, at least not accidentally. So I suggest to clean it
up before the values are set?
Kind regards,
Peter Kriens
SM> Actually there is a problem with the manifest, but it's not
SM> initially obvious unless you open it using Linux.
SM> Here's a similar example, note that there's a Unix newline that's
SM> not followed by a space on the next line:
SM> Include-Resource: foo=bar,
SM> zzz=bar^M
SM> Perhaps this is a defect in the Java manifest writer? (not checking for embedded newlines?)
SM> Either way, there's a simple solution (strip out newlines) which
SM> could be done in the bundle plugin or BND...
SM> On 13/08/07, Peter Kriens <Pe...@aqute.biz> wrote:
SM> You're too good :-) The only strange thing I saw was actually the
SM> tabs, but I can't imagine they are not allowed.
SM> Kind regards,
SM> Peter Kriens
SM>> On 13/08/07, Peter Kriens < Peter.Kriens@aqute.biz> wrote: Hmm. I
SM>> am generating the manifest with the java.util.jar.Manifest
SM>> class. Are you sure this is not a parsing error in the Felix manifest?
SM>> Actually I think Tom said his target platform was Equinox, so it could
SM>> either be a parser error there, or perhaps in Eclipse/PDE - which I've
SM>> found to occasionally report problems with valid (but non-standard)
SM>> manifests...
SM>> I'll run some tests locally and see what happens
SM>> Kind regards,
SM>> Peter Kriens
SM>>> On 03/08/07, Dewire, Tom < TDewire@ea.com> wrote:
>>>> I'm using the 1.0.0 maven-bundle-plugin. It appears to be generating an
>>>> invalid manifest file when using the <Include-Resource> tag. More
>>>> specifically, it appears to not be stripping out the whitespace. Placing
>>>> the entire contents of the <Include-Resource> on one line eliminates the
>>>> problem.
SM>>> Could you open an issue against the "Maven Bundle Plugin" component:
SM>>> http://issues.apache.org/jira/browse/FELIX
SM>>> and attach both the pom.xml and generated manifest.
SM>>> stripping whitespace could be done in the plugin before the directive is
SM>>> passed to BND - or alternatively BND itself could handle directives with
SM>>> spurious whitespace (this could benefit more users of BND).
SM>>> tbtw, there is a users mailing list - you can subscribe over at:
SM>>> http://cwiki.apache.org/FELIX/mailinglists.html
SM>>> but it doesn't have much traffic at the moment.
>>>>
>>>> Although I'm using felix for making the bundle, the target OSGI
>>>> implementation is Equinox.
>>>>
>>>> I apologize if using the "dev" list for this question is inappropriate.
>>>> I couldn't determine if there was also a "users" list (or something
>>>> similar) in use. If so, I'd also love to get on it.
>>>>
>>>> --Tom DeWire
>>>>
>>>> A quick view of the generated manifest:
>>>>
>>>> === start ===
>>>> Manifest-Version: 1.0
>>>> Created-By: 1.5.0_06 (Sun Microsystems Inc.)
>>>> Bundle-Activator: com.ea.nucleus.http.simple.probe.Activator
>>>> Import-Package: com.ea.nucleus.configuration ;version="[1,2)", com.ea.nu
>>>>cleus.http.simple.common;version="[2,3)",com.ea.nucleus.routing;versi
>>>>on="[1,3)",org.apache.commons.logging ;version="[1.1,2)",org.osgi.fram
>>>>ework;version= 1.3,simple.http;version=3.1.3
>>>> Include-Resource: {src\main\resources},
>>>>@target\dependencies\sp
>>>>ring-core.jar ,
>>>>@target\dependencies\spring-beans.jar,
>>>>@
>>>>target\dependencies\spring-context.jar,
>>>>@target\dependencies\c
>>>>onfiguration.spring.jar
>>>> === lots more below here ===
>>>>
>>>> My plugin configuration looks like this:
>>>>
>>>> === lots more above here ===
>>>>
>>>> <!-- This will perform the actual bundling -->
>>>><plugin>
>>>> <groupId>org.apache.felix</groupId>
>>>> <artifactId>maven-bundle-plugin</artifactId>
>>>> <version>1.0.0</version>
>>>> <extensions>true</extensions>
>>>> <configuration>
>>>><instructions>
>>>> <Bundle-Name>${groupId}.${pom.artifactId}</Bundle-Name>
>>>>
>>>> <Bundle-SymbolicName>${groupId}.${ pom.artifactId}</Bundle-SymbolicName>
>>>>
>>>> <Bundle-Activator>com.ea.nucleus.http.simple.probe.Activator</Bundle-Act
>>>> ivator>
>>>> <Import-Package>
>>>>org.osgi.framework,
>>>> org.apache.commons.logging;version="[1.1,2)",
>>>>com.ea.nucleus.configuration;version="[1,2)",
>>>>com.ea.nucleus.routing;version="[1,3)",
>>>>com.ea.nucleus.http.simple.common ;version="[2,3)",
>>>>simple.http*;version="3.1.3",
>>>>!*
>>>> </Import-Package>
>>>> <Export-Package>
>>>>!*
>>>> </Export-Package>
>>>> <Private-Package>
>>>>com.ea.nucleus.http.simple.probe
>>>> </Private-Package>
>>>> <Include-Resource>
>>>>{src\main\resources},
>>>>@target\dependencies\spring-core.jar,
>>>>@target\dependencies\spring-beans.jar,
>>>>@target\dependencies\spring-context.jar,
>>>>@target\dependencies\configuration.spring.jar
>>>> </Include-Resource>
>>>></instructions>
>>>> </configuration>
>>>></plugin>
>>>>
>>>> === lots more below here ===
>>>>
SM>>
SM>> --
SM>> Peter KriensTel +33467542167
SM>> 9C, Avenue St. DrézéryAOL,Yahoo: pkriens
SM>> 34160 Beaulieu, FranceICQ 255570717
SM>> Skype pkriens Fax +1 8153772599
SM>
SM> --
SM> Peter Kriens Tel +33467542167
SM> 9C, Avenue St. Drézéry AOL,Yahoo: pkriens
SM> 34160 Beaulieu, France ICQ 255570717
SM> Skype pkriens Fax +1 8153772599
--
Peter Kriens Tel +33467542167
9C, Avenue St. Drézéry AOL,Yahoo: pkriens
34160 Beaulieu, France ICQ 255570717
Skype pkriens Fax +1 8153772599
Re: Re[6]: Bug in maven-bundle-plugin?
Posted by Stuart McCulloch <st...@jayway.net>.
On 14/08/07, Peter Kriens <Pe...@aqute.biz> wrote:
>
> I could filter it out but they can only come from the bundle plugin. I
> read the properties and manifest with proper readers that will not
> allow the newline, at least not accidentally. So I suggest to clean it
> up before the values are set?
sure, no problem
Kind regards,
>
> Peter Kriens
>
>
> SM> Actually there is a problem with the manifest, but it's not
> SM> initially obvious unless you open it using Linux.
> SM> Here's a similar example, note that there's a Unix newline that's
> SM> not followed by a space on the next line:
>
> SM> Include-Resource: foo=bar,
> SM> zzz=bar^M
>
> SM> Perhaps this is a defect in the Java manifest writer? (not checking
> for embedded newlines?)
>
> SM> Either way, there's a simple solution (strip out newlines) which
> SM> could be done in the bundle plugin or BND...
>
> SM> On 13/08/07, Peter Kriens <Pe...@aqute.biz> wrote:
> SM> You're too good :-) The only strange thing I saw was actually the
> SM> tabs, but I can't imagine they are not allowed.
>
> SM> Kind regards,
>
> SM> Peter Kriens
>
> SM>> On 13/08/07, Peter Kriens < Peter.Kriens@aqute.biz> wrote: Hmm. I
> SM>> am generating the manifest with the java.util.jar.Manifest
> SM>> class. Are you sure this is not a parsing error in the Felix
> manifest?
>
> SM>> Actually I think Tom said his target platform was Equinox, so it
> could
> SM>> either be a parser error there, or perhaps in Eclipse/PDE - which
> I've
> SM>> found to occasionally report problems with valid (but non-standard)
> SM>> manifests...
>
> SM>> I'll run some tests locally and see what happens
>
> SM>> Kind regards,
>
> SM>> Peter Kriens
>
> SM>>> On 03/08/07, Dewire, Tom < TDewire@ea.com> wrote:
> >>>> I'm using the 1.0.0 maven-bundle-plugin. It appears to be generating
> an
> >>>> invalid manifest file when using the <Include-Resource> tag. More
> >>>> specifically, it appears to not be stripping out the whitespace.
> Placing
> >>>> the entire contents of the <Include-Resource> on one line eliminates
> the
> >>>> problem.
>
> SM>>> Could you open an issue against the "Maven Bundle Plugin" component:
>
> SM>>> http://issues.apache.org/jira/browse/FELIX
>
> SM>>> and attach both the pom.xml and generated manifest.
>
> SM>>> stripping whitespace could be done in the plugin before the
> directive is
> SM>>> passed to BND - or alternatively BND itself could handle directives
> with
> SM>>> spurious whitespace (this could benefit more users of BND).
>
> SM>>> tbtw, there is a users mailing list - you can subscribe over at:
>
> SM>>> http://cwiki.apache.org/FELIX/mailinglists.html
>
> SM>>> but it doesn't have much traffic at the moment.
>
> >>>>
> >>>> Although I'm using felix for making the bundle, the target OSGI
> >>>> implementation is Equinox.
> >>>>
> >>>> I apologize if using the "dev" list for this question is
> inappropriate.
> >>>> I couldn't determine if there was also a "users" list (or something
> >>>> similar) in use. If so, I'd also love to get on it.
> >>>>
> >>>> --Tom DeWire
> >>>>
> >>>> A quick view of the generated manifest:
> >>>>
> >>>> === start ===
> >>>> Manifest-Version:1.0
> >>>> Created-By: 1.5.0_06 (Sun Microsystems Inc.)
> >>>> Bundle-Activator: com.ea.nucleus.http.simple.probe.Activator
> >>>> Import-Package: com.ea.nucleus.configuration ;version="[1,2)",
> com.ea.nu
> >>>>cleus.http.simple.common;version="[2,3)",com.ea.nucleus.routing;versi
> >>>>on="[1,3)",org.apache.commons.logging ;version="[1.1,2)",org.osgi.fram
> >>>>ework;version= 1.3,simple.http;version=3.1.3
> >>>> Include-Resource: {src\main\resources},
> >>>>@target\dependencies\sp
> >>>>ring-core.jar ,
> >>>>@target\dependencies\spring-beans.jar,
> >>>>@
> >>>>target\dependencies\spring-context.jar,
> >>>>@target\dependencies\c
> >>>>onfiguration.spring.jar
> >>>> === lots more below here ===
> >>>>
> >>>> My plugin configuration looks like this:
> >>>>
> >>>> === lots more above here ===
> >>>>
> >>>> <!-- This will perform the actual bundling -->
> >>>><plugin>
> >>>> <groupId>org.apache.felix</groupId>
> >>>> <artifactId>maven-bundle-plugin</artifactId>
> >>>> <version>1.0.0</version>
> >>>> <extensions>true</extensions>
> >>>> <configuration>
> >>>><instructions>
> >>>> <Bundle-Name>${groupId}.${pom.artifactId}</Bundle-Name>
> >>>>
> >>>> <Bundle-SymbolicName>${groupId}.${ pom.artifactId
> }</Bundle-SymbolicName>
> >>>>
> >>>> <Bundle-Activator>com.ea.nucleus.http.simple.probe.Activator
> </Bundle-Act
> >>>> ivator>
> >>>> <Import-Package>
> >>>>org.osgi.framework,
> >>>> org.apache.commons.logging;version="[1.1,2)",
> >>>>com.ea.nucleus.configuration;version="[1,2)",
> >>>>com.ea.nucleus.routing;version="[1,3)",
> >>>>com.ea.nucleus.http.simple.common ;version="[2,3)",
> >>>>simple.http*;version="3.1.3",
> >>>>!*
> >>>> </Import-Package>
> >>>> <Export-Package>
> >>>>!*
> >>>> </Export-Package>
> >>>> <Private-Package>
> >>>>com.ea.nucleus.http.simple.probe
> >>>> </Private-Package>
> >>>> <Include-Resource>
> >>>>{src\main\resources},
> >>>>@target\dependencies\spring-core.jar,
> >>>>@target\dependencies\spring-beans.jar,
> >>>>@target\dependencies\spring-context.jar,
> >>>>@target\dependencies\configuration.spring.jar
> >>>> </Include-Resource>
> >>>></instructions>
> >>>> </configuration>
> >>>></plugin>
> >>>>
> >>>> === lots more below here ===
> >>>>
> SM>>
>
>
>
> SM>> --
> SM>> Peter KriensTel +33467542167
> SM>> 9C, Avenue St. DrézéryAOL,Yahoo: pkriens
> SM>> 34160 Beaulieu, FranceICQ 255570717
> SM>> Skype pkriens Fax +1 8153772599
>
> SM>
>
>
>
>
>
> SM> --
> SM> Peter KriensTel +33467542167
> SM> 9C, Avenue St. DrézéryAOL,Yahoo: pkriens
> SM> 34160 Beaulieu, FranceICQ 255570717
> SM> Skype pkriens Fax +1 8153772599
>
>
>
>
>
>
>
> --
> Peter Kriens Tel +33467542167
> 9C, Avenue St. Drézéry AOL,Yahoo: pkriens
> 34160 Beaulieu, France ICQ 255570717
> Skype pkriens Fax +1 8153772599
>
>
--
Cheers, Stuart