[MNG-5659] Add an IT for project settings (#265)

diff --git a/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java
new file mode 100644
index 0000000..3bca7aa
--- /dev/null
+++ b/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java
@@ -0,0 +1,73 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.it;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import java.io.File;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.maven.shared.verifier.VerificationException;
+import org.apache.maven.shared.verifier.Verifier;
+import org.apache.maven.shared.verifier.util.ResourceExtractor;
+import org.junit.jupiter.api.Test;
+
+public class MavenITmng5659ProjectSettingsTest extends AbstractMavenIntegrationTestCase {
+
+    public MavenITmng5659ProjectSettingsTest() {
+        super("[4.0.0-alpha-6,)");
+    }
+
+    @Test
+    public void testProjectSettings() throws IOException, VerificationException {
+        File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/mng-5659-project-settings");
+        Verifier verifier = newVerifier(testDir.getAbsolutePath());
+
+        verifier.addCliArgument("validate");
+        verifier.execute();
+        verifier.verifyErrorFreeLog();
+
+        Properties props;
+
+        verifier.verifyFilePresent("target/pom.properties");
+        props = verifier.loadProperties("target/pom.properties");
+        assertEquals(
+                "project.properties.activated",
+                Boolean.TRUE.toString(),
+                props.getProperty("project.properties.activated"));
+    }
+}
diff --git a/core-it-suite/src/test/resources/mng-5659-project-settings/.mvn/settings.xml b/core-it-suite/src/test/resources/mng-5659-project-settings/.mvn/settings.xml
new file mode 100644
index 0000000..32cd8aa
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5659-project-settings/.mvn/settings.xml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+
+<settings>
+    <profiles>
+        <profile>
+            <id>settings-active-default</id>
+            <activation>
+                <activeByDefault>true</activeByDefault>
+            </activation>
+            <properties>
+                <activated>true</activated>
+            </properties>
+            <repositories>
+                <repository>
+                    <id>git-local</id>
+                    <url>file://${session.rootDirectory}/repository</url>
+                    <releases>
+                        <checksumPolicy>ignore</checksumPolicy>
+                    </releases>
+                </repository>
+            </repositories>
+        </profile>
+    </profiles>
+</settings>
\ No newline at end of file
diff --git a/core-it-suite/src/test/resources/mng-5659-project-settings/child/pom.xml b/core-it-suite/src/test/resources/mng-5659-project-settings/child/pom.xml
new file mode 100644
index 0000000..d34fa2b
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5659-project-settings/child/pom.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <parent>
+    <groupId>mng5659</groupId>
+    <artifactId>project</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+  </parent>
+  <artifactId>child</artifactId>
+  <packaging>jar</packaging>
+
+  <dependencies>
+    <dependency>
+      <groupId>foo</groupId>
+      <artifactId>bar</artifactId>
+      <version>1.0</version>
+    </dependency>
+  </dependencies>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-5659-project-settings/pom.xml b/core-it-suite/src/test/resources/mng-5659-project-settings/pom.xml
new file mode 100644
index 0000000..89da7e2
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5659-project-settings/pom.xml
@@ -0,0 +1,60 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>mng5659</groupId>
+  <artifactId>project</artifactId>
+  <version>0.0.1-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <modules>
+    <module>child</module>
+  </modules>
+
+  <properties>
+    <activated>false</activated>
+  </properties>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.its.plugins</groupId>
+        <artifactId>maven-it-plugin-expression</artifactId>
+        <version>2.1-SNAPSHOT</version>
+        <executions>
+          <execution>
+            <goals>
+              <goal>eval</goal>
+            </goals>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/pom.properties</outputFile>
+              <expressions>
+                <expression>project/properties</expression>
+              </expressions>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+
+</project>
diff --git a/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.jar b/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.jar
new file mode 100644
index 0000000..214c630
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.jar
Binary files differ
diff --git a/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.pom b/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.pom
new file mode 100644
index 0000000..5c10179
--- /dev/null
+++ b/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.pom
@@ -0,0 +1,7 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0">
+    <modelVersion>4.0.0</modelVersion>
+    <groupId>foo</groupId>
+    <artifactId>bar</artifactId>
+    <version>1.0</version>
+    <packaging>jar</packaging>
+</project>
\ No newline at end of file