Re-order if blocks in RunMojo
Avoids loading a class if not needed, but doesn't seem to solve any actual problems. I'll leave it in in case it helps later. Testing gh-648
This commit is contained in:
parent
24597ae423
commit
620d8eb87e
|
|
@ -120,14 +120,16 @@ public class RunMojo extends AbstractMojo {
|
||||||
|
|
||||||
private void findAgent() {
|
private void findAgent() {
|
||||||
try {
|
try {
|
||||||
Class<?> loaded = Class.forName(SPRING_LOADED_AGENT_CLASSNAME);
|
if (this.agent == null) {
|
||||||
if (this.agent == null && loaded != null) {
|
Class<?> loaded = Class.forName(SPRING_LOADED_AGENT_CLASSNAME);
|
||||||
if (this.noverify == null) {
|
if (loaded != null) {
|
||||||
this.noverify = true;
|
if (this.noverify == null) {
|
||||||
}
|
this.noverify = true;
|
||||||
CodeSource source = loaded.getProtectionDomain().getCodeSource();
|
}
|
||||||
if (source != null) {
|
CodeSource source = loaded.getProtectionDomain().getCodeSource();
|
||||||
this.agent = new File(source.getLocation().getFile());
|
if (source != null) {
|
||||||
|
this.agent = new File(source.getLocation().getFile());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -198,7 +200,8 @@ public class RunMojo extends AbstractMojo {
|
||||||
for (Resource resource : this.project.getResources()) {
|
for (Resource resource : this.project.getResources()) {
|
||||||
File directory = new File(resource.getDirectory());
|
File directory = new File(resource.getDirectory());
|
||||||
urls.add(directory.toURI().toURL());
|
urls.add(directory.toURI().toURL());
|
||||||
FileUtils.removeDuplicatesFromOutputDirectory(this.classesDirectory, directory);
|
FileUtils.removeDuplicatesFromOutputDirectory(this.classesDirectory,
|
||||||
|
directory);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue