-
Notifications
You must be signed in to change notification settings - Fork 5
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
Manage ami version #51
Comments
I have pushed this change to @Command(name = "ami", version = AMI.VERSION,
...
public class AMI implements Runnable {
...
public static final String VERSION = "2020-07-09"; // update this with each change Please update this VERSION string with each meaningful change; if multiple changes per day, consider adding a time. |
We can enhance this in several ways:
|
Thanks. I'll try to make this work. Happy to give |
The properties-maven-plugin may be useful (see also usage). If it does what I think it does, this will allow us to have a version.properties file with
Then, in our POM, we can reference these properties to define:
becomes
Once this is done, we need to ensure that the @Command(name = "ami", versionProvider = PropertiesVersionProvider.class)
class AMI { ... } and /**
* {@link IVersionProvider} implementation that returns version information from a {@code /version.properties} file in the classpath.
*/
static class PropertiesVersionProvider implements IVersionProvider {
public String[] getVersion() throws Exception {
URL url = getClass().getResource("/version.properties");
if (url == null) {
return new String[] {"No version.properties file found in the classpath."};
}
Properties properties = new Properties();
properties.load(url.openStream());
TreeMap<String, String> map = new TreeMap<String, String>((Map) properties);
List<String> list = map.entrySet().stream()
.map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.toList());
return list.toArray(new String[0]);
}
} |
Update: it turns out that the properties-maven-plugin is not useful. Maven won't let us externalize the versions of dependencies. (Various StackOverflow questions: 1, 2, and 3.) We can still have a version.properties, but it will likely only contain the ami version. |
Thanks.
…On Tue, Jul 14, 2020 at 12:07 PM Remko Popma ***@***.***> wrote:
Update: it turns out that the properties-maven-plugin is not useful. Maven
won't let us externalize the versions of dependencies. (Various
StackOverflow questions: 1
<https://stackoverflow.com/questions/56626789/reading-dependency-versions-in-pom-xml-from-external-properties-file>,
2
<https://stackoverflow.com/questions/14725197/reading-properties-file-from-pom-file-in-maven/14727072#14727072>,
and 3
<https://stackoverflow.com/questions/40114869/maven-pom-file-externalizing-dependency-versions-to-a-properties-file>
.)
We can still have a version.properties, but it will likely only contain
the ami version.
This version is still duplicated in the pom.xml, which is not great. Still
thinking...
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFTCS3LDMYM2YRCDLWG4OTR3Q37RANCNFSM4OVA3KBA>
.
--
Peter Murray-Rust
Founder ContentMine.org
and
Reader Emeritus in Molecular Informatics
Dept. Of Chemistry, University of Cambridge, CB2 1EW, UK
|
There are two other maven plugins related to version management: TL;DR - Neither meets our needs exactly. Still may be useful. versions-maven-pluginUpdates project version in the pom.xml, with commands like May be useful if it allows version information being externalized in a separate properties file, but this does not seem to be the case. (Need to double check to make sure.) Maven Release PluginThis does a lot. Bumps version numbers, creates an SCM tag, and invokes There is a way to skip running the tests during the release process, which we need, otherwise this plugin would not be usable for us. The batch mode is interesting, because it allows the release version number and some other properties to be defined in a Still need to look at the publishing bit. |
Related: Axel Fontaine wrote a series of articles about how inefficient and fragile the Maven Release Plugin is, requiring 3 full builds with multiple checkouts to do a release. He proposes to replace this with
Additionally, he wrote a follow-up article "the Final Nail" in 2013 that replaces the The final installment Maven Release Plugin: Dead and Buried, describes how to go down to just running maven once, without the |
This sounds good. Can you go ahead and give a recipe?
…On Mon, 20 Jul 2020, 01:43 Remko Popma, ***@***.***> wrote:
Related:
Axel Fontaine wrote a series of articles about how inefficient and fragile
the Maven Release Plugin is, requiring 3 full builds with multiple
checkouts to do a release. He proposes to replace this with
maven-resources-plugin, maven-install-plugin and maven-deploy-plugin
configuration, plus maven-scm-plugin. This allows him to
- publish new snapshots using
mvn clean deploy
- release and tag new versions using
mvn clean deploy scm:tag -DVERSION_NUMBER=1.2.3
1. https://axelfontaine.com/blog/maven-releases-steroids.html
2. https://axelfontaine.com/blog/maven-releases-steroids-2.html
3. https://axelfontaine.com/blog/maven-releases-steroids-3.html
Additionally, he wrote a follow-up article "the Final Nail"
<https://axelfontaine.com/blog/final-nail.html> in 2013 that replaces the
maven-resources-plugin, maven-install-plugin and maven-deploy-plugin
configuration with versions-maven-plugin. This is much simpler. It does
require running Maven twice: once for updating the version and the again
with the updated version.
The final installment Maven Release Plugin: Dead and Buried
<https://axelfontaine.com/blog/dead-burried.html>, describes how to go
down to just running maven once, without the versions-maven-plugin.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFTCS3ELEKOG6NUYAAQJPTR4OHJVANCNFSM4OVA3KBA>
.
|
Yes, please consider all these comments “notes to self” more than instructions. This is very much work in progress. One I have a process that works and gives us versions as well as a place to host the artifacts created by a release (so our users can just download the binaries instead of building from source), I will document the steps for versioning and publishing a release (our role) and the steps for downloading the latest binary release (our user’s role). |
That's excellent.
I suspect that one or two reports of errors were because the correct
version of the software was not used after it had been patched. Giving a
version number would have avoided some of this.
The current user community is now well versed in git. At present we use a
single master branch and this works well with our current discipline (we
have only had one broken build). This is partly because we build different
components on a single-dev basis. So I think we should continue for the
next 1-2 months, after which activity may ramp down a bit.
…On Mon, Jul 20, 2020 at 9:34 AM Remko Popma ***@***.***> wrote:
Yes, please consider all these comments “notes to self” more than
instructions.
This is very much work in progress.
One I have a process that works and gives us versions as well as a place
to host the artifacts created by a release (so our users can just download
the binaries instead of building from source), I will document the steps
for versioning and publishing a release (our role) and the steps for
downloading the latest binary release (our user’s role).
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#51 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAFTCS4F6GJKL6FAN6DHXETR4P6QTANCNFSM4OVA3KBA>
.
--
Peter Murray-Rust
Founder ContentMine.org
and
Reader Emeritus in Molecular Informatics
Dept. Of Chemistry, University of Cambridge, CB2 1EW, UK
|
Parent POM causes problems for the maven-release-plugin: it has hg (mercurial) configured as SCM, preventing us from using git...
POM changes: * modify `maven-assembly-plugin`: replace unused `jar-with-dependencies` descriptor with custom descriptor in `src/assembly/distribution.xml`. This will create zip and bz2 archives of the distributions generated in `target/appassembler` by `appassembler-maven-plugin`. * remove `maven-release-plugin`, we will manage releases by updating the version in the POM and tagging in git * add `maven-jar-plugin`, to ensure ami jar has a manifest with version information and main class `org.contentmine.ami.tools.AMI` * add `maven-scm-plugin` so we can invoke `mvn scm:check-local-modification`, `mvn scm:checkin` and `mvn scm:tag` * move project info to the top of the file * uncomment parent POM (we no longer need the `maven-release-plugin`) * add properties for all maven plugin versions * rename property `surefire.version` to `maven-surefire-plugin.version` * fix format (indentation)
… to limit the committed file to just pom.xml
Currently,
ami --version
does not show any useful output.There is a need for better output to facilitate support and troubleshooting.
From the OpenVirus Slack:
The text was updated successfully, but these errors were encountered: