Automatically build number generation in ANT

I wanted to find some solution to a problem of automatic generation of build numbers/version identifiers using an ANT. I figured out that I can achieve it in the following way: <target name="numerate.version" description="Generates version number and sets it in Client properties file."> <tstamp> <format property="build.time" pattern="yy-MM-dd_hh:mm" unit="hour" /> </tstamp> <buildnumber file="build.number" /> <property name="version.code" value="${build.version}/${build.time}/${build.number}" /> <echo>Version: ${version.code}</echo> <replaceregexp file="${client.commonsi18n.pl}" match="(version[ \t]*=[ \t]*)+.*$" byline="true" replace="\1${version.code}" /> </target> A short description what is going on:...

January 9, 2011 · 1 min

Axis and Java2WSDL

In the Axis2 (which you can download from this site) bin subdirectory, there is a java2wsdl.sh file which can be used to generate a WSDL file from plain Java classes. Below is a very rough example how to use it: /home/palli/axis2-1.5.4/bin/java2wsdl.sh -o /home/palli/ -of Test.wsdl -sn WSAdditionalOperations -cp . -cn com.nullhaus.ediploma.server.WSAdditionalOperations Used arguments: Parameter Description o output directory where the generated WSDL will be saved of output filename of the WSDL cp java classpath sn name of the service cn fully qualified name of the class you want to be used to generate the WSDL file

January 8, 2011 · 1 min

JAR from command line -- the arguments order does matter

When you create a *.jar file using jar command-line tool, it is worth to remember that the order of arguments does matter, so: jar cmvf projects/myTags/etc/MANIFEST.MF myTags.war myTags means that you must firstly provide the manifest file (m), than the JAR filename (f). If you use the same order of arguments but change the switches like this: jar cvfm projects/myTags/etc/MANIFEST.MF myTags.war myTags the command will not be executed. According to the switches, your first argument should be the JAR filename (f) and then manifest file (m)....

January 2, 2011 · 1 min

Hibernate3 and Maven2

Tonight I’ve fought with making Maven and Hibernate to cooperate… After 1,5h struggle, I’ve decided to write down what I’ve “discovered”. When adding dependencies to your persist module you should avoid adding the hibernate package dependency itself as there should be only hibernate-annotations one. When adding log4j dependency remember that version 1.2.15 is messed up and forces you to download jars from SUN webpages if you want to get rid of those nasty dependency errors that maven throw in your face… Instead of 1....

May 30, 2009 · 1 min