Allow maven bundle

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop-pdf-images/trunk@1788439 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/build.xml b/build.xml
index e5e5102..e8ecc65 100644
--- a/build.xml
+++ b/build.xml
@@ -476,5 +476,63 @@
         <include name="NOTICE"/>
       </fileset>
     </jar>
+  </target>
+  
+  <target name="maven-artifacts" depends="jar-main, jar-sources, jar-javadocs" description="Builds a Maven artifact that can be uploaded to a Maven repository">
+    <filter  token="version" value="${version}"/>
+    <mkdir dir="${build.dir}/maven"/>
+    <copy file="${basedir}/xmlgraphics-pdfimages-pom-template.pom" tofile="${build.dir}/maven/pom.xml" filtering="true"/>
+    <fileset id="bundle-files" dir="${build.dir}">
+      <patternset>
+      <include name="${name}-${version}.jar"/>
+      <include name="${name}-${version}-sources.jar"/>
+      <include name="${name}-${version}-javadoc.jar"/>
+      </patternset>
+      <patternset>
+      <include name="maven/pom.xml"/>
+      </patternset>
+    </fileset>
+    <checksum algorithm="md5">
+      <fileset refid="bundle-files"/>
+    </checksum>
+    <checksum algorithm="sha1">
+      <fileset refid="bundle-files"/>
+    </checksum>
+    <input message="Passphrase for your default private key (attention: passphrase will be echoed in clear text on the display!)" addproperty="pwd"/>
+    <antcall target="sign-file">
+      <param name="sign.archive" value="${build.dir}/${name}-${version}.jar"/>
+      <param name="pwd" value="${pwd}"/>
+    </antcall>
+    <antcall target="sign-file">
+      <param name="sign.archive" value="${build.dir}/${name}-${version}-sources.jar"/>
+      <param name="pwd" value="${pwd}"/>
+    </antcall>
+    <antcall target="sign-file">
+      <param name="sign.archive" value="${build.dir}/${name}-${version}-javadoc.jar"/>
+      <param name="pwd" value="${pwd}"/>
+    </antcall>
+    <antcall target="sign-file">
+      <param name="sign.archive" value="${build.dir}/maven/pom.xml"/>
+      <param name="pwd" value="${pwd}"/>
+    </antcall>
+    <jar jarfile="${build.dir}/${name}-${version}-bundle.jar">
+      <manifest>
+        <attribute name="Build-Id" value="${ts} (${user.name} [${os.name} ${os.version} ${os.arch}, Java ${java.runtime.version}])"/>
+      </manifest>
+      <fileset dir="${build.dir}">
+        <patternset>
+          <include name="${name}-${version}.jar*"/>
+          <include name="${name}-${version}-sources.jar*"/>
+          <include name="${name}-${version}-javadoc.jar*"/>
+        </patternset>
+      </fileset>
+      <fileset dir="${build.dir}/maven">
+        <patternset>
+          <include name="pom.xml*"/>
+        </patternset>
+      </fileset>
+      <metainf dir="${basedir}" includes="LICENSE,NOTICE"/>
+    </jar>
+    <move file="${build.dir}/${name}-${version}-bundle.jar" todir="${basedir}"/>
   </target>  
 </project>
diff --git a/xmlgraphics-pdfimages-pom-template.pom b/xmlgraphics-pdfimages-pom-template.pom
new file mode 100644
index 0000000..df066ac
--- /dev/null
+++ b/xmlgraphics-pdfimages-pom-template.pom
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<!-- $Id$ -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.xmlgraphics</groupId>
+  <artifactId>fop-pdf-images</artifactId>
+  <packaging>jar</packaging>
+  <name>Apache FOP PDF Images</name>
+  <version>@version@</version>
+  <url>https://xmlgraphics.apache.org/fop/fop-pdf-images.html</url>
+  <description>Apache FOP PDF Images plug-in extends FOP in order to add support for using PDF images in fo:external-graphic elements when generating PDF files.</description>
+  <inceptionYear>2007</inceptionYear>
+  <mailingLists>
+    <mailingList>
+      <name>FOP Users List</name>
+      <subscribe>fop-users-subscribe@xmlgraphics.apache.org</subscribe>
+      <unsubscribe>fop-users-unsubscribe@xmlgraphics.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-users/</archive>
+    </mailingList>
+    <mailingList>
+      <name>FOP Developer List</name>
+      <subscribe>fop-dev-subscribe@xmlgraphics.apache.org</subscribe>
+      <unsubscribe>fop-dev-unsubscribe@xmlgraphics.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-dev/</archive>
+    </mailingList>
+    <mailingList>
+      <name>FOP Commit List</name>
+      <subscribe>fop-commits-subscribe@xmlgraphics.apache.org</subscribe>
+      <unsubscribe>fop-commits-unsubscribe@xmlgraphics.apache.org</unsubscribe>
+      <archive>http://mail-archives.apache.org/mod_mbox/xmlgraphics-fop-commits/</archive>
+    </mailingList>
+  </mailingLists>
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+  <scm>
+    <connection>scm:svn:http://svn.apache.org/repos/asf/xmlgraphics/fop-pdf-images/trunk</connection>
+    <developerConnection>scm:svn:https://svn.apache.org/repos/asf/xmlgraphics/fop-pdf-images/trunk</developerConnection>
+    <url>http://svn.apache.org/viewvc/xmlgraphics/fop-pdf-images/trunk/?root=Apache-SVN</url>
+  </scm>
+  <organization>
+    <name>Apache Software Foundation</name>
+    <url>http://www.apache.org/</url>
+  </organization>
+  <parent>
+	<groupId>org.apache</groupId>
+	<artifactId>apache</artifactId>
+	<version>7</version>
+  </parent>
+  <dependencies>
+    <!-- XML Graphics -->
+    <dependency>
+      <groupId>org.apache.xmlgraphics</groupId>
+      <artifactId>fop</artifactId>
+      <version>2.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.pdfbox</groupId>
+      <artifactId>pdfbox</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.pdfbox</groupId>
+      <artifactId>fontbox</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+   </dependencies>
+</project>
+