+ Map<String,String> md5s;
+ boolean modified = false;
+ File saved = new File(buildDirectory + File.separator + MD5S);
+
+ if (saved.exists())
+ {
+ try
+ {
+ FileInputStream fis = new FileInputStream(saved);
+ ObjectInputStream ois = new ObjectInputStream(fis);
+ md5s = (HashMap<String,String>)ois.readObject();
+ ois.close();
+ }
+ catch (Exception e)
+ {
+ md5s = new HashMap<String,String>();
+ getLog().warn("Cannot read timestamps from saved: " + e);
+ }
+ }
+ else
+ {
+ md5s = new HashMap<String,String>();
+ try
+ {
+ saved.createNewFile();
+ }
+ catch (IOException e)
+ {
+ getLog().warn("Cannot create saved for timestamps: " + e);
+ }
+ }
+
+ ClassLoader classLoader = null;
+ try
+ {
+ getLog().debug("Creating ClassLoader for project-dependencies...");
+ List<String> classpathFiles = project.getCompileClasspathElements();
+ if (scanTestClasses)
+ classpathFiles.addAll(project.getTestClasspathElements());
+ URL[] urls = new URL[classpathFiles.size()];
+ for (int i = 0; i < classpathFiles.size(); ++i)
+ {
+ getLog().debug("Dependency: " + classpathFiles.get(i));
+ urls[i] = new File(classpathFiles.get(i)).toURI().toURL();
+ }
+ classLoader = new URLClassLoader(urls, getClass().getClassLoader());
+ }
+ catch (Exception e)
+ {
+ getLog().error("Error while creating ClassLoader!", e);
+ throw new MojoExecutionException(e.getMessage());
+ }
+
+ Set<Class<?>> classes =
+ new TreeSet<Class<?>>(
+ new Comparator<Class<?>>() {
+ @Override
+ public int compare(Class<?> a, Class<?> b)
+ {
+ return a.getName().compareTo(b.getName());
+ }
+ }
+ );