[libpostgresql-jdbc-java] 41/93: Build script changes to allow packaging and deployment to Maven central using maven-ant-tasks
Emmanuel Bourg
ebourg-guest at moszumanska.debian.org
Mon Jan 9 10:18:50 UTC 2017
This is an automated email from the git hooks/post-receive script.
ebourg-guest pushed a commit to annotated tag REL9_3_1102
in repository libpostgresql-jdbc-java.
commit 659c1c0181da467e0ec5bea0381be42ed304743d
Author: Stephen Nelson <stephen at eccostudio.com>
Date: Sat Apr 13 00:20:36 2013 +0100
Build script changes to allow packaging and deployment to Maven central using maven-ant-tasks
Updated build.properties to contain the sonatype urls. Updated build.xml so that gpg signing works for each accompanying artifact type. Updated pom.xml to allow templated group and artifact ids.
---
build.properties | 6 +--
build.xml | 139 +++++++++++++++++++++----------------------------------
src/pom/pom.xml | 4 +-
3 files changed, 58 insertions(+), 91 deletions(-)
diff --git a/build.properties b/build.properties
index 978735c..7a5b17b 100644
--- a/build.properties
+++ b/build.properties
@@ -7,12 +7,10 @@ minor=3
fullversion=9.3
def_pgport=5432
enable_debug=yes
-
maven.group.id=org.postgresql
maven.artifact.id=postgresql
-#maven.artifact.version=9.3-2000-jdbc4
-maven.artifact.version=9.3.jdbc4-SNAPSHOT
-maven.artifact.description=The PostgreSQL Driver JDBC4
+maven.artifact.version=9.3
+maven.artifact.description=The PostgreSQL Driver
# Maven snapshots and staging repository id and url
maven.snapshots.repository.id=sonatype-nexus-snapshots
diff --git a/build.xml b/build.xml
index e5fd0a9..556df6b 100644
--- a/build.xml
+++ b/build.xml
@@ -169,6 +169,22 @@
<isset property="junit" />
</and>
</condition>
+
+ <condition property="jdbc.version" value="jdbc3">
+ <isset property="jdbc3any" />
+ </condition>
+
+ <condition property="jdbc.version" value="jdbc4">
+ <isset property="jdbc4any" />
+ </condition>
+
+ <condition property="jdbc.version.upper" value="JDBC3">
+ <isset property="jdbc3any" />
+ </condition>
+
+ <condition property="jdbc.version.upper" value="JDBC4">
+ <isset property="jdbc4any" />
+ </condition>
</target>
@@ -201,75 +217,7 @@
<fail message="Old driver was detected on classpath or in jre/lib/ext, please remove and try again." if="old.driver.present" />
<javac classpath="${srcdir}" srcdir="${srcdir}" destdir="${builddir}" debug="${debug}" source="${java.specification.version}">
- <!-- This is the core of the driver. It is common for all versions. -->
- <include name="${package}/*.java" />
- <include name="${package}/core/**" />
- <include name="${package}/copy/**" />
- <include name="${package}/fastpath/**" />
- <include name="${package}/geometric/**" />
- <include name="${package}/largeobject/**" />
- <include name="${package}/util/**" />
-
- <!--
- Each jdbcN subpackage is used only if the driver supports *at least* that
- revision of JDBC. That is, a JDBC2 build uses only jdbc2, a JDBC3 build
- uses both jdbc2 and jdbc3, etc.
-
- Within those subpackages, classes beginning with "JdbcN" are assumed to be
- the concrete implementations for JDBC version N and are built only if the
- driver supports *exactly* that version. For example, jdbc2/Jdbc2Statement.java
- is built only if the driver build is a JDBC2 build.
- -->
-
- <!-- jdbc2 subpackage -->
- <include name="${package}/jdbc2/**"/>
-
- <!-- jdbc3 subpackage -->
- <include name="${package}/jdbc3/Abstract*.java" />
- <include name="${package}/jdbc3/PSQLSavepoint.java" />
-
- <include name="${package}/jdbc3/Jdbc3Array.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Blob.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3CallableStatement.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Clob.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Connection.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3DatabaseMetaData.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3PreparedStatement.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3ResultSet.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3ResultSetMetaData.java.java" if="jdbc3"/>
- <include name="${package}/jdbc3/Jdbc3Statement.java" if="jdbc3"/>
-
- <!-- jdbc3g subpackage -->
- <include name="${package}/jdbc3g/*.java" if="jdbc3g" />
- <exclude name="${package}/jdbc3g/Jdbc3g*.java" unless="jdbc3g" />
-
- <!-- jdbc4 subpackage -->
- <include name="${package}/jdbc4/*.java" if="jdbc4any" />
- <exclude name="${package}/jdcb4/Jdbc4*.java" unless="jdbc4any" />
-
- <!-- ssl -->
- <include name="${package}/ssl/jdbc4/*.java" if="jdbc4any"/>
- <include name="${package}/ssl/jdbc3/*.java" if="jdbc3any"/>
- <include name="${package}/ssl/*.java" if="jdbc3any"/>
-
- <!-- gss -->
- <include name="${package}/gss/*.java" />
-
- <!-- datasource stuff -->
- <include name="${package}/jdbc3/Jdbc3ConnectionPool.java" if="jdbc3any" />
- <include name="${package}/jdbc3/Jdbc3PoolingDataSource.java" if="jdbc3any" />
- <include name="${package}/jdbc3/Jdbc3SimpleDataSource.java" if="jdbc3any" />
-
- <include name="${package}/ds/*.java" />
- <include name="${package}/ds/common/*.java" />
- <include name="${package}/ds/jdbc23/*.java" />
- <include name="${package}/ds/jdbc4/*.java" if="jdbc4any" />
-
- <!-- XA stuff -->
- <include name="${package}/xa/*.java" />
- <include name="${package}/xa/jdbc3/*.java" />
- <include name="${package}/xa/jdbc4/*.java" if="jdbc4any" />
-
+ <patternset refid="jdbc.version.src.pattern"/>
</javac>
</target>
@@ -620,15 +568,26 @@
</xmlvalidate>
</target>
- <target name="deploy" depends="maven-jar" description="deploy snapshot version to Maven snapshot repository">
+ <target name="snapshot-version" description="Sets the version string to a snapshot version">
+ <property name="maven.artifact.version.string" value="${maven.artifact.version}-${jdbc.version}-SNAPSHOT" />
+ </target>
+
+ <target name="release-version" description="Sets the version string to a release version">
+ <property name="maven.artifact.version.string" value="${maven.artifact.version}-${jdbc.version}" />
+ </target>
+
+ <target name="prepare-pom" depends="prepare,check_versions" description="Filters the pom depending on the jdbc version being built">
<mkdir dir="${builddir}/pom"/>
<!-- Copy the templated pom.xml with version info -->
<filter token="maven.group.id" value="${maven.group.id}"/>
<filter token="maven.artifact.id" value="${maven.artifact.id}"/>
- <filter token="maven.artifact.version" value="${maven.artifact.version}"/>
+ <filter token="maven.artifact.version.string" value="${maven.artifact.version.string}"/>
<filter token="maven.artifact.description" value="${maven.artifact.description}"/>
+ <filter token="jdbc.version.upper" value="${jdbc.version.upper}"/>
<copy todir="${builddir}/pom" filtering="true" file="src/pom/pom.xml"/>
+ </target>
+ <target name="snapshot" depends="maven-jar,snapshot-version,prepare-pom" description="deploy snapshot version to Maven snapshot repository">
<artifact:mvn>
<artifact:arg value="org.apache.maven.plugins:maven-deploy-plugin:2.6:deploy-file"/>
<artifact:arg value="-Durl=${maven.snapshots.repository.url}"/>
@@ -636,30 +595,40 @@
<artifact:arg value="-DpomFile=${builddir}/pom/pom.xml"/>
<artifact:arg value="-Dfile=${maven.jar}"/>
<artifact:arg value="-Pgpg"/>
-
</artifact:mvn>
</target>
<!-- before this, update project version (both build.xml and pom.xml) from SNAPSHOT to RELEASE -->
- <target name="stage" depends="maven-jar" description="deploy release version to Maven staging repository">
- <mkdir dir="${builddir}/pom"/>
- <!-- Copy the templated pom.xml with version info -->
- <filter token="maven.group.id" value="${maven.group.id}"/>
- <filter token="maven.artifact.id" value="${maven.artifact.id}"/>
- <filter token="maven.artifact.version" value="${maven.artifact.version}"/>
- <filter token="maven.artifact.description" value="${maven.artifact.description}"/>
- <copy todir="${builddir}/pom" filtering="true" file="src/pom/pom.xml"/>
+ <target name="release" depends="maven-jar,release-version,prepare-pom" description="deploy release version to Maven staging repository">
<!-- sign and deploy the main artifact -->
<artifact:mvn>
- <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" />
+ <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
<artifact:arg value="-Durl=${maven.staging.repository.url}" />
<artifact:arg value="-DrepositoryId=${maven.staging.repository.id}" />
<artifact:arg value="-DpomFile=${builddir}/pom/pom.xml" />
<artifact:arg value="-Dfile=${maven.jar}" />
- <artifact:arg value="-DfinalName=${maven.jar}" />
- <artifact:arg value="-Dtypes=jar,jar" />
- <artifact:arg value="-Dclassifiers=sources,javadoc" />
- <artifact:arg value="-Dfiles=${maven.sources.jar},${maven.javadoc.jar}" />
+ <artifact:arg value="-Pgpg" />
+ </artifact:mvn>
+
+ <!-- sign and deploy the sources artifact -->
+ <artifact:mvn>
+ <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
+ <artifact:arg value="-Durl=${maven.staging.repository.url}" />
+ <artifact:arg value="-DrepositoryId=${maven.staging.repository.id}" />
+ <artifact:arg value="-DpomFile=${builddir}/pom/pom.xml" />
+ <artifact:arg value="-Dfile=${maven.sources.jar}" />
+ <artifact:arg value="-Dclassifier=sources" />
+ <artifact:arg value="-Pgpg" />
+ </artifact:mvn>
+
+ <!-- sign and deploy the javadoc artifact -->
+ <artifact:mvn>
+ <artifact:arg value="org.apache.maven.plugins:maven-gpg-plugin:1.3:sign-and-deploy-file" />
+ <artifact:arg value="-Durl=${maven.staging.repository.url}" />
+ <artifact:arg value="-DrepositoryId=${maven.staging.repository.id}" />
+ <artifact:arg value="-DpomFile=${builddir}/pom/pom.xml" />
+ <artifact:arg value="-Dfile=${maven.javadoc.jar}" />
+ <artifact:arg value="-Dclassifier=javadoc" />
<artifact:arg value="-Pgpg" />
</artifact:mvn>
</target>
diff --git a/src/pom/pom.xml b/src/pom/pom.xml
index e43373e..4dabcd2 100644
--- a/src/pom/pom.xml
+++ b/src/pom/pom.xml
@@ -5,8 +5,8 @@
<artifactId>@maven.artifact.id@</artifactId>
<packaging>jar</packaging>
<name>PostgreSQL JDBC Driver</name>
- <version>@maven.artifact.version@</version>
- <description>@maven.artifact.description@</description>
+ <version>@maven.artifact.version.string@</version>
+ <description>@maven.artifact.description@ @jdbc.version.upper@</description>
<url>http://jdbc.postgresql.org</url>
<developers>
<developer>
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-java/libpostgresql-jdbc-java.git
More information about the pkg-java-commits
mailing list