@SuppressWarnings({"rawtypes", "unchecked"}) @Test public void testExecute() throws MojoExecutionException, ClassNotFoundException, MojoFailureException, IOException { packages.add("com.nitorcreations.testdomain"); mojo.execute(); assertThat(Files.exists(Paths.get("domainmap.dot")), is(true)); Files.delete(Paths.get("domainmap.dot")); }
@Override public void execute() throws MojoExecutionException, MojoFailureException { if (packages.isEmpty()) throw new MojoFailureException("No packages defined for scanning."); try { List<URL> projectClasspathList = getClasspathUrls(); DomainMapper mapper = DomainMapper.create(packages, new URLClassLoader(projectClasspathList.toArray(new URL[projectClasspathList.size()]))); Files.write(Paths.get(outputDirectory.getPath(), "domainmap.dot"), mapper.describeDomain().getBytes()); } catch (ClassNotFoundException | DependencyResolutionRequiredException | IOException e) { throw new MojoExecutionException(e.getMessage(), e); } }
DomainMapperMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { if (packages.isEmpty()) throw new MojoFailureException("No packages defined for scanning."); try { List<URL> projectClasspathList = getClasspathUrls(); DomainMapper mapper = DomainMapper.create(packages, new URLClassLoader(projectClasspathList.toArray(new URL[projectClasspathList.size()]))); Files.write(Paths.get(outputDirectory.getPath(), "domainmap.dot"), mapper.describeDomain().getBytes()); } catch (ClassNotFoundException | DependencyResolutionRequiredException | IOException e) { throw new MojoExecutionException(e.getMessage(), e); } } }
DomainMapperMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { if (packages.isEmpty()) throw new MojoFailureException("No packages defined for scanning."); try { List<URL> projectClasspathList = getClasspathUrls(); DomainMapper mapper = DomainMapper.create(packages, new URLClassLoader(projectClasspathList.toArray(new URL[projectClasspathList.size()]))); Files.write(Paths.get(outputDirectory.getPath(), "domainmap.dot"), mapper.describeDomain().getBytes()); } catch (ClassNotFoundException | DependencyResolutionRequiredException | IOException e) { throw new MojoExecutionException(e.getMessage(), e); } }  }
DomainMapperMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { if (packages.isEmpty()) throw new MojoFailureException("No packages defined for scanning."); try { List<URL> projectClasspathList = getClasspathUrls(); DomainMapper mapper = DomainMapper.create(packages, new URLClassLoader(projectClasspathList.toArray(new URL[projectClasspathList.size()]))); Files.write(Paths.get(outputDirectory.getPath(), "domainmap.dot"), mapper.describeDomain().getBytes()); } catch (ClassNotFoundException | DependencyResolutionRequiredException | IOException e) { throw new MojoExecutionException(e.getMessage(), e); } }  @Override void execute(); }
DomainMapperMojo extends AbstractMojo { @Override public void execute() throws MojoExecutionException, MojoFailureException { if (packages.isEmpty()) throw new MojoFailureException("No packages defined for scanning."); try { List<URL> projectClasspathList = getClasspathUrls(); DomainMapper mapper = DomainMapper.create(packages, new URLClassLoader(projectClasspathList.toArray(new URL[projectClasspathList.size()]))); Files.write(Paths.get(outputDirectory.getPath(), "domainmap.dot"), mapper.describeDomain().getBytes()); } catch (ClassNotFoundException | DependencyResolutionRequiredException | IOException e) { throw new MojoExecutionException(e.getMessage(), e); } }  @Override void execute();  }