-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Description
Charles Oliver Nutter opened MNG-8165 and commented
There seems to be a problem with how Maven locates the .mvn/extensions.xml file if you run it at root. This appears to be breaking JRuby's user of Polyglot Maven when running in a Docker container (https://github.com/jruby/jruby/issues/7059)
To reproduce (see long output at https://github.com/jruby/jruby/issues/7059#issuecomment-2190953877):
- Be at the root of the filesystem
- Create
.mvn/extensions.xmlfile that enables Polyglot Ruby - Create a file
blah/pom.rbcontaining a#that will be rejected as invalid pom XML. - Execute the file with
mvn -f blah/pom.rb clean
The expected behavior should be that it fills in a dummy group and artifact ID for the blank ruby pom file and executes it correctly.
Instead, it does not load Polyglot Ruby and attempts to parse the file as XML.
I suspect that work done in #94 for MNG-5889 may have introduced this bug. Prior to that issue, Maven would always look in the current directory for .mvn (which is root in this case), which would allow this scenario to work. The fix was to have Maven look first in the target directory and then in parent directories, but now it never looks at root (/.mvn).
Affects: 3.9.8
Remote Links:
- GitHub Pull Request #1604
- GitHub Pull Request #1647
- GitHub Pull Request #1648
- GitHub Pull Request #1652
- GitHub Pull Request #1653
Backported to: 4.0.0-beta-4, 3.9.9