[JAVA-2900] Auto generate Build Information Created: 02/Jul/18  Updated: 28/Oct/23  Resolved: 16/Aug/18

Status: Closed
Project: Java Driver
Component/s: Build
Affects Version/s: 3.5.0, 3.6.4
Fix Version/s: 3.8.1

Type: Improvement Priority: Major - P3
Reporter: Ross Lawley Assignee: Jeffrey Yemin
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by JAVA-2512 Remove assumption that driver code so... Closed
Related
related to JAVA-2902 Incorrect clientMetadata for 3.8.0 dr... Closed
Case:

 Description   

Rather than rely on looking up the MANIFEST.MF file - use / write a gradle plugin or task that auto generates the build information in a class, so that it can be used by MongoDriverInformation.

The Scala driver uses a BuildInfo plugin to generate the driver version on compile.
 



 Comments   
Comment by Githook User [ 17/Aug/18 ]

Author:

{'name': 'Jeff Yemin', 'email': 'jeff.yemin@10gen.com', 'username': 'jyemin'}

Message: Store driver version in a generated class

Accessing the driver version from META-INF/MANIFEST.MF has proved to be
too fragile, as it fails when the driver is deployed in ways in which
that file is difficult to access or no longer even exists.

Generating a class at build time and storing it in the class path will
be robust against any attempts to re-package.

JAVA-2900
Branch: 3.8.x
https://github.com/mongodb/mongo-java-driver/commit/7a10e909b99852a36c5c92c3ba730105bb8e1676

Comment by Githook User [ 16/Aug/18 ]

Author:

{'username': 'jyemin', 'email': 'jeff.yemin@10gen.com', 'name': 'Jeff Yemin'}

Message: Store driver version in a generated class

Accessing the driver version from META-INF/MANIFEST.MF has proved to be
too fragile, as it fails when the driver is deployed in ways in which
that file is difficult to access or no longer even exists.

Generating a class at build time and storing it in the class path will
be robust against any attempts to re-package.

JAVA-2900
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/511ad5489b8121c4cb1f6a72a0fd8b35b3faa3ae

Generated at Thu Feb 08 08:58:20 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.