nielsbasjes commented on issue #11592: [FLINK-16871][runtime] Make more build time information available at runtime URL: https://github.com/apache/flink/pull/11592#issuecomment-610963976 I went back to the generating a .version.properties file which is then loaded as a resource using classloader (which I consider to be brittle and unreliable!). This way you can say 'if no file then use default' as requested. The big downside of this is that someone can (accidentally) change the code by overriding this resource by putting a different one in the classpath (which happens) and IntelliJ still messes things up occasionally. So the runtime code has to catch these problems. Also in the original code 1. The .version.properties is generated somewhere into src/main/... instead of target/... Why? Generated code (that is not committed) should never be placed in the src/main. I changed that to generate to target/ 2. A second .version.properties is generated somewhere into flink-dist/src/main/flink-bin/ Why? The only place the .version.properties is referenced is in the flink-runtime. I consider the overriding these build time variables is a bad idea. I removed that. NOTE: If you run this now from within IntelliJ it still does not generate the files correctly (i.e. IntelliJ does not follow the instructions defined in the pom.xml) which sometimes creates a version file like this (which is handled by the runtime code): ``` project.version=1.11-SNAPSHOT scala.binary.version=2.11 git.commit.id=${git.commit.id} git.commit.id.abbrev=${git.commit.id.abbrev} git.commit.time=${git.commit.time} git.build.time=${git.build.time} ``` Side note: Looking a the `RevisionInformation` class I found that all uses get that class and then take out the two values (or even only one of them) and throw it away again. Seems too much overhead to me.
---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
