File pom = new File(pomFileName);
List<String> names = new ArrayList<String>();
Model model = pomReader.readModel(pom, false);
for (Object o : model.getAllDependencies()) {
Dependency dependency = (Dependency) o;
File file = pomReader.getArtifactFile(dependency);
if (FileUtil.getExtension(file).equals("jar")) {
final Manifest manifest = FileUtil.getManifest(new JarFile(file));
if (manifest != null) {
final Attributes mainAttributes = manifest.getMainAttributes();
final String className = mainAttributes.getValue(Attributes.Name.MAIN_CLASS);
if (className != null) {
names.add(className);
}
}
}
}
String groupId = model.getGroupId();
String artifactId = model.getArtifactId();
for (Iterator<String> j = names.iterator(); j.hasNext();) {
String className = j.next();
if (className.startsWith(groupId) || className.startsWith(groupId + "." + artifactId)) {