You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@jena.apache.org by bi...@apache.org on 2014/06/28 15:51:31 UTC
svn commit: r1606357 - in /jena/trunk/jena-maven-tools: ./
src/main/java/org/apache/jena/tools/schemagen/SchemagenMojo.java
Author: bimargulies
Date: Sat Jun 28 13:51:31 2014
New Revision: 1606357
URL: http://svn.apache.org/r1606357
Log:
JENA-731 JENA-732: revert pending dicussion.
Modified:
jena/trunk/jena-maven-tools/ (props changed)
jena/trunk/jena-maven-tools/src/main/java/org/apache/jena/tools/schemagen/SchemagenMojo.java
Propchange: jena/trunk/jena-maven-tools/
------------------------------------------------------------------------------
--- svn:ignore (original)
+++ svn:ignore Sat Jun 28 13:51:31 2014
@@ -5,3 +5,7 @@ target
.classpath
.project
+
+.idea
+
+*.iml
Modified: jena/trunk/jena-maven-tools/src/main/java/org/apache/jena/tools/schemagen/SchemagenMojo.java
URL: http://svn.apache.org/viewvc/jena/trunk/jena-maven-tools/src/main/java/org/apache/jena/tools/schemagen/SchemagenMojo.java?rev=1606357&r1=1606356&r2=1606357&view=diff
==============================================================================
--- jena/trunk/jena-maven-tools/src/main/java/org/apache/jena/tools/schemagen/SchemagenMojo.java (original)
+++ jena/trunk/jena-maven-tools/src/main/java/org/apache/jena/tools/schemagen/SchemagenMojo.java Sat Jun 28 13:51:31 2014
@@ -39,11 +39,9 @@ import jena.schemagen.SchemagenOptions.O
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.plugins.annotations.Component;
import org.apache.maven.plugins.annotations.LifecyclePhase;
import org.apache.maven.plugins.annotations.Mojo;
import org.apache.maven.plugins.annotations.Parameter;
-import org.apache.maven.project.MavenProject;
import org.codehaus.plexus.util.DirectoryScanner;
import com.hp.hpl.jena.rdf.model.Resource;
@@ -63,6 +61,9 @@ public class SchemagenMojo
/* Constants */
/***********************************/
+ /** Default output location */
+ public static final String GENERATED_SOURCES = File.separator + "generated-sources";
+
/** Default pattern for includes */
/** Name of default options element */
@@ -76,8 +77,13 @@ public class SchemagenMojo
/* Instance variables */
/***********************************/
- @Parameter(defaultValue = "${project.build.directory}/generated-sources/jena")
- private String outputDirectory;
+ /**
+ * @parameter property="project.build.directory"
+ */
+
+ @Parameter(property="project.build.directory")
+ private String projectBuildDir;
+
/**
* Array of file patterns to include in processing
@@ -103,18 +109,12 @@ public class SchemagenMojo
@Parameter(property="basedir")
private File baseDir;
- @Component
- private MavenProject project;
-
/** The default options object, if any */
private SchemagenOptions defaultOptions;
/** Map of source options, indexed by name */
private Map<String, SchemagenOptions> optIndex = new HashMap<>();
- public SchemagenMojo() {
- }
-
/***********************************/
/* Constructors */
/***********************************/
@@ -150,7 +150,6 @@ public class SchemagenMojo
for (String fileName: matchFileNames()) {
processFile( fileName );
}
- project.addCompileSourceRoot( new File( outputDirectory ).getAbsolutePath() );
} catch (SchemagenOptionsConfigurationException e) {
throw new MojoExecutionException(
"Error during default schemagen options creation", e);
@@ -192,7 +191,12 @@ public class SchemagenMojo
return defaultOptions;
}
- /**
+ /** Return the value of <code>${project.build.directory}</code> */
+ public String getProjectBuildDir() {
+ return projectBuildDir;
+ }
+
+ /**
* Handle the default options by creating a default options object and assigning
* the options values from the given source object.
* @param defOptionsSource The source object containing the default options
@@ -346,7 +350,7 @@ public class SchemagenMojo
}
protected String getDefaultOutputDir(){
- return outputDirectory;
+ return projectBuildDir + GENERATED_SOURCES;
}
/***********************************/