简体   繁体   English

如何使用 Tycho 构建更改 jar 中文件的修改时间戳

[英]How to change the modified time stamp of files in a jar with a Tycho build

I have a Tycho build that builds some plugins.我有一个构建一些插件的 Tycho 构建。 I need to configure the build so that it is reproducible - meaning the created artifacts of different build runs have to be identical.我需要配置构建以使其可重现——这意味着不同构建运行的创建工件必须相同。

For my build, this is currently not the case.对于我的构建,目前情况并非如此。 The differentes of 2 build runs artifact's is the meta data of the files in the jar's. 2 个构建运行工件的不同之处在于 jar 中文件的元数据。 The "Modified" timestamp is different for every build.每个构建的“修改”时间戳都不同。

So my question is: Does Tycho provide a way to set the modified timestamp to a specific value?所以我的问题是:第谷是否提供了一种将修改后的时间戳设置为特定值的方法? Or is there another way do do this?还是有其他方法可以做到这一点?

jar 中已修改时间戳的图像

I was able to fix it now.我现在能够修复它。 The maven plugin reproducible-build-maven-plugin does exactly what i need: maven 插件 reproducible-build-maven-plugin 正是我需要的:

<plugin>
    <groupId>io.github.zlika</groupId>
    <artifactId>reproducible-build-maven-plugin</artifactId>
    <version>0.13</version>
    <executions>
        <execution>
            <goals>
                <goal>strip-jar</goal>
            </goals>
        </execution>
    </executions>
</plugin>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM