[ 
https://issues.apache.org/jira/browse/MNG-8165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864546#comment-17864546
 ] 

Tamas Cservenak commented on MNG-8165:
--------------------------------------

[~michaelo] your help needed here.

As discussed with [~gnodet] the issue is really just the mvn/mvn.bat script, 
everything else is fine. The script figures out the multiModuleProjectDirectory 
property to load up jvm.config if found (and then if found, all the rest like 
extensions.xml and maven.config should be loaded from there as well, this is 
where my PR was off).

There is only one problem: it seems FS root "/" is not inspected. As I see, 
this is true for mvn script, am unsure about mvn.bat, but this issue is present 
in the wrapper scripts as well...

> Maven does not find extensions for -f when current dir is root
> --------------------------------------------------------------
>
>                 Key: MNG-8165
>                 URL: https://issues.apache.org/jira/browse/MNG-8165
>             Project: Maven
>          Issue Type: Bug
>    Affects Versions: 3.9.8
>            Reporter: Charles Oliver Nutter
>            Assignee: Tamas Cservenak
>            Priority: Major
>             Fix For: 3.9.9
>
>
> 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.xml` file that enables Polyglot Ruby
>  # Create a file `blah/pom.rb` containing 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 [https://github.com/apache/maven/pull/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`).



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to