You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Costin Caraivan <cc...@axway.com> on 2008/11/26 18:33:44 UTC

Problems with jar signing

Hello,

I'm building some Eclipse plug ins with Maven, and because of the
requirements, I'm not using the Felix bundle plug in, I'm making the bundle
using some Ant tasks, the dependency:copy goal and some other things.

I'm trying to:
- compile the classes (target/classes)
- jar them and put the jar in another folder
(target/osgi-bundle-symbolic-name/jarname.jar)
- sign the resulting jar (I don't change the name)

I'm copying the key store at the process-resources phase, and I'm making the
jar at the compile phase.

However, jar signing does not work:
________________________________________________________

[INFO] [jar:sign {execution: jar-classes}]
[DEBUG] Not executing jar:sign as the project is not a Java module
________________________________________________________

Project packaging is zip, it's basically an OSGi unpacked bundle put in a
zip: a folder which has a jar, a META-INF folder, and some other things in
there.

Any ideas? I found some bug reports regarding something similar, but I'm not
sure they're related.
http://jira.codehaus.org/browse/MJAR-20

I do have the target/classes folder at compile time, it looks like something
in the check is wrong. Are there any workarounds?

PS: I know about making a different module for the jar itself, I don't
really want to pollute the project structure with additional folders, I
already have 70. If I make 30 more, it will be even more confusing. I
believe I will still have to make an additional module, because I might have
to publish the simple jar too...
However, does anyone know if I can make it work without additional modules?

Thank you,
Costin.
-- 
View this message in context: http://www.nabble.com/Problems-with-jar-signing-tp20705582p20705582.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problems with jar signing

Posted by Costin Caraivan <cc...@axway.com>.
I'll rephrase the question: can I sign a jar using Maven, if that jar is not
the final package of the project?

0. Compile some .java files -> compile phase of the artifact build.
1. Jar the resulting classes -> compile phase of the artifact build.
2. Sign the jar -> compile phase of the artifact build.
3. Move the jar somewhere in /target/classes -> process-classes phase of the
artifact build.
4. Package /target/classes (including the jar) as a zip -> package phase of
the artifact build.

So this includes just 1 build lifecycle.

Right now I get:
________________________________________________________

[INFO] [jar:sign {execution: jar-classes}]
[DEBUG] Not executing jar:sign as the project is not a Java module
________________________________________________________ 

Right now I think I have 2 options:
1. make a different artifact for the jar, which I'll include in the zip
(makes the build more complex).
2. use Ant, called from antrun, to sign the jar.

Any other workarounds for this?

Regards,
Costin.
-- 
View this message in context: http://www.nabble.com/Problems-with-jar-signing-tp20705582p20719492.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problems with jar signing

Posted by Costin Caraivan <cc...@axway.com>.
If you had read my first mail, you would have noticed that I'm making a jar
and I'm putting it in a zip.

And I want to sign the jar, not the zip file.

Regards,
Costin.


Wayne Fay wrote:
> 
> On Wed, Nov 26, 2008 at 11:39 PM, Costin Caraivan <cc...@axway.com>
> wrote:
>>
>> "Project packaging is zip"
>>
>> So, zip it is :)
> 
> Is it simply your assumption, or are your certain that the jar:sign
> mojo has the ability to deal with zips?
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-with-jar-signing-tp20705582p20715653.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problems with jar signing

Posted by Wayne Fay <wa...@gmail.com>.
On Wed, Nov 26, 2008 at 11:39 PM, Costin Caraivan <cc...@axway.com> wrote:
>
> "Project packaging is zip"
>
> So, zip it is :)

Is it simply your assumption, or are your certain that the jar:sign
mojo has the ability to deal with zips?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problems with jar signing

Posted by Costin Caraivan <cc...@axway.com>.
"Project packaging is zip"

So, zip it is :)

Wayne Fay wrote:
> 
>> [INFO] [jar:sign {execution: jar-classes}]
>> [DEBUG] Not executing jar:sign as the project is not a Java module
> 
> What packaging is defined in the module's pom file?
> 
> Wayne
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Problems-with-jar-signing-tp20705582p20714740.html
Sent from the Maven - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Problems with jar signing

Posted by Wayne Fay <wa...@gmail.com>.
> [INFO] [jar:sign {execution: jar-classes}]
> [DEBUG] Not executing jar:sign as the project is not a Java module

What packaging is defined in the module's pom file?

Wayne

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org