我是Java新手。我想知道当我运行一个类或整个项目时,如何隐藏额外的细节。如果可能的话,我只希望看到“ hello world”,而不是其余的细节。

cd /home/hamza/NetBeansProjects/testing; JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64 /home/hamza/netbeans/java/maven/bin/mvn "-Dexec.args=-classpath %classpath application.testing.hello" -Dexec.executable=/usr/lib/jvm/java-11-openjdk-amd64/bin/java -Dexec.classpathScope=runtime process-classes org.codehaus.mojo:exec-maven-plugin:1.5.0:exec
Scanning for projects...

------------------------------------------------------------------------
Building testing 1.0-SNAPSHOT
------------------------------------------------------------------------

--- maven-resources-plugin:2.6:resources (default-resources) @ testing ---
Using 'UTF-8' encoding to copy filtered resources.
skip non existing resourceDirectory /home/hamza/NetBeansProjects/testing/src/main/resources

--- maven-compiler-plugin:3.1:compile (default-compile) @ testing ---
Nothing to compile - all classes are up to date

--- exec-maven-plugin:1.5.0:exec (default-cli) @ testing ---
hello world
------------------------------------------------------------------------
BUILD SUCCESS
------------------------------------------------------------------------
Total time: 1.342 s
Finished at: 2020-02-29T21:54:11+05:00
Final Memory: 9M/37M
------------------------------------------------------------------------

最佳答案

使用mvn--quiet参数运行-q命令:

mvn --quiet ...


要么

mvn -q ... ...


如果要在下载或上传时禁止显示传输进度,请使用--no-transfer-progress-ntp

mvn --no-transfer-progress ....


要么

mvn -ntp ... ....


检查here以供参考。

单击下面的屏幕快照中显示的“ Maven设置”按钮:

java - 如何隐藏多余的细节?-LMLPHP

在下面的屏幕快照中显示的框中键入-q:

java - 如何隐藏多余的细节?-LMLPHP

按确定按钮,然后运行您的课程。

关于java - 如何隐藏多余的细节?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/60487843/

10-12 22:57