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 <[EMAIL PROTECTED]> 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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




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

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to