Skip to content

DuplicatesStrategy.FAIL doesn't work with transform #488

@boris-petrov

Description

@boris-petrov

I have something along the lines of:

task foo(type: ShadowJar, dependsOn: fooClasses) {
	from sourceSets.foo.output

	configurations = [project.configurations.fooRuntimeClasspath]

	archiveBaseName = 'foo'
	zip64 = true

	mergeServiceFiles()
	mergeGroovyExtensionModules()
	transform(AppendingTransformer) {
		resource = 'META-INF/extensions.idx'
	}

	duplicatesStrategy = DuplicatesStrategy.FAIL
}

There are multiple META-INF/extensions.idx files which, when duplicatesStrategy is NOT DuplicatesStrategy.FAIL, get merged correctly but when it IS DuplicatesStrategy.FAIL - it blows up with org.gradle.api.file.DuplicateFileCopyingException: Encountered duplicate path "META-INF/extensions.idx" during copy operation configured with DuplicatesStrategy.FAIL. Am I doing something wrong or is this a bug? I think that having specified that I want those files appended means that it should not blow up with that error, right?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions