Results 1 to 1 of 1
- 11-09-2012, 12:45 AM #1
Member
- Join Date
- Apr 2011
- Posts
- 37
- Rep Power
- 0
Jar signing with Ant Buildfile (Eclipse)
So, I've found myself in a position where I need to sign all the jars in a project at the time of exporting to jar. So I'm trying to write this logic into my ant buildfile but I haven't had much luck yet. It looks something like this:
If anyone can help me fix this so it works I would love you forever <3Java Code:<?xml version="1.0" encoding="UTF-8" standalone="no"?> <!-- WARNING: Eclipse auto-generated file. Any modifications will be overwritten. To include a user specific buildfile here, simply create one in the same directory with the processing instruction <?eclipse.ant.import?> as the first entry and export the buildfile again. --> <project name="ToeChat" xmlns:ivy="antlib:org.apache.ivy.ant" default="build"> <property environment="env"/> <property name="ECLIPSE_HOME" value="../../../../../Eclipse"/> <property name="debuglevel" value="source,lines,vars"/> <property name="target" value="1.7"/> <property name="source" value="1.7"/> <path id="Ivy-final.classpath"> <pathelement location="bin"/> </path> <target name="init"> <mkdir dir="bin"/> <copy includeemptydirs="false" todir="bin"> <fileset dir="src"> <exclude name="**/*.java"/> </fileset> </copy> <copy includeemptydirs="false" todir="bin"> <fileset dir="."> <exclude name="**/*.java"/> <exclude name="src/"/> </fileset> </copy> </target> <target name="clean"> <delete dir="bin"/> </target> <signjar alias="MyAlias" keystore="MyKeyStore" storepass="MyPass" sigalg="RSA" digestalg="RSA"> <path> <fileset dir="bin" includes="**/*.jar" /> </path> </signjar> <target name="resolve"> <mkdir dir="${lib.dir}" /> <ivy:resolve file="${ivy.file}"/> <ivy:retrieve /> <ivy:report todir='build/reports' graph='false' xml='false'/> <ivy:cachepath pathid="compile.path" conf="compile"/> </target> <target depends="clean" name="cleanall"/> <target depends="build-subprojects,build-project" name="build"/> <target name="build-subprojects"/> <target depends="init" name="build-project"> <echo message="${ant.project.name}: ${ant.file}"/> <javac debug="true" debuglevel="${debuglevel}" destdir="bin" includeantruntime="false" source="${source}" target="${target}"> <src path="src"/> <src path="."/> <exclude name="src/"/> <classpath refid="Ivy-final.classpath"/> </javac> </target> <target description="Build all projects which reference this project. Useful to propagate changes." name="build-refprojects"/> <target description="copy Eclipse compiler jars to ant lib directory" name="init-eclipse-compiler"> <copy todir="${ant.library.dir}"> <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/> </copy> <unzip dest="${ant.library.dir}"> <patternset includes="jdtCompilerAdapter.jar"/> <fileset dir="${ECLIPSE_HOME}/plugins" includes="org.eclipse.jdt.core_*.jar"/> </unzip> </target> <target description="compile project with Eclipse compiler" name="build-eclipse-compiler"> <property name="build.compiler" value="org.eclipse.jdt.core.JDTCompilerAdapter"/> <antcall target="build"/> </target> </project>
As an aside I'm not sure if I'm supposed to be including the keystore by name or anything else. It's in my jdk\bin\ folder.
Thanks guys!
Similar Threads
-
Signing XML
By octavianaugustin in forum Advanced JavaReplies: 0Last Post: 11-15-2011, 03:48 PM -
doPrivilege or signing?
By joelius in forum Java AppletsReplies: 11Last Post: 09-21-2011, 11:50 PM -
Self signing for dummies?
By lemmy101 in forum Java AppletsReplies: 0Last Post: 03-18-2011, 11:32 AM -
applet signing
By milkman128 in forum Java AppletsReplies: 11Last Post: 10-06-2008, 02:05 PM -
Signing An Applet!!!!! Me Need Help!!!!! Plz!
By marco in forum Java AppletsReplies: 3Last Post: 07-29-2007, 05:45 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks