Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PropertiesFileTransformer break reproducible builds #584

Closed
chrko opened this issue Jun 30, 2020 · 5 comments
Closed

PropertiesFileTransformer break reproducible builds #584

chrko opened this issue Jun 30, 2020 · 5 comments

Comments

@chrko
Copy link

chrko commented Jun 30, 2020

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
@crafton
Copy link

crafton commented Jun 21, 2022

@chrko Did you find a way around this?

@ahmed-anas
Copy link

facing this issue. any workaround?

@gergogera
Copy link

gergogera commented Jan 28, 2023

This happens because PropertiesFileTransformer is using Properties.store method which will add the timestamp anyways. Would be nice to change this so that the unnecessary time comment is removed instead.

@k-brooks
Copy link

k-brooks commented Mar 6, 2023

I believe the intent of #622 was to address this issue.
EDIT
A version override masked the fix, this is now working for me.

@johnrengelman
Copy link
Collaborator

Introduced CleanProperties in 8 or 8.1.
This shoudl work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants