Skip to content

PropertiesFileTransformer break reproducible builds #584

@chrko

Description

@chrko

Shadow Version

6.0.0

Gradle Version

6.5.1

Expected Behavior

Reproducible build = hash of resulting file within build/lib

Actual Behavior

The PropertiesFileTransformer writes the current time into the generated files which breaks the reproducible build.

Gradle Build Script(s)

I'm currently trying to build a fat application jar with spring dependencies and applying the following: spring-projects/spring-boot#1828 (comment)

shadowJar {
    mergeServiceFiles()
    transform(PropertiesFileTransformer) {
        paths = [
                'META-INF/spring.handlers',
                'META-INF/spring.factories',
                'META-INF/spring.schemas',
                'META-INF/spring.tooling',
        ]
        mergeStrategy = "latest"
    }
}

I will try to reduce my current build.gradle to ease reproduction and will append this.

Content of Shadow JAR (jar tf <jar file> - post link to GIST if too long)


META-INF/services/org.apache.logging.log4j.util.PropertySource
META-INF/spring.handlers
META-INF/spring.schemas
META-INF/spring.tooling
META-INF/spring.factories

Content of spring.factories:

#
#Tue Jun 30 22:03:02 CEST 2020
org.springframework.beans.BeanInfoFactory=org.springframework.beans.ExtendedBeanInfoFactory

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions