Friday, January 8, 2010

Scenario 1:
You can't compile because some arbitrary jar file is missing ... which is really a part of some bigger jar file or package ... so you can't find it on any maven repository.
As an example, let's take the case of servlet.jar
Well what do you do?

Cases like this exist because the jar will be present in the Application Server (Tomcat, Jboss etc.) at run-time for your code to use. So you really shouldn't look for the servlet.jar but instead you should be looking out for servlet-api.jar file, which will let you compile your source code.

Anyway a simple search on google couldn't hurt. Start with:

the name of your favorite maven repository host,

the generic name of the file you are looking for,

the keyword maven

Searching for ibiblio servlet maven quickly yields a link to "Index of /pub/mirrors/maven2/javax/servlet/servlet-api/2.3" which is exactly what the doctor prescribed.

For example, after looking at the website listed above,
a) with flex 4 beta 2 you would put: 4.0.0.10485
b) with flex 4 beta 1 you would put: 4.0.0.7219

Also you can check you local installation: FLEX_HOME\sdks\X.X.X\flex-sdk-description.xml

If you have flex mojos as part of your pom also then make sure to have a look here too: https://docs.sonatype.org/display/FLEXMOJOS/How+to+set+Flex+SDK+version ... You should also know that it didn't seem to work right away, instead afterr half hour of leaving that config in place but not having it work, eclipse magically found and downloaded the right compiler version and all went well. Not sure if it had to do with network timeouts or if the stuff was just added to the maven repo very recently.