diff --git a/pom.xml b/pom.xml
index 51c822e..0b49d1d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -3,7 +3,7 @@
4.0.0
com.ethlo.persistence.tools
eclipselink-maven-plugin
- 3.0.1
+ 3.0.2
maven-plugin
Eclipselink Maven Plugin
Maven Plugin for Eclipselink supporting static weaving, meta-model generation and DDL generation
diff --git a/src/main/java/com/ethlo/persistence/tools/eclipselink/EclipselinkModelGenMojo.java b/src/main/java/com/ethlo/persistence/tools/eclipselink/EclipselinkModelGenMojo.java
index f18c5f4..8666a36 100644
--- a/src/main/java/com/ethlo/persistence/tools/eclipselink/EclipselinkModelGenMojo.java
+++ b/src/main/java/com/ethlo/persistence/tools/eclipselink/EclipselinkModelGenMojo.java
@@ -193,7 +193,17 @@ public void execute() throws MojoExecutionException
private Set getSourceFiles()
{
- if (source == null || !source.exists())
+ final Set fromSource = getFilesFromDirectory(source);
+ final Set fromGenerated = getFilesFromDirectory(generatedSourcesDirectory);
+ final Set all = new TreeSet<>();
+ all.addAll(fromSource);
+ all.addAll(fromGenerated);
+ return all;
+ }
+
+ private Set getFilesFromDirectory(File dir)
+ {
+ if (dir == null || !dir.exists())
{
return new TreeSet<>();
}
@@ -208,12 +218,12 @@ private Set getSourceFiles()
}
}
- Set files = new HashSet<>();
- final Scanner scanner = buildContext.newScanner(source);
+ final Set files = new HashSet<>();
+ final Scanner scanner = buildContext.newScanner(dir);
scanner.setIncludes(filters);
scanner.scan();
- String[] includedFiles = scanner.getIncludedFiles();
+ final String[] includedFiles = scanner.getIncludedFiles();
if (includedFiles != null)
{
for (String includedFile : includedFiles)