diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng5659ProjectSettingsTest.java new file mode 100644 index 0000000000..3bca7aab81 --- /dev/null +++ b/its/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/its/core-it-suite/src/test/resources/mng-5659-project-settings/.mvn/settings.xml b/its/core-it-suite/src/test/resources/mng-5659-project-settings/.mvn/settings.xml new file mode 100644 index 0000000000..32cd8aa60a --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-5659-project-settings/.mvn/settings.xml @@ -0,0 +1,43 @@ + + + + + + + + settings-active-default + + true + + + true + + + + git-local + file://${session.rootDirectory}/repository + + ignore + + + + + + \ No newline at end of file diff --git a/its/core-it-suite/src/test/resources/mng-5659-project-settings/child/pom.xml b/its/core-it-suite/src/test/resources/mng-5659-project-settings/child/pom.xml new file mode 100644 index 0000000000..d34fa2b4e7 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-5659-project-settings/child/pom.xml @@ -0,0 +1,39 @@ + + + + 4.0.0 + + + mng5659 + project + 0.0.1-SNAPSHOT + + child + jar + + + + foo + bar + 1.0 + + + + diff --git a/its/core-it-suite/src/test/resources/mng-5659-project-settings/pom.xml b/its/core-it-suite/src/test/resources/mng-5659-project-settings/pom.xml new file mode 100644 index 0000000000..89da7e242c --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-5659-project-settings/pom.xml @@ -0,0 +1,60 @@ + + + + 4.0.0 + + mng5659 + project + 0.0.1-SNAPSHOT + pom + + + child + + + + false + + + + + + org.apache.maven.its.plugins + maven-it-plugin-expression + 2.1-SNAPSHOT + + + + eval + + validate + + target/pom.properties + + project/properties + + + + + + + + + diff --git a/its/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.jar b/its/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.jar new file mode 100644 index 0000000000..214c630b38 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.pom b/its/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.pom new file mode 100644 index 0000000000..5c10179d51 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-5659-project-settings/repository/foo/bar/1.0/bar-1.0.pom @@ -0,0 +1,7 @@ + + 4.0.0 + foo + bar + 1.0 + jar + \ No newline at end of file