Last active
December 28, 2015 04:49
-
-
Save subchen/7445673 to your computer and use it in GitHub Desktop.
default build.xml for apache-ant
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
maven.group.id = com.github.subchen | |
maven.artifact.id = jetbrick-template | |
maven.version = 1.0.0 | |
product.name = ${maven.artifact.id} | |
product.version = ${maven.version} | |
product.author = Guoqiang Chen | |
product.vendor = [email protected] | |
build.dir = ${basedir}/build | |
classes.dir = ${build.dir}/classes | |
javadoc.dir = ${build.dir}/apidocs | |
dist.dir = ${build.dir} | |
ant.build.javac.source = 1.6 | |
ant.build.javac.target = 1.6 | |
javac.encoding = utf-8 | |
javadoc.encoding = ${javac.encoding} | |
javadoc.title = ${product.name} ${product.version} API | |
javadoc.access = public | |
javadoc.linksource = false | |
javadoc.copyright = Copyright @ 2010-2013 by ${product.author}. All Rights Reserved. | |
dist.jar = ${dist.dir}/${product.name}-${product.version}.jar | |
dist.sources.jar = ${dist.dir}/${product.name}-${product.version}-sources.jar | |
dist.javadoc.jar = ${dist.dir}/${product.name}-${product.version}-javadoc.jar | |
dist.zip = ${dist.dir}/${product.name}-${product.version}.zip | |
dist.all.zip = ${dist.dir}/${product.name}-${product.version}-all.zip | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<project default="dist" basedir="."> | |
<property file="${basedir}/build.properties" /> | |
<path id="compile.classpath"> | |
<fileset dir="${basedir}/lib" includes="**/*.jar" /> | |
</path> | |
<path id="compile.sourcepath"> | |
<pathelement location="${basedir}/src/main/java"/> | |
</path> | |
<path id="compile.resources"> | |
<fileset dir="${basedir}/src/main/resources" excludes="**/*.java" /> | |
</path> | |
<path id="sources.resources"> | |
<fileset dir="${basedir}"> | |
<include name="src/**" /> | |
<include name="NOTICE" /> | |
<include name="LICENSE" /> | |
<include name="CHANGELOG" /> | |
<include name="README.md" /> | |
<include name="pom.xml" /> | |
<include name="build.properties" /> | |
<include name="build.xml" /> | |
</fileset> | |
</path> | |
<patternset id="metainf.resources"> | |
<include name="NOTICE" /> | |
<include name="LICENSE" /> | |
<include name="README.md" /> | |
<include name="pom.xml" /> | |
</patternset> | |
<target name="clean"> | |
<delete dir="${build.dir}" quiet="true" /> | |
</target> | |
<target name="compile" depends="clean"> | |
<mkdir dir="${classes.dir}" /> | |
<javac destdir="${classes.dir}" | |
classpathref="compile.classpath" | |
debug="on" nowarn="true" deprecation="off" | |
encoding="${javac.encoding}" | |
includeantruntime="off"> | |
<src refid="compile.sourcepath" /> | |
</javac> | |
<copy todir="${classes.dir}"> | |
<path refid="compile.resources" /> | |
</copy> | |
<mkdir dir="${classes.dir}/META-INF" /> | |
<copy todir="${classes.dir}/META-INF"> | |
<fileset dir="${basedir}"> | |
<patternset refid="metainf.resources" /> | |
</fileset> | |
</copy> | |
</target> | |
<target name="jar" depends="compile"> | |
<mkdir dir="${dist.dir}" /> | |
<jar jarfile="${dist.jar}" whenempty="fail"> | |
<fileset dir="${classes.dir}" includes="**" /> | |
<manifest> | |
<attribute name="Built-By" value="${product.author}" /> | |
<attribute name="Implementation-Vendor" value="${product.vendor}" /> | |
<attribute name="Implementation-Title" value="${product.name}" /> | |
<attribute name="Implementation-Version" value="${product.version}" /> | |
</manifest> | |
</jar> | |
</target> | |
<target name="sources.jar"> | |
<mkdir dir="${dist.dir}" /> | |
<jar jarfile="${dist.sources.jar}" whenempty="fail"> | |
<path refid="sources.resources" /> | |
<manifest> | |
<attribute name="Built-By" value="${product.author}" /> | |
<attribute name="Implementation-Vendor" value="${product.vendor}" /> | |
<attribute name="Implementation-Title" value="${product.name}" /> | |
<attribute name="Implementation-Version" value="${product.version}" /> | |
</manifest> | |
</jar> | |
</target> | |
<target name="javadoc" depends="clean"> | |
<mkdir dir="${javadoc.dir}" /> | |
<javadoc destdir="${javadoc.dir}" | |
sourcepathref="compile.sourcepath" | |
classpathref="compile.classpath" | |
windowtitle="${javadoc.title}" | |
encoding="${javac.encoding}" docencoding="${javadoc.encoding}" charset="${javadoc.encoding}" | |
access="${javadoc.access}" version="true" author="true" use="true" splitindex="true" | |
nodeprecated="false" nodeprecatedlist="false" noindex="false" nonavbar="false" notree="false" | |
doctitle="${javadoc.title}" bottom="${javadoc.copyright}" | |
linksource="${javadoc.linksource}" | |
/> | |
</target> | |
<target name="javadoc.jar" depends="javadoc"> | |
<mkdir dir="${dist.dir}" /> | |
<jar jarfile="${dist.javadoc.jar}" whenempty="fail"> | |
<fileset dir="${javadoc.dir}" includes="**" /> | |
<manifest> | |
<attribute name="Built-By" value="${product.author}" /> | |
<attribute name="Implementation-Vendor" value="${product.vendor}" /> | |
<attribute name="Implementation-Title" value="${product.name}" /> | |
<attribute name="Implementation-Version" value="${product.version}" /> | |
</manifest> | |
</jar> | |
</target> | |
<target name="dist" depends="jar, sources.jar, javadoc.jar"> | |
<mkdir dir="${dist.dir}" /> | |
<zip zipfile="${dist.zip}" whenempty="fail"> | |
<fileset file="${dist.jar}" /> | |
<fileset dir="${basedir}" includes="lib/*.jar" /> | |
<fileset dir="${basedir}"> | |
<patternset refid="metainf.resources" /> | |
</fileset> | |
</zip> | |
<zip zipfile="${dist.all.zip}" whenempty="fail"> | |
<fileset file="${dist.jar}" /> | |
<fileset file="${dist.sources.jar}" /> | |
<fileset file="${dist.javadoc.jar}" /> | |
<fileset dir="${basedir}" includes="lib/**/*.jar" /> | |
<fileset dir="${basedir}"> | |
<patternset refid="metainf.resources" /> | |
</fileset> | |
</zip> | |
</target> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<project basedir="." xmlns:artifact="antlib:org.apache.maven.artifact.ant"> | |
<property file="${basedir}/build.properties" /> | |
<!-- defined maven snapshots and staging repository id and url --> | |
<property name="maven-snapshots-repository-id" value="sonatype-nexus-snapshots" /> | |
<property name="maven-snapshots-repository-url" value="https://oss.sonatype.org/content/repositories/snapshots/" /> | |
<property name="maven-staging-repository-id" value="sonatype-nexus-staging" /> | |
<property name="maven-staging-repository-url" value="https://oss.sonatype.org/service/local/staging/deploy/maven2/" /> | |
<target name="maven.deploy" description="deploy snapshot version to Maven snapshot repository"> | |
<artifact:mvn> | |
<arg value="org.apache.maven.plugins:maven-deploy-plugin:2.8:deploy-file" /> | |
<arg value="-Durl=${maven-snapshots-repository-url}" /> | |
<arg value="-DrepositoryId=${maven-snapshots-repository-id}" /> | |
<arg value="-DpomFile=pom.xml" /> | |
<arg value="-Dfile=${dist.jar}" /> | |
</artifact:mvn> | |
</target> | |
<!-- before this, update project version (both build.xml and pom.xml) from SNAPSHOT to RELEASE --> | |
<target name="maven.stage" description="deploy release version to Maven staging repository"> | |
<!-- sign and deploy the main artifact --> | |
<artifact:mvn> | |
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" /> | |
<arg value="-Durl=${maven-staging-repository-url}" /> | |
<arg value="-DrepositoryId=${maven-staging-repository-id}" /> | |
<arg value="-DpomFile=pom.xml" /> | |
<arg value="-Dfile=${dist.jar}" /> | |
<arg value="-Pgpg" /> | |
</artifact:mvn> | |
<!-- sign and deploy the sources artifact --> | |
<artifact:mvn> | |
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" /> | |
<arg value="-Durl=${maven-staging-repository-url}" /> | |
<arg value="-DrepositoryId=${maven-staging-repository-id}" /> | |
<arg value="-DpomFile=pom.xml" /> | |
<arg value="-Dfile=${dist.sources.jar}" /> | |
<arg value="-Dclassifier=sources" /> | |
<arg value="-Pgpg" /> | |
</artifact:mvn> | |
<!-- sign and deploy the javadoc artifact --> | |
<artifact:mvn> | |
<arg value="org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file" /> | |
<arg value="-Durl=${maven-staging-repository-url}" /> | |
<arg value="-DrepositoryId=${maven-staging-repository-id}" /> | |
<arg value="-DpomFile=pom.xml" /> | |
<arg value="-Dfile=${dist.javadoc.jar}" /> | |
<arg value="-Dclassifier=javadoc" /> | |
<arg value="-Pgpg" /> | |
</artifact:mvn> | |
</target> | |
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" | |
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 | |
http://maven.apache.org/xsd/settings-1.0.0.xsd"> | |
<servers> | |
<server> | |
<id>sonatype-nexus-snapshots</id> | |
<username>XXXXXXXXXXXXXXX</username> | |
<password>XXXXXXXXXXXXXXX</password> | |
</server> | |
<server> | |
<id>sonatype-nexus-staging</id> | |
<username>XXXXXXXXXXXXXXX</username> | |
<password>XXXXXXXXXXXXXXX</password> | |
</server> | |
</servers> | |
<profiles> | |
<profile> | |
<id>gpg</id> | |
<properties> | |
<gpg.passphrase>XXXXXXXXXXXXXXX</gpg.passphrase> | |
</properties> | |
</profile> | |
</profiles> | |
</settings> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment