Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import org.apache.maven.api.Session;
import org.apache.maven.api.plugin.MojoException;
import org.apache.maven.api.plugin.testing.stubs.SessionStub;
import org.codehaus.plexus.util.StringUtils;
import org.junit.jupiter.api.Test;

import static org.junit.jupiter.api.Assertions.assertDoesNotThrow;
Expand Down Expand Up @@ -72,11 +71,11 @@ public static class ExpressionEvaluatorMojo implements org.apache.maven.api.plug
/** {@inheritDoc} */
@Override
public void execute() throws MojoException {
if (StringUtils.isEmpty(basedir)) {
if (basedir == null || basedir.isEmpty()) {
throw new MojoException("basedir was not injected.");
}

if (StringUtils.isEmpty(workdir)) {
if (workdir == null || workdir.isEmpty()) {
throw new MojoException("workdir was not injected.");
} else if (!workdir.startsWith(basedir)) {
throw new MojoException("workdir does not start with basedir.");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
import org.codehaus.plexus.util.StringUtils;

/**
* @author Edwin Punzalan
Expand All @@ -37,15 +36,15 @@ public class ExpressionEvaluatorMojo extends AbstractMojo {
/** {@inheritDoc} */
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
if (StringUtils.isEmpty(basedir)) {
if (basedir == null || basedir.isEmpty()) {
throw new MojoExecutionException("basedir was not injected.");
}

if (localRepository == null) {
throw new MojoExecutionException("localRepository was not injected.");
}

if (StringUtils.isEmpty(workdir)) {
if (workdir == null || workdir.isEmpty()) {
throw new MojoExecutionException("workdir was not injected.");
} else if (!workdir.startsWith(basedir)) {
throw new MojoExecutionException("workdir does not start with basedir.");
Expand Down