Using More FlexPMD Rules with the Eclipse plugin of FlexPMD

One of the easiest ways to use FlexPMD is using the Eclipse plugin. When you use the Eclipse plugin of FlexPMD and you want to use the More FlexPMD Rules, you might wonder how to make the classpath include the .jar file of the More FlexPMD Rules.

Although it is not as easy as extending the classpath for an Ant task, it is still not very difficult. Here is how you can make it work:

  • Put the moreflexpmdrules.jar file in the same directory as your FlexPMD jar files.
  • Now open the file flex-pmd-command-line-1.0.jar with 7Zip.
  • Navigate to the directory called META-INF. This contains a file called MANIFEST.MF.
  • Right click on the file and choose the option Edit.
  • Add the name of the new .jar file the Classpath entry in this files.
  • Save the new MANIFEST.MF file.
  • When you close the file you will be asked to update the archive, choose yes.

Now the rules of More FlexPMD Rules can be used with the Eclipse plugin of FlexPMD! Of course you can use this with other .jar files too.