If you're interested in functional programming, you might also want to checkout my second blog which i'm actively working on!!

Monday, July 12, 2010

finding corrupt jars in maven repository

I use cygwin (a linux emulator) as one of my favourite development tools. And once again cygwin comes to the rescue for finding corrupt jars.

Make sure you have unzip/zip installed for cygwin and then you can do the following from the command line:

nxp10009@NLVEHVBE01NB13D /cygdrive/c/Documents and Settings/nxp10009/.m2/repository
$ find . -name "*jar" | xargs -L 1 zip -T | grep error | grep invalid

zip error: Zip file structure invalid (./javax/mail/mail/1.4/mail-1.4.jar)
zip error: Zip file structure invalid (./org/apache/axis2/axis2-adb/1.4.1/axis2-adb-1.4.1.jar)
zip error: Zip file structure invalid (./org/apache/axis2/axis2-kernel/1.4.1/axis2-kernel-1.4.1.jar)
zip error: Zip file structure invalid (./org/apache/geronimo/specs/geronimo-stax-api_1.0_spec/1.0.1/geronimo-stax-api_1.0_spec-1.0.1.jar)
You should try to delete those corrupt jars from your repository and download them again.