ikxeno commented on PR #13276:
URL: https://github.com/apache/maven/pull/13276#issuecomment-5895036719

   @gnodet, the CLI is ready for review. Here is the output from the unpacked 
distribution at `eaabc887b0`.
   
   I ran all nine fixture files in both modes, then checked batch output, JSON, 
invalid arguments, the `mvn --val` entry point and the repository options. The 
repository probe has `org.apache:apache:35` as a parent and an empty 
`<relativePath/>`, so effective mode has to resolve that parent. Each block 
includes the process exit code. Commands run from the sandbox unless a 
different directory is shown.
   
   Machine-specific paths are shown as `<sandbox>`.
   
   <details>
   <summary><code>mvnval ok/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval ok/pom.xml
   ok/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw ok/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval --mode raw ok/pom.xml
   ok/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval dup/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval dup/pom.xml
   dup/pom.xml:
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: junit:junit:jar -> version 4.13.2 vs 4.12 @ line 5, column 1
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw dup/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval --mode raw dup/pom.xml
   dup/pom.xml:
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: junit:junit:jar -> version 4.13.2 vs 4.12 @ line 5, column 1
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval ghost/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval ghost/pom.xml
   ghost/pom.xml:
     ERROR Child subproject no-such-dir of <sandbox>/ghost does not exist
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw ghost/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval --mode raw ghost/pom.xml
   ghost/pom.xml:
     ERROR Child subproject no-such-dir of <sandbox>/ghost does not exist
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval ghost/mod/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval ghost/mod/pom.xml
   ghost/mod/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw ghost/mod/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval --mode raw ghost/mod/pom.xml
   ghost/mod/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval broken.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval broken.xml
   broken.xml:
     FATAL Non-parseable POM <sandbox>/broken.xml: Unable to read model: 
Unexpected character 'n' (code 110) in prolog; expected '<'
        at [row,col {unknown-source}]: [1,1]
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw broken.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval --mode raw broken.xml
   broken.xml:
     FATAL Non-parseable POM <sandbox>/broken.xml: Unable to read model: 
Unexpected character 'n' (code 110) in prolog; expected '<'
        at [row,col {unknown-source}]: [1,1]
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval inherit/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval inherit/pom.xml
   inherit/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw inherit/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval --mode raw inherit/pom.xml
   inherit/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval inherit/child/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval inherit/child/pom.xml
   inherit/child/pom.xml:
     ERROR 'dependencies.dependency.version' for groupId='org.x', 
artifactId='unmanaged', type='jar' is missing. @ line 4, column 15
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw inherit/child/pom.xml</code> (exit 
0)</summary>
   
   ```text
   $ mvnval --mode raw inherit/child/pom.xml
   inherit/child/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval warn/pom.xml</code> (exit 4)</summary>
   
   ```text
   $ mvnval warn/pom.xml
   warn/pom.xml:
     WARNING 'build.plugins.plugin.version' for 
