You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Rob Dickens <ar...@googlemail.com> on 2009/03/02 18:49:33 UTC

jar:sign refuses to sign jar artifact of project with custom packaging type

I get the following message when mvn is run with the -X option:

[DEBUG] Not executing jar:sign as the project is not a Java module

(Am using a custom packaging type in order to use a custom lifecycle, that
invokes a custom goal before the jar:jar one.)

If I change the packaging type back to jar, jar:sign does sign the artifact.

Could anyone please help.

Thanks.

-- 
Rob, Lafros.com

Re: jar:sign refuses to sign jar artifact of project with custom packaging type

Posted by Rob Dickens <ar...@googlemail.com>.
alternatively (and probably preferably), it looks like you need to configure
the ~.ArtifactHandler role (as well as the ~.LifecycleMapping one) in the
components.xml.

2009/3/3 Rob Dickens <ar...@googlemail.com>

> Okay - after some google codesearching, and minimal testing, the following
> appears to address the problem:
>
> In the execute() of the Mojo for the goal which precedes the jar:jar one,
> add the following:
>
> project.getArtifact().setArtifactHandler(new MyArtifactHandler());
>
> where MyArtifactHandler is defined as extending
> org.apache.maven.artifact.handler.DefaultArtifactHandler, so as to override
> the getLanguage() method with a version which returns "java".
>
> One or two pom.xml mods are also required, to ensure that ".jar" is used
> instead of .${project.packaging}.
>
> Please could anyone knowledgeable comment on the above. I don't remember
> seeing this in any instructions for writing plug-ins.
>
> 2009/3/3 Wayne Fay <wa...@gmail.com>
>
>> > same story with the new mvn 2.0.10
>>
>> > maven-jar-plugin is at 2.2
>> >
>> > Has no one else seen this?
>>
>> In all likelihood, you're one of the first people to try using
>> jar:sign on a custom artifact. So it might be a little painful to get
>> it working, and may involve changing some code in the Jar plugin. Once
>> you do, please do post back for future people who want to do the same
>> thing, and contribute the code changes back via Jira.
>>
>> Wayne
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> --
> Rob, Lafros.com
>

Re: jar:sign refuses to sign jar artifact of project with custom packaging type

Posted by Rob Dickens <ar...@googlemail.com>.
Okay - after some google codesearching, and minimal testing, the following
appears to address the problem:

In the execute() of the Mojo for the goal which precedes the jar:jar one,
add the following:

project.getArtifact().setArtifactHandler(new MyArtifactHandler());

where MyArtifactHandler is defined as extending
org.apache.maven.artifact.handler.DefaultArtifactHandler, so as to override
the getLanguage() method with a version which returns "java".

One or two pom.xml mods are also required, to ensure that ".jar" is used
instead of .${project.packaging}.

Please could anyone knowledgeable comment on the above. I don't remember
seeing this in any instructions for writing plug-ins.

2009/3/3 Wayne Fay <wa...@gmail.com>

> > same story with the new mvn 2.0.10
> > maven-jar-plugin is at 2.2
> >
> > Has no one else seen this?
>
> In all likelihood, you're one of the first people to try using
> jar:sign on a custom artifact. So it might be a little painful to get
> it working, and may involve changing some code in the Jar plugin. Once
> you do, please do post back for future people who want to do the same
> thing, and contribute the code changes back via Jira.
>
> Wayne
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Rob, Lafros.com

Re: jar:sign refuses to sign jar artifact of project with custom packaging type

Posted by Wayne Fay <wa...@gmail.com>.
> same story with the new mvn 2.0.10
> maven-jar-plugin is at 2.2
>
> Has no one else seen this?

In all likelihood, you're one of the first people to try using
jar:sign on a custom artifact. So it might be a little painful to get
it working, and may involve changing some code in the Jar plugin. Once
you do, please do post back for future people who want to do the same
thing, and contribute the code changes back via Jira.

Wayne

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


Re: jar:sign refuses to sign jar artifact of project with custom packaging type

Posted by Rob Dickens <ar...@googlemail.com>.
same story with the new mvn 2.0.10
maven-jar-plugin is at 2.2

Has no one else seen this?

2009/3/2 Rob Dickens <ar...@googlemail.com>

> I get the following message when mvn is run with the -X option:
>
> [DEBUG] Not executing jar:sign as the project is not a Java module
>
> (Am using a custom packaging type in order to use a custom lifecycle, that
> invokes a custom goal before the jar:jar one.)
>
> If I change the packaging type back to jar, jar:sign does sign the
> artifact.
>
> Could anyone please help.
>
> Thanks.
>
> --
> Rob, Lafros.com
>

RE: sign refuses to sign jar artifact of project with custom packaging type

Posted by "Brian E. Fox" <br...@reply.infinity.nu>.
Seems like the plugin itself needs to be changed to allow for this. It
should look at the type of the file, not the packaging.

-----Original Message-----
From: Rob Dickens [mailto:arctic.bob@googlemail.com] 
Sent: Monday, March 02, 2009 12:50 PM
To: users@maven.apache.org
Subject: jar:sign refuses to sign jar artifact of project with custom
packaging type

I get the following message when mvn is run with the -X option:

[DEBUG] Not executing jar:sign as the project is not a Java module

(Am using a custom packaging type in order to use a custom lifecycle,
that
invokes a custom goal before the jar:jar one.)

If I change the packaging type back to jar, jar:sign does sign the
artifact.

Could anyone please help.

Thanks.

-- 
Rob, Lafros.com

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