In your eclipse Project create a folder
Then add the jar file(a) inside the lid directory like
/myjar2.jar .... etc.
For each jar file you add an entry in the metadata.xml like:
... <JarResources> <FileResource type="JAR" file="myjar1.jar" description="myjar1.jar description" /> <FileResource type="JAR" file="myjar2.jar" description="myjar2.jar description" /> </JarResources> ...
If you are using Eclipse ThingWorx Extension Development Plugin then New Jar action will automatically update the metadata.xml for you.
This is how you add an external jar to an extension project. It does not answer the question on how you deal with a conflicting jar scenario.
In the Thingworx Web-Inf folder there are two subfolders--lib and extensions. When you install an extension, the zip contents are extracted to the extension folder. However, if there is a library already used by thingworx, it will be found in the lib folder. You will NOT be able to install your extension if you use a jar library that is newer than one found in that lib folder. In my case, I'm using opencsv-3.8.jar and Thingwrox is using opencsv-2.3.jar. The only way I've been able to get my extension to install is to rename opencsv-2.3.jar to .bak and restart tomcat.
I need to know how to use my newer version of the jar file without having to disable the jar file that was included with thingworx.
Remove the conflicting jar from your metadata file -- it shouldn't be necessary if there is a conflicting jar on the JVM.
That said, there is an existing extension on the marketplace with this functionality: ThingWorx IoT Marketplace
Edit: Just noticed you are using a newer version of the library -- there is no way to remove that via an extension; if two extensions are using the same library only the first one installed will work. This has to do with how tomcat loads libraries into the JVM, there is no way to unload a library at runtime, tomcat has to be shut down and the library must be removed from the classpath (as you suggested you have done).
Parsley shouldn't have this issue, however -- it doesn't rely on the open csv library -- and also resolved the EOL problem and will parse CSV files without a data shape.