Skip to content

[MNG-7941] Meaning of -ntp CLI Option vs. --batch-mode #8973

Closed as not planned

Description

@jira-importer

Karl Heinz Marbaise opened MNG-7941 and commented

If you run a maven build while not downloaded all deps or even not downloaded any dependency at all you will see something like this on the console:

Downloading from nexus: http://localhost:8081/nexus/content/groups/public/org/apache/apache/31/apache-31.pom
Progress (1): 7.9/24 kB
Progress (1): 24 kB    
...
Downloading from nexus: http://localhost:8081/nexus/content/groups/public/org/eclipse/jetty/jetty-security/9.4.46.v20220331/jetty-security-9.4.46.v20220331.jar
Progress (3): 106/733 kB | 73/225 kB | 73/184 kB
Progress (3): 139/733 kB | 73/225 kB | 73/184 kB
Progress (3): 139/733 kB | 106/225 kB | 73/184 kB
Progress (3): 172/733 kB | 106/225 kB | 73/184 kB
Progress (3): 172/733 kB | 106/225 kB | 106/184 kB
Progress (3): 204/733 kB | 106/225 kB | 106/184 kB
Progress (3): 204/733 kB | 139/225 kB | 106/184 kB
Progress (3): 204/733 kB | 139/225 kB | 139/184 kB
Progress (3): 237/733 kB | 139/225 kB | 139/184 kB
Progress (3): 237/733 kB | 172/225 kB | 139/184 kB
Progress (3): 237/733 kB | 172/225 kB | 172/184 kB
Progress (3): 237/733 kB | 172/225 kB | 184 kB    
Progress (3): 270/733 kB | 172/225 kB | 184 kB
Progress (3): 270/733 kB | 204/225 kB | 184 kB
Progress (3): 270/733 kB | 225 kB | 184 kB    
Progress (4): 270/733 kB | 225 kB | 184 kB | 7.9/147 kB
Progress (4): 303/733 kB | 225 kB | 184 kB | 7.9/147 kB
...                   

So far as usual..

What you can do to prevent the long outputs is just use: --batch-mode which prevents the output of the progress and the result looks like this:

[INFO] Downloaded from nexus: http://localhost:8081/nexus/content/groups/public/org/apache/maven/doxia/doxia-module-twiki/1.11.1/doxia-module-twiki-1.11.1.jar (73 kB at 1.4 MB/s)
[INFO] Downloading from nexus: http://localhost:8081/nexus/content/groups/public/org/eclipse/jetty/jetty-security/9.4.46.v20220331/jetty-security-9.4.46.v20220331.jar
[INFO] Downloaded from nexus: http://localhost:8081/nexus/content/groups/public/org/eclipse/jetty/jetty-io/9.4.46.v20220331/jetty-io-9.4.46.v20220331.jar (184 kB at 3.4 MB/s)
[INFO] Downloading from nexus: http://localhost:8081/nexus/content/groups/public/org/eclipse/jetty/jetty-util-ajax/9.4.46.v20220331/jetty-util-ajax-9.4.46.v20220331.jar
...

So finally you can use -no-transfer-progress (or -ntp) and the output looks like this:

[INFO] 
[INFO] --- site:3.12.1:attach-descriptor (attach-descriptor) @ maven-dependency-plugin ---
[INFO] Skipping because packaging 'maven-plugin' is not pom.
[INFO] 
[INFO] --- install:3.1.1:install (default-install) @ maven-dependency-plugin ---
..

So based on the naming of \-\-no-transfer-progress which is a bit misleading because the transfer progress output has already been supressed by using --batch-mode.

For Maven 4 we could think about a more cleaner way:

  • --batch-mode will not change anything
  • --no-transfer-progress will prevent the output of Progress (3): 237/733 kB | 172/225 kB | 172/184 kB (which will really represent the function related to the name).
  • --no-download-output could suppress the output as of using -ntp in Maven 3.X

That would be a bit more consistent


Affects: 3.9.5, 4.0.0-alpha-8

Activity

  1. jira-importer commented on Nov 18, 2023

    @jira-importer
    Author

    Michael Osipov commented

    Parts are a misconception. Batch mode is really no-tty, more than just the output. The output, we have discussed already with Tamas Cservenak, that we need implmentations with assigned names instead of more switches, e.g., --transfer-mode none|full|bla|foo|etc...

  2. jira-importer commented on Nov 18, 2023

    @jira-importer
    Author

    Tamas Cservenak commented

    Example PoC just to show the idea: #1238

  3. jira-importer commented on Nov 21, 2023

    @jira-importer
    Author

    Tamas Cservenak commented

    Is there something to be done for upcoming Maven 3.9.6 in relation to this issue?

  4. jira-importer commented on Nov 26, 2023

    @jira-importer
    Author

    Tamas Cservenak commented

    I want 3.9.6 out soon, so if it comes to release and response, will remove this issue from 3.9.6 (we can have 3.9.7 etc as we want anyway)...

  5. jira-importer commented on Jul 6, 2024

    @jira-importer
    Author

    Guillaume Nodet commented

    Tamas Cservenak should we postpone it ?

  6. jira-importer commented on Jul 6, 2024

    @jira-importer
    Author

    Tamas Cservenak commented

    Yup, lets postpone

  7. jira-importer commented on Jul 6, 2024

    @jira-importer
    Author

    Michael Osipov commented

    We have discussed this once with Tamas Cservenak and came to the conclusion that this should be generalized and received a optional parameter should receive an impl name which does the magic. No more additional switches.

  8. added
    enhancement
    priority:minor
    on Jul 7, 2025
  9. modified the milestones: , 4.x on Jul 7, 2025
  10. gnodet commented on Oct 14, 2026

    @gnodet
    Contributor

    Closing as superseded by #12571, which replaces the -ntp/--batch-mode output semantics with explicit --console=auto|rich|plain|verbose|machine modes, making the intent clear and eliminating the ambiguity between -ntp and --batch-mode.

    Claude Code on behalf of Guillaume Nodet

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementpriority:minor

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions