*/
private Map<String,String> properties;
public void execute() throws MojoExecutionException {
try {
JAXBGenerator jaxbGenerator = new JAXBGenerator();
jaxbGenerator.setSourceOutputDirectory(sourceOutputDirectory.getAbsolutePath());
jaxbGenerator.setClassesOutputDirectory(classesOutputDirectory.getAbsolutePath());
jaxbGenerator.getClasses().addAll(Arrays.asList(classes));
if (properties != null) {
jaxbGenerator.getProperties().putAll(properties);
}
// need to manually create the classloader since maven won't give me one
String directory = project.getBuild().getOutputDirectory();
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
if (classLoader == null) classLoader = getClass().getClassLoader();
classLoader = new URLClassLoader(new URL[]{new File(directory).toURI().toURL()}, classLoader);
jaxbGenerator.setClassLoader(classLoader);
jaxbGenerator.generate();
} catch (JAXBException e) {
throw new MojoExecutionException("Error generating JaxB parser: " + e.getMessage(), e);
} catch (MalformedURLException e) {
throw new MojoExecutionException("Invalid build outputDirectory " + project.getBuild().getOutputDirectory());
}