diff --git a/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java new file mode 100644 index 0000000000..949e2f861d --- /dev/null +++ b/its/core-it-suite/src/test/java/org/apache/maven/it/MavenITmng3288SystemScopeDirTest.java @@ -0,0 +1,60 @@ +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 org.apache.maven.it.Verifier; +import org.apache.maven.it.VerificationException; +import org.apache.maven.it.util.ResourceExtractor; + +import java.io.File; +import java.util.List; + +/** + * This is a test for MNG-3288. + * + * @author Benjamin Bentmann + */ +public class MavenITmng3288SystemScopeDirTest + extends AbstractMavenIntegrationTestCase +{ + + /** + * Test the use of a system scoped dependency to a directory instead of a JAR which should fail early. + */ + public void testitMNG3288() + throws Exception + { + File testDir = ResourceExtractor.simpleExtractResources( getClass(), "/mng-3288" ); + + Verifier verifier = new Verifier( testDir.getAbsolutePath() ); + verifier.setAutoclean( false ); + try + { + verifier.executeGoal( "org.apache.maven.its.plugins:maven-it-plugin-dependency-resolution::compile" ); + fail( "Usage of directory instead of file for system-scoped dependency did not fail dependency resolution" ); + } + catch ( VerificationException e ) + { + // expected, of a system-scoped dependency should be a file, not a directory + } + verifier.resetStreams(); + } + +} diff --git a/its/core-it-suite/src/test/resources/mng-3288/lib/test.jar b/its/core-it-suite/src/test/resources/mng-3288/lib/test.jar new file mode 100644 index 0000000000..d643551990 Binary files /dev/null and b/its/core-it-suite/src/test/resources/mng-3288/lib/test.jar differ diff --git a/its/core-it-suite/src/test/resources/mng-3288/pom.xml b/its/core-it-suite/src/test/resources/mng-3288/pom.xml new file mode 100644 index 0000000000..6ccc54f250 --- /dev/null +++ b/its/core-it-suite/src/test/resources/mng-3288/pom.xml @@ -0,0 +1,44 @@ + + + + + + 4.0.0 + + org.apache.maven.its.mng3288 + mng-3288 + 1.0 + jar + + Maven Integration Test :: MNG-3288 + + Test the use of a system scoped dependency to a directory instead of a JAR which should fail early. + + + + + it + it + 1.0 + system + ${basedir}/lib + + +