[
https://issues.apache.org/jira/browse/MNG-8165?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17864292#comment-17864292
]
Charles Oliver Nutter commented on MNG-8165:
--------------------------------------------
[~cstamas] Following my
[example|https://github.com/jruby/jruby/issues/7059#issuecomment-2190953877], I
tried mvn 3.9-snapshot from that branch but it does not appear to work:
{code:java}
root@db1d348cf727:/# maven-3.9/bin/mvn -f blah/blah.rb init
[INFO] Scanning for projects...
[ERROR] [ERROR] Some problems were encountered while processing the POMs:
[FATAL] Non-parseable POM /blah/blah.rb: only whitespace content allowed before
start tag and not # (position: START_DOCUMENT seen #... @1:2) @ line 1, column
2
@
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR] The project (/blah/blah.rb) has 1 error
[ERROR] Non-parseable POM /blah/blah.rb: only whitespace content allowed
before start tag and not # (position: START_DOCUMENT seen #... @1:2) @ line 1,
column 2 -> [Help 2]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e
switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please
read the following articles:
[ERROR] [Help 1]
http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildingException
[ERROR] [Help 2]
http://cwiki.apache.org/confluence/display/MAVEN/ModelParseException
root@db1d348cf727:/# maven-3.9/bin/mvn -v
Apache Maven 3.9.9-SNAPSHOT (d5e8e93442fd5a30f35732b0afabb535970f7af8)
Maven home: /maven-3.9
Java version: 1.8.0_412, vendor: Private Build, runtime:
/usr/lib/jvm/java-8-openjdk-arm64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.6.16-linuxkit", arch: "aarch64", family: "unix"
{code}
> 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
> 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)