diff --git a/impl/maven-impl/pom.xml b/impl/maven-impl/pom.xml
index 6f1ea9a4cc..b7a6d445c1 100644
--- a/impl/maven-impl/pom.xml
+++ b/impl/maven-impl/pom.xml
@@ -119,6 +119,11 @@ under the License.
junit-jupiter-api
test
+
+ org.slf4j
+ slf4j-simple
+ test
+
org.mockito
mockito-core
diff --git a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/rootlocator/DefaultRootLocator.java b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/rootlocator/DefaultRootLocator.java
index 83850082dd..e874bd199e 100644
--- a/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/rootlocator/DefaultRootLocator.java
+++ b/impl/maven-impl/src/main/java/org/apache/maven/internal/impl/model/rootlocator/DefaultRootLocator.java
@@ -48,7 +48,7 @@ public class DefaultRootLocator implements RootLocator {
@Override
public Path findRoot(Path basedir) {
- requireNonNull(basedir, "basedir is null");
+ requireNonNull(basedir, getNoRootMessage());
Path rootDirectory = basedir;
while (rootDirectory != null && !isRootDirectory(rootDirectory)) {
rootDirectory = rootDirectory.getParent();
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/AbstractProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/AbstractProfileActivatorTest.java
similarity index 90%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/AbstractProfileActivatorTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/AbstractProfileActivatorTest.java
index acfdfa606b..ea68bb8e05 100644
--- a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/AbstractProfileActivatorTest.java
+++ b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/AbstractProfileActivatorTest.java
@@ -18,6 +18,7 @@
*/
package org.apache.maven.internal.impl.model.profile;
+import java.nio.file.Path;
import java.util.Properties;
import org.apache.maven.api.model.Model;
@@ -25,6 +26,7 @@ import org.apache.maven.api.model.Profile;
import org.apache.maven.api.services.model.ProfileActivationContext;
import org.apache.maven.api.services.model.ProfileActivator;
import org.apache.maven.internal.impl.model.DefaultProfileActivationContext;
+import org.apache.maven.internal.impl.model.rootlocator.DefaultRootLocator;
import org.junit.jupiter.api.AfterEach;
import org.junit.jupiter.api.BeforeEach;
@@ -35,6 +37,12 @@ import static org.junit.jupiter.api.Assertions.assertEquals;
*
*/
public abstract class AbstractProfileActivatorTest {
+ static class FakeRootLocator extends DefaultRootLocator {
+ @Override
+ protected boolean isRootDirectory(Path dir) {
+ return true;
+ }
+ }
protected T activator;
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionParserTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionParserTest.java
similarity index 98%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionParserTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionParserTest.java
index b91460c630..b665c11485 100644
--- a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionParserTest.java
+++ b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionParserTest.java
@@ -29,9 +29,9 @@ import org.apache.maven.internal.impl.DefaultVersionParser;
import org.apache.maven.internal.impl.model.DefaultInterpolator;
import org.apache.maven.internal.impl.model.DefaultPathTranslator;
import org.apache.maven.internal.impl.model.DefaultProfileActivationContext;
-import org.apache.maven.internal.impl.model.DefaultRootLocator;
import org.apache.maven.internal.impl.model.ProfileActivationFilePathInterpolator;
import org.apache.maven.internal.impl.model.profile.ConditionParser.ExpressionFunction;
+import org.apache.maven.internal.impl.model.rootlocator.DefaultRootLocator;
import org.eclipse.aether.util.version.GenericVersionScheme;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
@@ -53,7 +53,9 @@ class ConditionParserTest {
DefaultVersionParser versionParser =
new DefaultVersionParser(new DefaultModelVersionParser(new GenericVersionScheme()));
ProfileActivationFilePathInterpolator interpolator = new ProfileActivationFilePathInterpolator(
- new DefaultPathTranslator(), bd -> true, new DefaultInterpolator());
+ new DefaultPathTranslator(),
+ new AbstractProfileActivatorTest.FakeRootLocator(),
+ new DefaultInterpolator());
DefaultRootLocator rootLocator = new DefaultRootLocator();
functions = ConditionProfileActivator.registerFunctions(context, versionParser, interpolator);
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionProfileActivatorTest.java
similarity index 99%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionProfileActivatorTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionProfileActivatorTest.java
index c549480d48..7b1c48abed 100644
--- a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionProfileActivatorTest.java
+++ b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/ConditionProfileActivatorTest.java
@@ -33,8 +33,8 @@ import org.apache.maven.internal.impl.DefaultVersionParser;
import org.apache.maven.internal.impl.model.DefaultInterpolator;
import org.apache.maven.internal.impl.model.DefaultPathTranslator;
import org.apache.maven.internal.impl.model.DefaultProfileActivationContext;
-import org.apache.maven.internal.impl.model.DefaultRootLocator;
import org.apache.maven.internal.impl.model.ProfileActivationFilePathInterpolator;
+import org.apache.maven.internal.impl.model.rootlocator.DefaultRootLocator;
import org.eclipse.aether.util.version.GenericVersionScheme;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Disabled;
@@ -57,7 +57,7 @@ public class ConditionProfileActivatorTest extends AbstractProfileActivatorTest<
activator = new ConditionProfileActivator(
new DefaultVersionParser(new DefaultModelVersionParser(new GenericVersionScheme())),
new ProfileActivationFilePathInterpolator(
- new DefaultPathTranslator(), bd -> true, new DefaultInterpolator()),
+ new DefaultPathTranslator(), new FakeRootLocator(), new DefaultInterpolator()),
new DefaultRootLocator());
Path file = tempDir.resolve("file.txt");
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/FileProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/FileProfileActivatorTest.java
similarity index 96%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/FileProfileActivatorTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/FileProfileActivatorTest.java
index b758607ed3..bde150d74e 100644
--- a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/FileProfileActivatorTest.java
+++ b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/FileProfileActivatorTest.java
@@ -53,7 +53,7 @@ class FileProfileActivatorTest extends AbstractProfileActivatorTest true, new DefaultInterpolator()));
+ new DefaultPathTranslator(), new FakeRootLocator(), new DefaultInterpolator()));
context.setModel(Model.newBuilder().pomFile(tempDir.resolve("pom.xml")).build());
@@ -67,8 +67,8 @@ class FileProfileActivatorTest extends AbstractProfileActivatorTest assertActivation(false, newExistsProfile("${project.rootDirectory}"), context));
assertEquals(RootLocator.UNABLE_TO_FIND_ROOT_PROJECT_MESSAGE, e.getMessage());
}
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/JdkVersionProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/JdkVersionProfileActivatorTest.java
similarity index 100%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/JdkVersionProfileActivatorTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/JdkVersionProfileActivatorTest.java
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/OperatingSystemProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/OperatingSystemProfileActivatorTest.java
similarity index 100%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/OperatingSystemProfileActivatorTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/OperatingSystemProfileActivatorTest.java
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/PropertyProfileActivatorTest.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/PropertyProfileActivatorTest.java
similarity index 100%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/PropertyProfileActivatorTest.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/PropertyProfileActivatorTest.java
diff --git a/maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/SimpleProblemCollector.java b/impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/SimpleProblemCollector.java
similarity index 100%
rename from maven-api-impl/src/test/java/org/apache/maven/internal/impl/model/profile/SimpleProblemCollector.java
rename to impl/maven-impl/src/test/java/org/apache/maven/internal/impl/model/profile/SimpleProblemCollector.java