@Test @Ignore public void Execute() { }
public void execute() throws MojoExecutionException, MojoFailureException { try { URLClassLoader classLoader = getProjectClassLoader(); final Pattern pattern = Pattern.compile(".*" + toRegex(classes) + "\\.class"); ArchiveBrowser.Filter filter = new ArchiveBrowser.Filter() { public boolean accept(String name) { return pattern.matcher(name).matches(); } }; List<Class<?>> entityClasses = getEntityClasses(classLoader, filter); Collections.sort(entityClasses, fileComparator); DefaultConfiguration configuration = new DefaultConfiguration(); configuration.addClasses(entityClasses.toArray(new Class[entityClasses.size()])); if (ontology == null) { if (namespace.endsWith("#") || namespace.endsWith("/")) { ontology = namespace.substring(0, namespace.length() - 1); } else { ontology = namespace; } } if (schemaFile != null) { if (!schemaFile.getParentFile().exists()) { if (!schemaFile.getParentFile().mkdirs()) { getLog().info("Creation of " + schemaFile.getParentFile().getPath() + " failed"); } } OutputStream out = new FileOutputStream(schemaFile); SchemaGen schemaGen = new SchemaGen() .setNamespace(prefix, namespace) .setOntology(ontology) .addExportNamespace(namespace) .setConfiguration(configuration); if (useTurtle) { schemaGen.export(Format.TURTLE, out); } else { schemaGen.export(Format.RDFXML, out); } } if (classListFile != null) { StringBuilder builder = new StringBuilder(); for (Class<?> clazz : entityClasses) { if (builder.length() > 0) { builder.append("\n"); } builder.append(clazz.getName()); } Files.write(builder.toString(), classListFile, Charsets.UTF_8); } } catch (IOException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new MojoExecutionException(e.getMessage(), e); } }
SchemaGenMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { try { URLClassLoader classLoader = getProjectClassLoader(); final Pattern pattern = Pattern.compile(".*" + toRegex(classes) + "\\.class"); ArchiveBrowser.Filter filter = new ArchiveBrowser.Filter() { public boolean accept(String name) { return pattern.matcher(name).matches(); } }; List<Class<?>> entityClasses = getEntityClasses(classLoader, filter); Collections.sort(entityClasses, fileComparator); DefaultConfiguration configuration = new DefaultConfiguration(); configuration.addClasses(entityClasses.toArray(new Class[entityClasses.size()])); if (ontology == null) { if (namespace.endsWith("#") || namespace.endsWith("/")) { ontology = namespace.substring(0, namespace.length() - 1); } else { ontology = namespace; } } if (schemaFile != null) { if (!schemaFile.getParentFile().exists()) { if (!schemaFile.getParentFile().mkdirs()) { getLog().info("Creation of " + schemaFile.getParentFile().getPath() + " failed"); } } OutputStream out = new FileOutputStream(schemaFile); SchemaGen schemaGen = new SchemaGen() .setNamespace(prefix, namespace) .setOntology(ontology) .addExportNamespace(namespace) .setConfiguration(configuration); if (useTurtle) { schemaGen.export(Format.TURTLE, out); } else { schemaGen.export(Format.RDFXML, out); } } if (classListFile != null) { StringBuilder builder = new StringBuilder(); for (Class<?> clazz : entityClasses) { if (builder.length() > 0) { builder.append("\n"); } builder.append(clazz.getName()); } Files.write(builder.toString(), classListFile, Charsets.UTF_8); } } catch (IOException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new MojoExecutionException(e.getMessage(), e); } } }
SchemaGenMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { try { URLClassLoader classLoader = getProjectClassLoader(); final Pattern pattern = Pattern.compile(".*" + toRegex(classes) + "\\.class"); ArchiveBrowser.Filter filter = new ArchiveBrowser.Filter() { public boolean accept(String name) { return pattern.matcher(name).matches(); } }; List<Class<?>> entityClasses = getEntityClasses(classLoader, filter); Collections.sort(entityClasses, fileComparator); DefaultConfiguration configuration = new DefaultConfiguration(); configuration.addClasses(entityClasses.toArray(new Class[entityClasses.size()])); if (ontology == null) { if (namespace.endsWith("#") || namespace.endsWith("/")) { ontology = namespace.substring(0, namespace.length() - 1); } else { ontology = namespace; } } if (schemaFile != null) { if (!schemaFile.getParentFile().exists()) { if (!schemaFile.getParentFile().mkdirs()) { getLog().info("Creation of " + schemaFile.getParentFile().getPath() + " failed"); } } OutputStream out = new FileOutputStream(schemaFile); SchemaGen schemaGen = new SchemaGen() .setNamespace(prefix, namespace) .setOntology(ontology) .addExportNamespace(namespace) .setConfiguration(configuration); if (useTurtle) { schemaGen.export(Format.TURTLE, out); } else { schemaGen.export(Format.RDFXML, out); } } if (classListFile != null) { StringBuilder builder = new StringBuilder(); for (Class<?> clazz : entityClasses) { if (builder.length() > 0) { builder.append("\n"); } builder.append(clazz.getName()); } Files.write(builder.toString(), classListFile, Charsets.UTF_8); } } catch (IOException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new MojoExecutionException(e.getMessage(), e); } }  }
SchemaGenMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { try { URLClassLoader classLoader = getProjectClassLoader(); final Pattern pattern = Pattern.compile(".*" + toRegex(classes) + "\\.class"); ArchiveBrowser.Filter filter = new ArchiveBrowser.Filter() { public boolean accept(String name) { return pattern.matcher(name).matches(); } }; List<Class<?>> entityClasses = getEntityClasses(classLoader, filter); Collections.sort(entityClasses, fileComparator); DefaultConfiguration configuration = new DefaultConfiguration(); configuration.addClasses(entityClasses.toArray(new Class[entityClasses.size()])); if (ontology == null) { if (namespace.endsWith("#") || namespace.endsWith("/")) { ontology = namespace.substring(0, namespace.length() - 1); } else { ontology = namespace; } } if (schemaFile != null) { if (!schemaFile.getParentFile().exists()) { if (!schemaFile.getParentFile().mkdirs()) { getLog().info("Creation of " + schemaFile.getParentFile().getPath() + " failed"); } } OutputStream out = new FileOutputStream(schemaFile); SchemaGen schemaGen = new SchemaGen() .setNamespace(prefix, namespace) .setOntology(ontology) .addExportNamespace(namespace) .setConfiguration(configuration); if (useTurtle) { schemaGen.export(Format.TURTLE, out); } else { schemaGen.export(Format.RDFXML, out); } } if (classListFile != null) { StringBuilder builder = new StringBuilder(); for (Class<?> clazz : entityClasses) { if (builder.length() > 0) { builder.append("\n"); } builder.append(clazz.getName()); } Files.write(builder.toString(), classListFile, Charsets.UTF_8); } } catch (IOException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new MojoExecutionException(e.getMessage(), e); } }  void execute(); }
SchemaGenMojo extends AbstractMojo { public void execute() throws MojoExecutionException, MojoFailureException { try { URLClassLoader classLoader = getProjectClassLoader(); final Pattern pattern = Pattern.compile(".*" + toRegex(classes) + "\\.class"); ArchiveBrowser.Filter filter = new ArchiveBrowser.Filter() { public boolean accept(String name) { return pattern.matcher(name).matches(); } }; List<Class<?>> entityClasses = getEntityClasses(classLoader, filter); Collections.sort(entityClasses, fileComparator); DefaultConfiguration configuration = new DefaultConfiguration(); configuration.addClasses(entityClasses.toArray(new Class[entityClasses.size()])); if (ontology == null) { if (namespace.endsWith("#") || namespace.endsWith("/")) { ontology = namespace.substring(0, namespace.length() - 1); } else { ontology = namespace; } } if (schemaFile != null) { if (!schemaFile.getParentFile().exists()) { if (!schemaFile.getParentFile().mkdirs()) { getLog().info("Creation of " + schemaFile.getParentFile().getPath() + " failed"); } } OutputStream out = new FileOutputStream(schemaFile); SchemaGen schemaGen = new SchemaGen() .setNamespace(prefix, namespace) .setOntology(ontology) .addExportNamespace(namespace) .setConfiguration(configuration); if (useTurtle) { schemaGen.export(Format.TURTLE, out); } else { schemaGen.export(Format.RDFXML, out); } } if (classListFile != null) { StringBuilder builder = new StringBuilder(); for (Class<?> clazz : entityClasses) { if (builder.length() > 0) { builder.append("\n"); } builder.append(clazz.getName()); } Files.write(builder.toString(), classListFile, Charsets.UTF_8); } } catch (IOException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (DependencyResolutionRequiredException e) { throw new MojoExecutionException(e.getMessage(), e); } catch (ClassNotFoundException e) { throw new MojoExecutionException(e.getMessage(), e); } }  void execute();  }