Skip to content

Commit ebcd648

Browse files
author
Morten Haraldsen
committed
Fixes #42
1 parent 0477f71 commit ebcd648

File tree

2 files changed

+15
-5
lines changed

2 files changed

+15
-5
lines changed

Diff for: pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<modelVersion>4.0.0</modelVersion>
44
<groupId>com.ethlo.persistence.tools</groupId>
55
<artifactId>eclipselink-maven-plugin</artifactId>
6-
<version>3.0.1</version>
6+
<version>3.0.2</version>
77
<packaging>maven-plugin</packaging>
88
<name>Eclipselink Maven Plugin</name>
99
<description>Maven Plugin for Eclipselink supporting static weaving, meta-model generation and DDL generation

Diff for: src/main/java/com/ethlo/persistence/tools/eclipselink/EclipselinkModelGenMojo.java

+14-4
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,17 @@ public void execute() throws MojoExecutionException
193193

194194
private Set<File> getSourceFiles()
195195
{
196-
if (source == null || !source.exists())
196+
final Set<File> fromSource = getFilesFromDirectory(source);
197+
final Set<File> fromGenerated = getFilesFromDirectory(generatedSourcesDirectory);
198+
final Set<File> all = new TreeSet<>();
199+
all.addAll(fromSource);
200+
all.addAll(fromGenerated);
201+
return all;
202+
}
203+
204+
private Set<File> getFilesFromDirectory(File dir)
205+
{
206+
if (dir == null || !dir.exists())
197207
{
198208
return new TreeSet<>();
199209
}
@@ -208,12 +218,12 @@ private Set<File> getSourceFiles()
208218
}
209219
}
210220

211-
Set<File> files = new HashSet<>();
212-
final Scanner scanner = buildContext.newScanner(source);
221+
final Set<File> files = new HashSet<>();
222+
final Scanner scanner = buildContext.newScanner(dir);
213223
scanner.setIncludes(filters);
214224
scanner.scan();
215225

216-
String[] includedFiles = scanner.getIncludedFiles();
226+
final String[] includedFiles = scanner.getIncludedFiles();
217227
if (includedFiles != null)
218228
{
219229
for (String includedFile : includedFiles)

0 commit comments

Comments
 (0)