org.apache.maven.plugins:maven-clean-plugin  is missing. @ line 3, column 17
   exit 4
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw warn/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval --mode raw warn/pom.xml
   warn/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval netty-all-4.1.115.Final.pom</code> (exit 1)</summary>
   
   ```text
   $ mvnval netty-all-4.1.115.Final.pom
   netty-all-4.1.115.Final.pom:
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1060, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-aarch_64 -> 
duplicate declaration of version 4.1.115.Final @ line 1067, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-riscv64 -> duplicate 
declaration of version 4.1.115.Final @ line 1074, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-kqueue:jar:osx-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1081, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-kqueue:jar:osx-aarch_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1088, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1095, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-resolver-dns-native-macos:jar:osx-aarch_64 -> 
duplicate declaration of version 4.1.115.Final @ line 1102, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1109, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-aarch_64 -> 
duplicate declaration of version 4.1.115.Final @ line 1116, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-riscv64 -> duplicate 
declaration of version 4.1.115.Final @ line 1123, column 5
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw netty-all-4.1.115.Final.pom</code> (exit 
1)</summary>
   
   ```text
   $ mvnval --mode raw netty-all-4.1.115.Final.pom
   netty-all-4.1.115.Final.pom:
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1060, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-aarch_64 -> 
duplicate declaration of version 4.1.115.Final @ line 1067, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-riscv64 -> duplicate 
declaration of version 4.1.115.Final @ line 1074, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-kqueue:jar:osx-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1081, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-kqueue:jar:osx-aarch_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1088, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-resolver-dns-native-macos:jar:osx-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1095, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-resolver-dns-native-macos:jar:osx-aarch_64 -> 
duplicate declaration of version 4.1.115.Final @ line 1102, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-x86_64 -> duplicate 
declaration of version 4.1.115.Final @ line 1109, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-aarch_64 -> 
duplicate declaration of version 4.1.115.Final @ line 1116, column 5
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: io.netty:netty-transport-native-epoll:jar:linux-riscv64 -> duplicate 
declaration of version 4.1.115.Final @ line 1123, column 5
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval ok/pom.xml dup/pom.xml ghost/pom.xml 
warn/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval ok/pom.xml dup/pom.xml ghost/pom.xml warn/pom.xml
   ok/pom.xml: no problems
   dup/pom.xml:
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: junit:junit:jar -> version 4.13.2 vs 4.12 @ line 5, column 1
   ghost/pom.xml:
     ERROR Child subproject no-such-dir of <sandbox>/ghost does not exist
   warn/pom.xml:
     WARNING 'build.plugins.plugin.version' for 
org.apache.maven.plugins:maven-clean-plugin  is missing. @ line 3, column 17
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw --format json dup/pom.xml</code> (exit 
1)</summary>
   
   ```text
   $ mvnval --mode raw --format json dup/pom.xml
   
[{"pom":"<sandbox>/dup/pom.xml","problems":[{"severity":"ERROR","message":"'dependencies.dependency.(groupId:artifactId:type:classifier)'
 must be unique: junit:junit:jar -> version 4.13.2 vs 
4.12","line":5,"column":1}]}]
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>RUNNER_DEBUG=1 mvnval --mode raw --format json 
dup/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ RUNNER_DEBUG=1 mvnval --mode raw --format json dup/pom.xml
   
[{"pom":"<sandbox>/dup/pom.xml","problems":[{"severity":"ERROR","message":"'dependencies.dependency.(groupId:artifactId:type:classifier)'
 must be unique: junit:junit:jar -> version 4.13.2 vs 
4.12","line":5,"column":1}]}]
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval -o inherit/child/pom.xml</code> (exit 2)</summary>
   
   ```text
   $ mvnval -o inherit/child/pom.xml
   [ERROR] --offline (-o) needs --mode raw, which reaches no repository.
   exit 2
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw -o inherit/child/pom.xml</code> (exit 
0)</summary>
   
   ```text
   $ mvnval --mode raw -o inherit/child/pom.xml
   inherit/child/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode bogus ok/pom.xml</code> (exit 2)</summary>
   
   ```text
   $ mvnval --mode bogus ok/pom.xml
   [ERROR] Unknown mode 'bogus', expected one of: raw, effective
   exit 2
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --format yaml ok/pom.xml</code> (exit 2)</summary>
   
   ```text
   $ mvnval --format yaml ok/pom.xml
   [ERROR] Unknown format 'yaml', expected one of: text, json
   exit 2
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval missing-pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvnval missing-pom.xml
   missing-pom.xml: does not exist
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval ok</code> (exit 1)</summary>
   
   ```text
   $ mvnval ok
   ok: is a directory, not a POM file
   exit 1
   ```
   
   </details>
   
   <details>
   <summary><code>cd ok &amp;&amp; mvnval</code> (exit 0)</summary>
   
   ```text
   $ cd ok && mvnval
   pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval ok/pom.xml ./ok/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval ok/pom.xml ./ok/pom.xml
   ok/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw --temp-local-repository ok/pom.xml</code> 
(exit 0)</summary>
   
   ```text
   $ mvnval --mode raw --temp-local-repository ok/pom.xml
   ok/pom.xml: no problems
   exit 0
   ```
   
   </details>
   
   <details>
   <summary><code>mvn --val --mode raw dup/pom.xml</code> (exit 1)</summary>
   
   ```text
   $ mvn --val --mode raw dup/pom.xml
   dup/pom.xml:
     ERROR 'dependencies.dependency.(groupId:artifactId:type:classifier)' must 
be unique: junit:junit:jar -> version 4.13.2 vs 4.12 @ line 5, column 1
   exit 1
   ```
   
   </details>
   
   Repository options: the three explicit-path runs each fetched 
`org/apache/apache/35/apache-35.pom` into the requested directory. For each 
temporary run, I observed one `mvnval-repo-*` directory while the process was 
running and none after it exited.
   
   <details>
   <summary><code>mvnval --local-repository repo-probe/cli-repo 
repo-probe/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval --local-repository repo-probe/cli-repo repo-probe/pom.xml
   [INFO] Loaded 23932 auto-discovered prefixes for remote repository central 
(prefixes-central.txt)
   repo-probe/pom.xml: no problems
   exit 0
   ```
   
   Checked: the parent POM was present in the requested repository.
   
   </details>
   
   <details>
   <summary><code>mvnval -Dmaven.repo.local=repo-probe/property-repo 
repo-probe/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval -Dmaven.repo.local=repo-probe/property-repo repo-probe/pom.xml
   [INFO] Loaded 23932 auto-discovered prefixes for remote repository central 
(prefixes-central.txt)
   repo-probe/pom.xml: no problems
   exit 0
   ```
   
   Checked: the parent POM was present in the requested repository.
   
   </details>
   
   <details>
   <summary><code>mvnval -Dmaven.repo.local=repo-probe/unused-property-repo 
--local-repository repo-probe/priority-repo repo-probe/pom.xml</code> (exit 
0)</summary>
   
   ```text
   $ mvnval -Dmaven.repo.local=repo-probe/unused-property-repo 
--local-repository repo-probe/priority-repo repo-probe/pom.xml
   [INFO] Loaded 23932 auto-discovered prefixes for remote repository central 
(prefixes-central.txt)
   repo-probe/pom.xml: no problems
   exit 0
   ```
   
   Checked: the parent POM was present in the requested repository.
   
   Checked: the unused repository path was not created.
   
   </details>
   
   <details>
   <summary><code>mvnval --temp-local-repository repo-probe/pom.xml</code> 
(exit 0)</summary>
   
   ```text
   $ mvnval --temp-local-repository repo-probe/pom.xml
   [INFO] Loaded 23932 auto-discovered prefixes for remote repository central 
(prefixes-central.txt)
   repo-probe/pom.xml: no problems
   exit 0
   ```
   
   Checked: the temporary directory existed during the run and was gone 
afterward.
   
   </details>
   
   <details>
   <summary><code>mvnval 
-Dmaven.repo.local=repo-probe/unused-temp-property-repo --temp-local-repository 
repo-probe/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval -Dmaven.repo.local=repo-probe/unused-temp-property-repo 
--temp-local-repository repo-probe/pom.xml
   [INFO] Loaded 23932 auto-discovered prefixes for remote repository central 
(prefixes-central.txt)
   repo-probe/pom.xml: no problems
   exit 0
   ```
   
   Checked: the temporary directory existed during the run and was gone 
afterward.
   
   Checked: the unused repository path was not created.
   
   </details>
   
   <details>
   <summary><code>mvnval --local-repository repo-probe/cli-repo 
--temp-local-repository repo-probe/pom.xml</code> (exit 2)</summary>
   
   ```text
   $ mvnval --local-repository repo-probe/cli-repo --temp-local-repository 
repo-probe/pom.xml
   [ERROR] --local-repository and --temp-local-repository name different 
directories; give one.
   exit 2
   ```
   
   </details>
   
   <details>
   <summary><code>mvnval --mode raw --local-repository 
repo-probe/raw-ignored-repo repo-probe/pom.xml</code> (exit 0)</summary>
   
   ```text
   $ mvnval --mode raw --local-repository repo-probe/raw-ignored-repo 
repo-probe/pom.xml
   repo-probe/pom.xml: no problems
   exit 0
   ```
   
   Checked: the unused repository path was not created.
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to