You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/01/04 17:40:39 UTC

[GitHub] [maven-integration-testing] gnodet commented on a change in pull request #133: [MNG-6326] Make the build fail if core extensions can not be loaded

gnodet commented on a change in pull request #133:
URL: https://github.com/apache/maven-integration-testing/pull/133#discussion_r778269338



##########
File path: core-it-suite/src/test/java/org/apache/maven/it/MavenITmng6326CoreExtensionsNotFoundTest.java
##########
@@ -0,0 +1,56 @@
+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 org.apache.maven.it.util.ResourceExtractor;
+
+/**
+ * This is a test set for <a href="https://issues.apache.org/jira/browse/MNG-6326">MNG-6326</a>:
+ * check that Maven fails if it can not load core extensions contributed by <code>.mvn/extensions.xml</code>.
+ */
+public class MavenITmng6326CoreExtensionsNotFoundTest
+    extends AbstractMavenIntegrationTestCase
+{
+    public MavenITmng6326CoreExtensionsNotFoundTest()
+    {
+        super( "(3.2.5,)" );
+    }
+
+    public void testCoreExtensionsNotFound()
+        throws Exception
+    {
+        File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-6326-core-extensions-not-found" );
+
+        Verifier verifier = newVerifier( testDir.getAbsolutePath() );
+        try
+        {
+            verifier.executeGoal( "validate" );
+            fail( "should have failed ");
+        }
+        catch ( VerificationException e )
+        {
+            verifier.verifyTextInLog( "[ERROR] Error executing Maven." );
+            verifier.verifyTextInLog( "Plugin org.apache.maven.its.it-core-extensions:maven-it-unknown-extensions:0.1 or one of its dependencies could not be resolved: org.apache.maven.its.it-core-extensions:maven-it-unknown-extensions:jar:0.1 was not found in" );

Review comment:
       I think the behavior comes from https://github.com/apache/maven/blob/d92508179410897404bcc7e826bb0877be2d08b8/maven-embedder/src/main/java/org/apache/maven/cli/internal/BootstrapCoreExtensionManager.java#L133-L139




-- 
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: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org