Package org.fastnate.maven
Class ImportDataMojo
java.lang.Object
org.apache.maven.plugin.AbstractMojo
org.fastnate.maven.ImportDataMojo
- All Implemented Interfaces:
org.apache.maven.plugin.ContextEnabled,org.apache.maven.plugin.Mojo
@Mojo(name="import-data",
threadSafe=true,
defaultPhase=PROCESS_CLASSES,
requiresDependencyResolution=COMPILE)
public class ImportDataMojo
extends org.apache.maven.plugin.AbstractMojo
Creates an SQL file from all
DataProvider.- Author:
- Tobias Liefke
-
Field Summary
FieldsModifier and TypeFieldDescriptionAny additional settings for the EntitySqlGenerator, seeGeneratorContextfor an overview of available settings.private StringThe implementation class ofDataChangeDetector, to check if a changed file is relevant for SQL generation.private org.sonatype.plexus.build.incremental.BuildContextThe current build context for incremental builds.private FileThe data folder for importers (e.g. to import CSV files).private StringThe name of the database dialect.private StringThe encoding of the target and the prefix / postfix files.private StringThe packages to scan for data providers.private StringOne or more SQL files in the data folder, or an SQL snippet itself - to put that after the generated SQL.private StringOne or more SQL files in the data folder, or an SQL snippet itself - to put that before the generated SQL.private org.apache.maven.project.MavenProjectThe POM project.private String[]A list of patterns for files which are monitored and start the generation when changed.private static final Stringprivate booleanIndicates to skip the execution of this plugin, even if it is configured for a phase.private FileThe path to the output file.Fields inherited from interface org.apache.maven.plugin.Mojo
ROLE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static voidaddProperty(Properties settings, String key, String value) private URLClassLoaderprivate booleandetectChanges(Properties newSettings, File outputFile) private booleandetectFilePropertyChanges(Properties properties, String key, File outputFile) private booleanprivate booleanprivate booleanprivate booleanvoidexecute()private static booleanisAnnotationPresent(Class<?> c, Class<? extends Annotation>... annotations) private static voidremoveObsoleteFiles(Properties oldSettings, Properties newSettings) Methods inherited from class org.apache.maven.plugin.AbstractMojo
getLog, getPluginContext, setLog, setPluginContext
-
Field Details
-
SETTINGS_KEY
-
context
@Inject private org.sonatype.plexus.build.incremental.BuildContext contextThe current build context for incremental builds. -
project
@Inject private org.apache.maven.project.MavenProject projectThe POM project. -
skip
@Parameter private boolean skipIndicates to skip the execution of this plugin, even if it is configured for a phase. -
dialect
The name of the database dialect. -
packages
The packages to scan for data providers. -
dataFolder
The data folder for importers (e.g. to import CSV files). -
sqlFile
The path to the output file. -
encoding
The encoding of the target and the prefix / postfix files. -
prefix
One or more SQL files in the data folder, or an SQL snippet itself - to put that before the generated SQL. -
postfix
One or more SQL files in the data folder, or an SQL snippet itself - to put that after the generated SQL. -
relevantFiles
A list of patterns for files which are monitored and start the generation when changed. SeechangeDetectorfor more complicated change detection. All patterns are relative to the "src" directory, as Eclipse Bug 508238 prevents patterns relative to the base directory. -
changeDetector
The implementation class ofDataChangeDetector, to check if a changed file is relevant for SQL generation. -
additionalSettings
Any additional settings for the EntitySqlGenerator, seeGeneratorContextfor an overview of available settings. Add a setting with:<setting_name>setting_value</setting_name>
-
-
Constructor Details
-
ImportDataMojo
public ImportDataMojo()
-
-
Method Details
-
addProperty
-
isAnnotationPresent
-
removeObsoleteFiles
-
buildClassLoader
- Throws:
org.apache.maven.plugin.MojoExecutionException
-
detectChanges
-
detectFilePropertyChanges
-
detectRelevantChagesUsingDetector
private boolean detectRelevantChagesUsingDetector() -
detectRelevantClassFileChanges
private boolean detectRelevantClassFileChanges() -
detectRelevantFileChanges
private boolean detectRelevantFileChanges() -
detectRelevantSourceFileChanges
private boolean detectRelevantSourceFileChanges() -
execute
public void execute() throws org.apache.maven.plugin.MojoExecutionException, org.apache.maven.plugin.MojoFailureException- Throws:
org.apache.maven.plugin.MojoExecutionExceptionorg.apache.maven.plugin.MojoFailureException
-