You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Marc Prud'hommeaux <mp...@apache.org> on 2006/11/08 02:12:25 UTC

Adding additional GPG signature file to deployment upload

I've set up a plugin to sign my release file using gpg (using the  
"maven-antrun-plugin" plugin), so that I generate a signature file:  
"artifact-VERSION-incubating.zip.asc" for the assembly-generated file  
"artifact-VERSION-incubating.zip".

When I run "mvn deploy", though, only the "artifact-VERSION- 
incubating.zip" file, along with the generated "artifact-VERSION- 
incubating.zip.sha1" and "artifact-VERSION-incubating.zip.md5" files,  
are uploaded: the signature file isn't uploaded.

Is there any way to tell maven to additionally upload the "artifact- 
VERSION-incubating.zip.asc" file when deploying?









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


Re: Adding additional GPG signature file to deployment upload

Posted by Brett Porter <br...@gmail.com>.
On 08/11/06, Marc Prud'hommeaux <mp...@apache.org> wrote:
> Do you happen to know if it is possible to access the MavenProject
> instance globally (e.g., via a static method or a System property)?
> If so, I could probably embed a beanshell script within the antrun
> plugin to add the artifacts to the project.

Unfortunately not. This is something we need to improve (not so much
having it statically available, but making it possible but to have
access to the project from the build).

For now, you can use this plugin:
http://mojo.codehaus.org/build-helper-maven-plugin/howto.html
(see bottom of page).

- Brett

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


Re: Adding additional GPG signature file to deployment upload

Posted by Marc Prud'hommeaux <mp...@apache.org>.
Brett-

On Nov 7, 2006, at 6:01 PM, Brett Porter wrote:

> You need to make it an 'attached' artifact. I'm not sure if antrun has
> the hooks to do that - writing an Ant plugin should though, and a Java
> plugin does.

OK, I'll look into doing this.

Do you happen to know if it is possible to access the MavenProject  
instance globally (e.g., via a static method or a System property)?  
If so, I could probably embed a beanshell script within the antrun  
plugin to add the artifacts to the project.

> Did you want to share the code for this? We've been planning to build
> this into Maven itself but this would be a good interim step.

Sure. The code for adding the signatures is as follows (it just  
launches GPG to sign the release). Note that some of it is pretty  
specific to my project (openjpa), but it should be fairly easily  
adaptable to any other project.

         <profile>
             <id>sign-release</id>
             <build>
                 <plugins>
                     <plugin>
                         <artifactId>maven-antrun-plugin</artifactId>
                         <executions>
                             <execution>
                                 <phase>verify</phase>
                                 <configuration>
                                     <tasks>
                                     <echo>Signing release files...</ 
echo>
                                     <macrodef name="sign-file">
                                         <attribute name="file" />
                                         <sequential>
                                         <delete failonerror="false"  
file="@{file}.asc"/>
                                         <exec executable="gpg"  
failonerror="true">
                                             <arg value="--batch"/>
                                             <arg value="--verbose"/>
                                             <arg value="--default- 
key"/>
                                             <arg value="$ 
{openjpa.release.keyAlias}"/>
                                             <arg value="--armor"/>
                                             <arg value="--detach-sig"/>
                                             <arg value="@{file}"/>
                                         </exec>
                                         </sequential>
                                     </macrodef>
                                     <sign-file file="$ 
{openjpa.assembly.outputDirectory}/${openjpa.assembly.finalName}.zip"/>
                                     <sign-file file="$ 
{openjpa.assembly.outputDirectory}/${openjpa.assembly.finalName}- 
sources.zip"/>
                                     </tasks>
                                 </configuration>
                                 <goals>
                                     <goal>run</goal>
                                 </goals>
                             </execution>
                         </executions>
                     </plugin>
                 </plugins>
                 </plugins>
             </build>
             <activation>
                 <property>
                     <name>sign</name>
                     <value>true</value>
                 </property>
             </activation>
         </profile>
     </profiles>



> - Brett
>
> On 08/11/06, Marc Prud'hommeaux <mp...@apache.org> wrote:
>>
>> I've set up a plugin to sign my release file using gpg (using the
>> "maven-antrun-plugin" plugin), so that I generate a signature file:
>> "artifact-VERSION-incubating.zip.asc" for the assembly-generated file
>> "artifact-VERSION-incubating.zip".
>>
>> When I run "mvn deploy", though, only the "artifact-VERSION-
>> incubating.zip" file, along with the generated "artifact-VERSION-
>> incubating.zip.sha1" and "artifact-VERSION-incubating.zip.md5" files,
>> are uploaded: the signature file isn't uploaded.
>>
>> Is there any way to tell maven to additionally upload the "artifact-
>> VERSION-incubating.zip.asc" file when deploying?
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>> For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>
>
> -- 
> Apache Maven - http://maven.apache.org
> "Better Builds with Maven" book - http://library.mergere.com/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>


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


Re: Adding additional GPG signature file to deployment upload

Posted by Brett Porter <br...@gmail.com>.
You need to make it an 'attached' artifact. I'm not sure if antrun has
the hooks to do that - writing an Ant plugin should though, and a Java
plugin does.

Did you want to share the code for this? We've been planning to build
this into Maven itself but this would be a good interim step.

- Brett

On 08/11/06, Marc Prud'hommeaux <mp...@apache.org> wrote:
>
> I've set up a plugin to sign my release file using gpg (using the
> "maven-antrun-plugin" plugin), so that I generate a signature file:
> "artifact-VERSION-incubating.zip.asc" for the assembly-generated file
> "artifact-VERSION-incubating.zip".
>
> When I run "mvn deploy", though, only the "artifact-VERSION-
> incubating.zip" file, along with the generated "artifact-VERSION-
> incubating.zip.sha1" and "artifact-VERSION-incubating.zip.md5" files,
> are uploaded: the signature file isn't uploaded.
>
> Is there any way to tell maven to additionally upload the "artifact-
> VERSION-incubating.zip.asc" file when deploying?
>
>
>
>
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


-- 
Apache Maven - http://maven.apache.org
"Better Builds with Maven" book - http://library.mergere.com/

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