]> source.dussan.org Git - poi.git/commitdiff
Add ant task for building the maven/ibiblio friendly binary and source jar files...
authorNick Burch <nick@apache.org>
Tue, 4 Jul 2006 18:17:24 +0000 (18:17 +0000)
committerNick Burch <nick@apache.org>
Tue, 4 Jul 2006 18:17:24 +0000 (18:17 +0000)
git-svn-id: https://svn.apache.org/repos/asf/jakarta/poi/trunk@419060 13f79535-47bb-0310-9956-ffa450edef68

build.xml
poi.pom [new file with mode: 0644]

index e1ae363c4879468dfe01f64ef331ec821fdd5b51..c0d183fbcace2463c8e385df19dc2ed6293852ec 100644 (file)
--- a/build.xml
+++ b/build.xml
   <property name="apidocs.report.dir" location="${build.site}/apidocs"/>
   <property name="changelog.file" location="${build.site}/changelog.html"/>
   <property name="dist.dir" location="build/dist"/>
+  <property name="mavendist.dir" location="build/maven-dist"/>
   <property name="jar.name" value="poi"/>
   <property name="version.id" value="3.0-alpha2"/>
   <property name="halt.on.test.failure" value="true"/>
         <mkdir dir="${jdepend.report.out.dir}"/>
         <mkdir dir="${apidocs.report.dir}"/>
         <mkdir dir="${dist.dir}"/>
+        <mkdir dir="${mavendist.dir}"/>
         <mkdir dir="${build.site.src}/${main.documentation}"/>
 
         <copy todir="${build.site.src}/${main.documentation}">
@@ -788,6 +790,52 @@ FORREST_HOME environment variable!</echo>
       description="Generates POI's website's contents"/>
 
 
+    <target name="maven-dist" depends="compile" description="Builds the jar files for a maven distribution, and the POM to go with them">
+               <!-- Build a Jar of all the class files -->
+        <jar destfile="${mavendist.dir}/${jar.name}-${version.id}.jar">
+            <manifest>
+                <attribute name="Built-By" value="${user.name}"/>
+                <section name="common">
+                  <attribute name="Specification-Title" value="Jakarta POI"/>
+                  <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
+                  <attribute name="Specification-Vendor" value="Apache"/>
+                  <attribute name="Implementation-Title" value="Jakarta POI"/>
+                  <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
+                  <attribute name="Implementation-Vendor" value="Apache"/>
+                </section>
+            </manifest>        
+                       <fileset dir="${main.output.dir}" />
+                       <fileset dir="${contrib.output.dir}" />
+                       <fileset dir="${scratchpad.output.dir}" />
+        </jar>
+
+               <!-- Build a Jar file of all the source files -->
+        <jar destfile="${mavendist.dir}/${jar.name}-${version.id}-sources.jar">
+            <manifest>
+                <attribute name="Built-By" value="${user.name}"/>
+                <section name="common">
+                  <attribute name="Specification-Title" value="Jakarta POI"/>
+                  <attribute name="Specification-Version" value="${version.id}-${DSTAMP}"/>
+                  <attribute name="Specification-Vendor" value="Apache"/>
+                  <attribute name="Implementation-Title" value="Jakarta POI"/>
+                  <attribute name="Implementation-Version" value="${version.id}-${DSTAMP}"/>
+                  <attribute name="Implementation-Vendor" value="Apache"/>
+                </section>
+            </manifest>        
+                       <fileset dir="${main.src}" includes="**/*.java" />
+                       <fileset dir="${contrib.src}" includes="**/*.java" />
+                       <fileset dir="${scratchpad.src}" includes="**/*.java" />
+        </jar>
+
+               <!-- Build the pom -->
+               <!-- Copy from the base file, and substitute in the version -->
+               <filter token="VERSION" value="${version.id}" />
+               <copy 
+                       filtering="true" 
+                       file="poi.pom" 
+                       tofile="${mavendist.dir}/${jar.name}-${version.id}.pom" 
+               />
+       </target>
 
     <target name="jar" depends="compile" description="Creates jar files for distribution">
         <jar basedir="${main.output.dir}" destfile="${dist.dir}/${jar.name}-${version.id}-${DSTAMP}.jar">
diff --git a/poi.pom b/poi.pom
new file mode 100644 (file)
index 0000000..d443bdf
--- /dev/null
+++ b/poi.pom
@@ -0,0 +1,30 @@
+<metadata>
+       <modelVersion>4.0.0</modelVersion>
+       <groupId>poi</groupId>
+       <artifactId>poi</artifactId>
+       <version>@VERSION@</version>
+       <packaging>jar</packaging>
+       <name>Jakarta POI</name>
+       <url>http://jakarta.apache.org/poi/</url>
+       <description>Jakarta POI - Java API To Access Microsoft Format Files</description>
+
+       <dependencies></dependencies>
+
+       <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>
+               <url>http://svn.apache.org/viewvc/jakarta/poi/trunk</url>
+               <connection>scm:svn:http://svn.apache.org/repos/asf/jakarta/poi/trunk</connection>
+       </scm>
+       <issueTrackingUrl>http://issues.apache.org/bugzilla/</issueTrackingUrl>
+       <organization>
+               <name>Apache Software Foundation</name>
+               <url>http://www.apache.org/</url>
+               <logo>http://jakarta.apache.org/images/original-jakarta-logo.gif</logo>
+       </organization>
+</metadata>