Newbie eclipse question

I started using eclipse several months ago, but I have never gotten into the deeper features of it.

I am wondering how one would go about automatically signing a jar file and uploading it to a ftp server from inside eclipse? Any help will be appreciated ;D

Ant is good for this, and it’s got tasks already written to jar, sign and upload so it’s pretty easy to set up. Ant comes bundled with Eclipse, but if you want to FTP you’ll need a couple of extra jars ( commons-net and jakarta-oro, more info here: http://ant.apache.org/manual/install.html ).

I’m still a bit of a noob when it comes to Ant though, so if anyones got any good tips for using it better I’m all ears. :slight_smile:

I agree with Orangy Tang! Use Ant. Also, with Ant, you are not bound to the IDE - so if you decide to switch to NetBeans or anything else, all your build scripts will still work.

Ok, after about an hour or two of reading and testing, I finally got my Ant file working: creating the jar, signing it, and uploading it to my server. Thanks guys

Care to post your ant script here? :slight_smile:

sure, not sure if its properly formatted or anything but it works for me:


<?xml version="1.0"?>
<project name="TacticsOnline" basedir="." default="jar">
	<property name="bin" location="bin"/>
	<property name="build" location="build"/>
	<property name="jard"  location="jard"/>
	
	<target name="jar">
		<jar jarfile="${jard}/Tactics.jar" basedir="${bin}">
		<manifest>
		    <attribute name="Main-Class" value="net.tacticsonline.client.GameWindow"/>
		</manifest>
		</jar>
		
		<signjar jar="${jard}/Tactics.jar"
		alias="PowRader" storepass="<password here>" keystore="build/erickey2"/>

		<ftp server="www.therichards.com"
		       remotedir="public_html/e/tactics"
		       userid="<userid>"
		       password="<giving away my password would be bad>"
			passive="true"
		  >
		    <fileset dir="jard"/>
		  </ftp>
	</target>
</project>