Re: Keeping java's version in sync with project's version

2023-11-10 Thread ecki
BTW you can also write the version to the manifest and then use class.getPackage().getImplementationVersion() like I did here: https://github.com/ecki/et-otp/blob/663228f2b6ad7d3f20aad04ca5f675b49662a78c/src/main/java/net/eckenfels/etotp/GUI.java#L64 This only requires addDefaultImplementationEn

Re: Keeping java's version in sync with project's version

2023-11-09 Thread Benjamin Marwell
Hi Joseph! Not really sure what you mean by "keep java's version in sync". Since you said "-version option on my project", I am guessing you have a CLI app and you want to report the version which you specify in your pom.xml file. Now to do that and have it working with your project, here are the

Re: Keeping java's version in sync with project's version

2023-11-09 Thread Greg Chabala
I'll just mention that I've used the file referenced in the StackOverflow question, META-INF/maven/${groupId}/${artifactId}/pom.properties, before to do something much like you describe, print my application version to the log at startup. It did not need any special configuration to appear, and on

Re: Keeping java's version in sync with project's version

2023-11-08 Thread Alexander Kriegisch
Joseph, you probably want to look into resource filtering and put a corresponding placeholder into a properties file and read it as a classpath resource from your artifact. https://maven.apache.org/plugins/maven-resources-plugin/examples/filter.html Cheers -- Alexander Kriegisch https://scrum-m

Keeping java's version in sync with project's version

2023-11-08 Thread Joseph Kessselman
For obvious reasons, if would be nice if the -version option on my project automatically reported the version I'd set in the pom.xml rather than my trying to synchronize the two manually. The best approaches I've found so far are in https://stackoverflow.com/questions/2712970/get-maven-artifact