Skip to content

Commit

Permalink
Merge two integration tests for gradle#1789
Browse files Browse the repository at this point in the history
  • Loading branch information
blindpirate committed Aug 13, 2017
1 parent 190e808 commit 2657c32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 27 deletions.
Expand Up @@ -333,27 +333,4 @@ compile('group:projectA:1.0') {
succeeds 'retrieve'
}

@Issue('https://github.com/gradle/gradle/issues/1789')
def "ignore artifact when relocation is defined in pom"() {
given:
buildFile << """
repositories { jcenter() }
configurations { compile }
dependencies {
// http://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2.pom
compile 'org.apache.commons:commons-io:1.3.2'
compile 'commons-io:commons-io:2.4'
}
task retrieve(type: Sync) {
from configurations.compile
into 'libs'
}
"""
when:
run 'retrieve'

then:
file("libs").assertHasDescendants("commons-io-2.4.jar")
}

}
Expand Up @@ -20,7 +20,7 @@ import org.gradle.integtests.fixtures.AbstractHttpDependencyResolutionTest
import spock.lang.Issue

class MavenPomResolveIntegrationTest extends AbstractHttpDependencyResolutionTest {
def "follows relocation to another group"() {
def "follows relocation to another group and ignore original artifact"() {
given:
def original = mavenHttpRepo.module("groupA", "projectA", "1.2").publishPom()
original.pomFile.text = """
Expand All @@ -30,13 +30,14 @@ class MavenPomResolveIntegrationTest extends AbstractHttpDependencyResolutionTes
<version>1.2</version>
<distributionManagement>
<relocation>
<groupId>newGroupA</groupId>
<groupId>groupB</groupId>
<artifactId>projectB</artifactId>
</relocation>
</distributionManagement>
</project>
"""

def newModule = mavenHttpRepo.module("newGroupA", "projectA", "1.2").publish()
def newModule = mavenHttpRepo.module("groupB", "projectB", "1.2").publish()
newModule.publish()

and:
Expand All @@ -59,7 +60,7 @@ task retrieve(type: Sync) {
run "retrieve"

then:
file("libs").assertHasDescendants("projectA-1.2.jar")
file("libs").assertHasDescendants("projectB-1.2.jar")
}


Expand Down

0 comments on commit 2657c32

Please sign in to comment.