Skip to content

Commit 6324461

Browse files
committed
Fixed path attribute.
Can be null, in which case ut/PLSQL need to scan all the sources for the correct annotation
1 parent 2193755 commit 6324461

1 file changed

Lines changed: 23 additions & 21 deletions

File tree

‎utplsql-maven-plugin/src/main/java/org/utplsql/UtPLSQLMojo.java‎

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import org.apache.maven.model.Resource;
2020
import org.apache.maven.plugin.AbstractMojo;
2121
import org.apache.maven.plugin.MojoExecutionException;
22+
import org.apache.maven.plugin.logging.Log;
2223
import org.apache.maven.plugins.annotations.LifecyclePhase;
2324
import org.apache.maven.plugins.annotations.Mojo;
2425
import org.apache.maven.plugins.annotations.Parameter;
@@ -64,7 +65,7 @@ public class UtPLSQLMojo extends AbstractMojo {
6465
private List<ReporterParameter> reporters;
6566
private Map<String, ReporterParameter> mapReporters = new HashMap<>();
6667

67-
@Parameter
68+
@Parameter(defaultValue = "")
6869
private List<String> paths;
6970

7071
@Parameter
@@ -83,8 +84,18 @@ public class UtPLSQLMojo extends AbstractMojo {
8384
*/
8485
@Override
8586
public void execute() throws MojoExecutionException {
86-
FileMapperOptions sourceMappingOptions = buildOptions(sources, PluginDefault.buildDefaultSource());
87-
FileMapperOptions testMappingOptions = buildOptions(tests, PluginDefault.buildDefaultTest());
87+
FileMapperOptions sourceMappingOptions = null;
88+
try {
89+
sourceMappingOptions = buildOptions(sources, PluginDefault.buildDefaultSource());
90+
} catch (Exception e) {
91+
throw new MojoExecutionException("Invalid <sources> in your pom.xml");
92+
}
93+
FileMapperOptions testMappingOptions = null;
94+
try {
95+
testMappingOptions = buildOptions(tests, PluginDefault.buildDefaultTest());
96+
} catch (Exception e) {
97+
throw new MojoExecutionException("Invalid <tests> in your pom.xml");
98+
}
8899

89100
Connection connection = null;
90101
List<Reporter> reporterList = null;
@@ -101,7 +112,7 @@ public void execute() throws MojoExecutionException {
101112
.addReporterList(reporterList)
102113
.sourceMappingOptions(sourceMappingOptions)
103114
.testMappingOptions(testMappingOptions)
104-
// .excludeObject(excludeObject)
115+
.excludeObject(excludeObject)
105116
.includeObject(includeObject)
106117
.skipCompatibilityCheck(skipCompatibilityCheck)
107118
.colorConsole(colorConsole)
@@ -191,37 +202,28 @@ private List<Reporter> initReporters(Connection connection) throws SQLException
191202

192203
private void dumpParameters(FileMapperOptions sourceMappingOptions, FileMapperOptions testMappingOptions,
193204
List<Reporter> reporterList) {
194-
StringBuilder msg = new StringBuilder();
195-
msg.append("Invoking TestRunner with: ").append('\n');
196-
msg.append("reporters=");
205+
Log log = getLog();
206+
log.debug("Invoking TestRunner with: ");
207+
log.debug("reporters=");
197208
reporterList.forEach(new Consumer<Reporter>() {
198209
@Override
199210
public void accept(Reporter t) {
200-
try {
201-
msg.append(t.getSQLTypeName()).append(", ");
202-
} catch (Exception e) {
203-
// NA
204-
}
211+
log.debug(t.getSelfType());
205212
}
206-
207213
});
208-
msg.append('\n');
209-
msg.append("sources=");
214+
log.debug("sources=");
210215
sourceMappingOptions.getFilePaths().forEach(new Consumer<String>() {
211216
@Override
212217
public void accept(String t) {
213-
msg.append(t).append(", ");
218+
log.debug(t);
214219
}
215220
});
216-
msg.append('\n');
217-
msg.append("tests=");
221+
log.debug("tests=");
218222
testMappingOptions.getFilePaths().forEach(new Consumer<String>() {
219223
@Override
220224
public void accept(String t) {
221-
msg.append(t).append(", ");
225+
log.debug(t);
222226
}
223227
});
224-
msg.append('\n');
225-
getLog().debug(msg.toString());
226228
}
227229
}

0 commit comments

Comments
 (0)