gnodet commented on code in PR #13546: URL: https://github.com/apache/maven/pull/13546#discussion_r4316596345
########## its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh11759SiteLifecycleDisabledTest.java: ########## @@ -0,0 +1,58 @@ +/* + * 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; + +import java.nio.file.Path; Review Comment: The `java.nio.file.Path` import is correct. `extractResources()` returns `java.nio.file.Path` (see `AbstractMavenIntegrationTestCase:83`) and `newVerifier(Path basedir)` exists (line 99). The bot previously gave correct guidance in cycle 4 and then contradicted itself in cycle 5. The current code is correct. ########## its/core-it-suite/src/test/java/org/apache/maven/it/MavenITgh11759SiteLifecycleDisabledTest.java: ########## @@ -0,0 +1,58 @@ +/* + * 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; + +import java.nio.file.Path; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertThrows; + +/** + * Integration test for <a href="https://github.com/apache/maven/issues/11759">gh-11759</a>: + * verifies that setting {@code -Dmaven.site.lifecycle.disabled=true} via {@code MAVEN_OPTS} + * removes the {@code site} lifecycle so that invoking the {@code site} phase fails with + * "Unknown lifecycle phase". + */ +class MavenITgh11759SiteLifecycleDisabledTest extends AbstractMavenIntegrationTestCase { + + /** + * Verifies that with {@code maven.site.lifecycle.disabled=true} the site lifecycle + * is absent and invoking the {@code site} phase causes a build failure. + */ + @Test + void testSiteLifecycleDisabledViaSystemProperty() throws Exception { + Path testDir = extractResources("/gh-11759-site-lifecycle-disabled"); + + Verifier verifier = newVerifier(testDir); Review Comment: Same as above — `extractResources()` returns `Path` (not `File`) and `newVerifier(Path)` exists. `Path testDir` and `newVerifier(testDir)` both compile correctly. No changes needed here. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
