org.apache.jena.tools.schemagen.SchemagenMojo Maven / Gradle / Ivy
/**
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
// Package
///////////////
package org.apache.jena.tools.schemagen;
// Imports
///////////////
import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import jena.schemagen;
import jena.schemagen.SchemagenOptions.OPT;
import org.apache.jena.rdf.model.Resource ;
import org.apache.jena.rdf.model.ResourceFactory ;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
import org.codehaus.plexus.util.DirectoryScanner;
/**
* Maven plugin to execute Jena schemagen as part of a Jena-based
* project build cycle
*
*/
@Mojo(name="translate", defaultPhase=LifecyclePhase.GENERATE_SOURCES)
public class SchemagenMojo
extends AbstractMojo
{
/* ******************************* */
/* Constants */
/* ******************************* */
/** Default output location */
public static final String GENERATED_SOURCES = File.separator + "generated-sources";
/** Default pattern for includes */
/** Name of default options element */
public static final String DEFAULT_OPTIONS_ELEM = "default";
/* ******************************* */
/* Static variables */
/* ******************************* */
/* ******************************* */
/* Instance variables */
/* ******************************* */
/**
* @parameter property="project.build.directory"
*/
@Parameter(property="project.build.directory")
private String projectBuildDir;
/**
* Array of file patterns to include in processing
*/
@Parameter
private String[] includes = new String[0];
/**
* Array of file patterns to exclude from processing
*/
@Parameter
private String[] excludes = new String[0];
/**
* Options for individual files
*/
@Parameter
private List