if (file.isDirectory()) {
return new ExplodedPlugin(file);
} else if (file.getName().endsWith(".jar")) //$NON-NLS-1$
{
try {
return new PackagedPlugin(file);
} catch (IOException e) {
throw new MojoExecutionException(
Messages.getString(
"EclipseToMavenMojo.unabletoaccessjar", file.getAbsolutePath()), e); //$NON-NLS-1$
}