Doesn't support multi-module projects

Issue #9 resolved
Andrew S created an issue

Say I have a multi-module (a.k.a. reactor) project with modules A and B. I have a mvnvm.properties file in the project root as required.

If I run Maven from the project root (e.g. mvn -version), mvnvm uses the correct Maven version. However if I change directory into one of the module directories and run Maven, mvnvm uses some other version (in my case, 3.0.5).

This is a problem for multi-module Atlassian plugins, where AMPS requires you to launch the plugin from its module directory (e.g. using atlas-run or mvn jira:run).

AFAICT, the only workaround is to put mvnvm.properties files into each module's directory, which is asking for trouble when the version changes.

Solutions could include:

  • setting a mvnvm.version property in the project's root POM, and changing mvnvm to read that value from the effective POM rather than (or in addition to) the mvnvm.properties file. This would automatically work for all sub-modules regardless of how deeply they are nested in the project hierarchy, provided they had the correct POM inheritance (and if they didn't, the user has no right to be surprised when mvnvm doesn't work)
  • walking up the directory tree until the root is reached or a mvnvm.properties file is found (which would also give people the ability to set a machine-wide default version if they chose). This approach is unlikely to lead to surprises, as you'd never nest one project within another.

Comments (7)

  1. Matthew McMahon Account Deactivated

    This is done, but @mjensen or @AndrewSwan_au can you mark it as resolved?

  2. Andrew S Account Deactivated reporter

    Tested by downloading the archive with SHA1 8145a8965ea72dcb2b61737ba94a1a7cd6cf3360, and it works; marking as resolved.

  3. Log in to comment