Skip to content

Commit 5e61fea

Browse files
committed
Added the ability to publish signed artifacts.
1 parent e843545 commit 5e61fea

File tree

1 file changed

+102
-2
lines changed

1 file changed

+102
-2
lines changed

src/build/maven/maven-deploy.xml

Lines changed: 102 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
<!-- Add our maven ant tasks -->
2828
<path id="maven-ant-tasks.classpath" path="maven-ant-tasks-2.1.1.jar" />
2929
<typedef resource="org/apache/maven/artifact/ant/antlib.xml" uri="urn:maven-artifact-ant" classpathref="maven-ant-tasks.classpath" />
30+
3031
<!-- simplify fixing pom versions -->
3132
<macrodef name="make-pom">
3233
<attribute name="name" />
@@ -134,8 +135,7 @@
134135
</sequential>
135136
</macrodef>
136137

137-
138-
<!-- Deploy compiler plugins -->
138+
<!-- Deploy compiler plugins -->
139139
<macrodef name="deploy-remote-plugin">
140140
<attribute name="name" />
141141
<attribute name="version" />
@@ -172,6 +172,98 @@
172172
<deploy-remote-plugin name="continuations" version="@{version}" repository="@{repository}"/>
173173
</sequential>
174174
</macrodef>
175+
176+
<!-- PGP Signed deployment -->
177+
<macrodef name="deploy-remote-signed-single">
178+
<attribute name="pom" />
179+
<attribute name="repository" />
180+
<attribute name="jar" />
181+
<element name="extra-args" optional="yes" />
182+
<sequential>
183+
<artifact:mvn>
184+
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
185+
<arg value="-Durl=@{repository}" />
186+
<arg value="-DrepositoryId=${repository.credentials.id}" />
187+
<arg value="-DpomFile=@{pom}" />
188+
<arg value="-Dfile=@{jar}" />
189+
<arg value="-Pgpg" />
190+
<arg value="-Dgpg.useagent=true" />
191+
<extra-args/>
192+
</artifact:mvn>
193+
</sequential>
194+
</macrodef>
195+
<macrodef name="deploy-remote-signed">
196+
<attribute name="name" />
197+
<attribute name="repository" />
198+
<attribute name="version" />
199+
<element name="extra-attachments" optional="yes" />
200+
<sequential>
201+
<make-pom name="@{name}" version="@{version}" />
202+
<deploy-remote-signed-single
203+
pom="@{name}/@{name}-pom-fixed.xml"
204+
repository="@{repository}"
205+
jar="/@{name}/@{name}.jar" />
206+
<deploy-remote-signed-single
207+
pom="@{name}/@{name}-pom-fixed.xml"
208+
repository="@{repository}"
209+
jar="@{name}/@{name}-src.jar">
210+
<extra-args>
211+
<arg value="-Dclassifier=sources" />
212+
</extra-args>
213+
</deploy-remote-signed-single>
214+
<deploy-remote-signed-single
215+
pom="@{name}/@{name}-pom-fixed.xml"
216+
repository="@{repository}"
217+
jar="@{name}/@{name}-docs.jar">
218+
<extra-args>
219+
<arg value="-Dclassifier=javadoc" />
220+
</extra-args>
221+
</deploy-remote-signed-single>
222+
</sequential>
223+
</macrodef>
224+
<macrodef name="deploy-remote-plugin-signed">
225+
<attribute name="name" />
226+
<attribute name="repository" />
227+
<attribute name="version" />
228+
<element name="extra-attachments" optional="yes" />
229+
<sequential>
230+
<make-pom-plugin name="@{name}" version="@{version}" />
231+
<deploy-remote-signed-single
232+
pom="plugins/@{name}/@{name}-pom-fixed.xml"
233+
repository="@{repository}"
234+
jar="plugins/@{name}/@{name}.jar" />
235+
<deploy-remote-signed-single
236+
pom="plugins/@{name}/@{name}-pom-fixed.xml"
237+
repository="@{repository}"
238+
jar="plugins/@{name}/@{name}-src.jar">
239+
<extra-args>
240+
<arg value="-Dclassifier=sources" />
241+
</extra-args>
242+
</deploy-remote-signed-single>
243+
<deploy-remote-signed-single
244+
pom="plugins/@{name}/@{name}-pom-fixed.xml"
245+
repository="@{repository}"
246+
jar="plugins/@{name}/@{name}-docs.jar">
247+
<extra-args>
248+
<arg value="-Dclassifier=javadoc" />
249+
</extra-args>
250+
</deploy-remote-signed-single>
251+
</sequential>
252+
</macrodef>
253+
<macrodef name="deploy-remote-signed-all">
254+
<attribute name="repository" />
255+
<attribute name="version" />
256+
<sequential>
257+
<deploy-remote-plugin-signed name="continuations" version="@{version}" repository="@{repository}"/>
258+
<deploy-remote-signed name="scala-library" version="@{version}" repository="@{repository}"/>
259+
<deploy-remote-signed name="jline" version="@{version}" repository="@{repository}"/>
260+
<deploy-remote-signed name="scala-compiler" version="@{version}" repository="@{repository}" />
261+
<deploy-remote-signed name="scala-dbc" version="@{version}" repository="@{repository}" />
262+
<deploy-remote-signed name="scala-swing" version="@{version}" repository="@{repository}"/>
263+
<deploy-remote-signed name="scalap" version="@{version}" repository="@{repository}"/>
264+
<deploy-remote-signed name="scala-partest" version="@{version}" repository="@{repository}"/>
265+
</sequential>
266+
</macrodef>
175267
</target>
176268

177269
<!-- Local Targets -->
@@ -184,6 +276,14 @@
184276
</target>
185277

186278
<!-- Remote Targets -->
279+
<target name="deploy.signed.snapshot" depends="deploy.remote.init" description="Deploys the bundled files as a snapshot into the desired remote Maven repository">
280+
<deploy-remote-signed-all version="${maven.snapshot.version.number}" repository="${remote.snapshot.repository}" />
281+
</target>
282+
283+
<target name="deploy.signed.release" depends="deploy.remote.init" description="Deploys the bundled files as a release into the desired remote Maven repository">
284+
<deploy-remote-signed-all version="${version.number}" repository="${remote.release.repository}" />
285+
</target>
286+
187287
<target name="deploy.snapshot" depends="deploy.remote.init" description="Deploys the bundled files as a snapshot into the desired remote Maven repository">
188288
<deploy-remote-all version="${maven.snapshot.version.number}" repository="${remote.snapshot.repository}" />
189289
</target>

0 commit comments

Comments
 (0)