[MNG-7689] Check if execution lifecycle phase is not null (#996)

This commit is contained in:
Alexey Venderov 2023-02-15 08:49:39 +01:00 committed by GitHub
parent 7b38457506
commit b82479bf11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 5 deletions

View File

@ -318,11 +318,13 @@ class ReactorReader implements MavenWorkspaceReader {
switch (event.getType()) {
case MojoStarted:
String phase = event.getMojoExecution().getLifecyclePhase();
Deque<String> phases = getLifecycles(project);
if (!Objects.equals(phase, phases.peekLast())) {
phases.addLast(phase);
if ("clean".equals(phase)) {
cleanProjectLocalRepository(project);
if (phase != null) {
Deque<String> phases = getLifecycles(project);
if (!Objects.equals(phase, phases.peekLast())) {
phases.addLast(phase);
if ("clean".equals(phase)) {
cleanProjectLocalRepository(project);
}
}
}
break;