You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by "Valentin Valchev (JIRA)" <ji...@apache.org> on 2016/03/29 14:24:25 UTC

[jira] [Comment Edited] (FELIX-5227) Created manifest files do not end with newline

    [ https://issues.apache.org/jira/browse/FELIX-5227?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15215921#comment-15215921 ] 

Valentin Valchev edited comment on FELIX-5227 at 3/29/16 12:23 PM:
-------------------------------------------------------------------

Hello Kai,
IMHO the problem is not only the bundle plugin. I've experienced similar issues, when embedding signed jars inlined.

I've looked at your code:
https://github.com/eclipse/californium/blob/master/californium-osgi/pom.xml

The line that causes the problem is:
{code}
<Embed-Dependency>californium-core;inline=true,element-connector;inline=!about.html</Embed-Dependency>
{code}

When you inlined the dependency, probably it already has own signature files. Those files are incomplete as they include one part of the embedded classes. But in order to have a valid signed jar all entries must be signed.

In order to fix that problem you could:
* not inline the jar files (which is good, because you will also see the embedded artifact versions)
* when inlining the files, also exclude all META-INF/*.SF,META-INF/*.RSA

If you do the above, you will be able to sign your bundle successfully.



was (Author: v_valchev):
Hello Kai,
IMHOthe problem is not the bundle plugin. I've experienced similar issues, when embedding signed jars inlined.

I've looked at your code:
https://github.com/eclipse/californium/blob/master/californium-osgi/pom.xml

The line that causes the problem is:
{code}
<Embed-Dependency>californium-core;inline=true,element-connector;inline=!about.html</Embed-Dependency>
{code}

When you inlined the dependency, probably it already has own signature files. Those files are incomplete as they include one part of the embedded classes. But in order to have a valid signed jar all entries must be signed.

In order to fix that problem you could:
* not inline the jar files (which is good, because you will also see the embedded artifact versions)
* when inlining the files, also exclude all META-INF/*.SF,META-INF/*.RSA

If you do the above, you will be able to sign your bundle successfully.


> Created manifest files do not end with newline
> ----------------------------------------------
>
>                 Key: FELIX-5227
>                 URL: https://issues.apache.org/jira/browse/FELIX-5227
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-3.0.1
>         Environment: Linux
>            Reporter: Kai Hudalla
>         Attachments: californium-osgi-1.0.4-20160326.145623-2.jar
>
>
> Manifest files created by the maven bundle plugin do not end with a newline character. This is problematic when signing a bundle containing such a Manifest because the jarsigner tool then fails to insert an empty line between the last entry in the Manifest created by the bundle plugin (in my case the line containing the *tool:* header) and the first entry for signed files contained in the bundle.
> When later verifying such a signed bundle this results in jarsigner issuing a warning that the jar contains files for which no signature exists which I assume is because of the missing empty line.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)