Doesn't support multi-module projects
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) themvnvm.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)
-
Account Deactivated reporter -
repo owner - removed responsible
-
repo owner -
assigned issue to
Your PR looks to have addressed this issue, please close it if its complete
https://bitbucket.org/mjensen/mvnvm/pull-request/13/issue-9-traverse-up-the-directory/diff
-
assigned issue to
-
Account Deactivated It has, along with https://bitbucket.org/mjensen/mvnvm/pull-request/16/dont-use-cd-to-find-mvnvmproperties but unfortunately I don't have permission to mark this as resolved :(
-
Account Deactivated This is done, but @mjensen or @AndrewSwan_au can you mark it as resolved?
-
Account Deactivated reporter Tested by downloading the archive with SHA1
8145a8965ea72dcb2b61737ba94a1a7cd6cf3360
, and it works; marking as resolved. -
Account Deactivated reporter - changed status to resolved
- Log in to comment
The problem with reading the effective POM is that it's slow.