This is an automated email from the ASF dual-hosted git repository. slachiewicz pushed a commit to branch MRESOLVER-98 in repository https://gitbox.apache.org/repos/asf/maven-resolver-ant-tasks.git
commit 6406b9f31b5094b354fda9ec6b4f007adccbc4d6 Author: William Leung <williamleung2...@gmail.com> AuthorDate: Tue Mar 3 17:34:45 2020 +0800 test: add test case testResolvePomWithScopedAndManagement (failed) --- .../maven/resolver/internal/ant/ResolveTest.java | 8 ++++ src/test/resources/ant/Resolve/ant.xml | 9 ++++ .../ant/Resolve/with-scoped-and-management.pom | 50 ++++++++++++++++++++++ 3 files changed, 67 insertions(+) diff --git a/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java b/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java index ab560fd..17638b7 100644 --- a/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java +++ b/src/test/java/org/apache/maven/resolver/internal/ant/ResolveTest.java @@ -85,6 +85,14 @@ public class ResolveTest endsWith( "org/apache/maven/resolver/maven-resolver-api/1.4.1/maven-resolver-api-1.4.1.jar" ) ); } + public void testResolvePomWithScopedAndManagement() + { + executeTarget( "testResolvePomWithScopedAndManagement" ); + + assertNull( getProject().getProperty( "test.resolve.path.org.apache.maven.resolver:maven-resolver-util:jar" ) ); + assertNull( getProject().getProperty( "test.resolve.path.org.apache.maven.resolver:maven-resolver-api:jar" ) ); + } + public void testResolveAttachments() throws IOException { diff --git a/src/test/resources/ant/Resolve/ant.xml b/src/test/resources/ant/Resolve/ant.xml index b32b05b..9b3767a 100644 --- a/src/test/resources/ant/Resolve/ant.xml +++ b/src/test/resources/ant/Resolve/ant.xml @@ -77,6 +77,15 @@ </repo:resolve> </target> + <target name="testResolvePomWithScopedAndManagement"> + <repo:resolve> + <dependencies> + <pom file="${project.dir}/with-scoped-and-management.pom"/> + </dependencies> + <properties prefix="test.resolve.path" classpath="runtime"/> + </repo:resolve> + </target> + <target name="testResolveAttachments"> <repo:resolve> <dependencies> diff --git a/src/test/resources/ant/Resolve/with-scoped-and-management.pom b/src/test/resources/ant/Resolve/with-scoped-and-management.pom new file mode 100644 index 0000000..c51844c --- /dev/null +++ b/src/test/resources/ant/Resolve/with-scoped-and-management.pom @@ -0,0 +1,50 @@ +<?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>test</groupId> + <artifactId>dummy</artifactId> + <version>0.1-SNAPSHOT</version> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.apache.maven.resolver</groupId> + <artifactId>maven-resolver-api</artifactId> + <version>1.4.1</version> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.apache.maven.resolver</groupId> + <artifactId>maven-resolver-util</artifactId> + <version>1.4.1</version> + <scope>test</scope> + </dependency> + </dependencies> + +</project>