-
-
Notifications
You must be signed in to change notification settings - Fork 302
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
bnd-maven-plugin: Support reproducible builds #3521
Comments
couldn't you simply |
That would be a workaround, this issue is more to make the bnd-maven-plugin in line with the other maven plugins (i.e. evaluate |
I tried to use that property but maven didn't seem to think it existed.
…On Sun, Nov 3, 2019, 17:06 Konrad Windszus, ***@***.***> wrote:
That would be a workaround, this issue is more to make the
bnd-maven-plugin in line with the other maven plugins (i.e. evaluate
project.build.outputTimestamp) and then use its value instead of the
current date.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3521?email_source=notifications&email_token=AABD2TBRXC3MLGJCPC5QPB3QR5DONA5CNFSM4JINESJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC56D4A#issuecomment-549183984>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABD2TFP4O2MM63F7CYPACTQR5DONANCNFSM4JINESJA>
.
|
You have to explicitly set it. But it is a well known property which is also evaluated by other plugins (m-jar-p, m-source-p). Further details in https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74682318 |
Got it, then yeah it should be trivial to check for it.
…On Mon, Nov 4, 2019, 00:10 Konrad Windszus, ***@***.***> wrote:
You have to explicitly set it. But it is a well known property which is
also evaluated by other plugins (m-jar-p, m-source-p). Further details in
https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74682318
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#3521?email_source=notifications&email_token=AABD2TC3J27OYL76FN7XKEDQR6VFBA5CNFSM4JINESJKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEC6IOKA#issuecomment-549226280>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABD2THKVSIT5ZWC4C2IUGLQR6VFBANCNFSM4JINESJA>
.
|
BTW, Bnd has options for reproducible builds which Bnd itself uses Lines 58 to 59 in a6aed53
The latter option removes headers which can vary from build to build like Bnd-LastModified. So if you use these 2 options, you should already be able to make reproducible builds with the maven plugin. |
See also https://maven.apache.org/guides/mini/guide-reproducible-builds.html which is new to For the bnd/biz.aQute.bndlib/src/aQute/bnd/osgi/Jar.java Lines 71 to 87 in a6aed53
Note: We should not be setting |
The |
I guess bnd-maven-plugin could see if that project property is set, and if so, enable |
That's what I'm thinking. @kwin since you know more about this, could you confirm that |
No, you should rather introduce a dedicated parameter similar like what maven-jar-plugin (https://github.com/apache/maven-jar-plugin/blob/e036eb2a511c6771c172b23d9d33c5563f1d7ae2/src/main/java/org/apache/maven/plugins/jar/AbstractJarMojo.java#L151) does. I am not sure if relying on a fixed timestamp is better or whether a boolean flag would actually be enough (to completely leave out the non-fixed headers). Maybe a dedicated boolean Maven plugin parameter which by default is set to true if |
Since bnd-maven-plugin does not jar the bundle, there is no point in defining any new configuration for this. We would need to "look" into the configuration of maven-jar-plugin to see if it is has the The only thing that really needs to be done for bnd-maven-plugin is to not emit manifest headers which depend upon the build time. But it seems wrong to add a configuration property to bnd-maven-plugin which is the duplicate of the maven-jar-plugin |
Closing since there is no change to the plugin. Use Bnd config for |
Testing with
To reproduce, you can run the |
This is caused by an odd historical behavior of bnd-maven-plugin. If bnd/maven/bnd-maven-plugin/src/main/java/aQute/bnd/maven/plugin/AbstractBndMavenPlugin.java Lines 305 to 307 in 5a777f9
This will cause the bnd/biz.aQute.bndlib/src/aQute/bnd/osgi/Builder.java Lines 439 to 465 in 5a777f9
So you will also need to set |
See https://github.com/bndtools/bnd/tree/master/maven/bnd-maven-plugin#reproducible-builds where I added a section to the bnd-maven-plugin readme. |
@bjhargrave Thanks a lot for the clarification and for the documentation update. |
That makes sense, thanks @bjhargrave |
Just for the record: Since 32a6357 reproducible builds are automatically enabled once project.build.outputTimestamp is set |
The
Bnd-LastModified
header currently makes a build non-reproducible. If existing the fixed timestamp fromproject.build.outputTimestamp
should be used instead (https://cwiki.apache.org/confluence/pages/viewpage.action?pageId=74682318) in the Maven plugin.The text was updated successfully, but these errors were encountered: