我是java新手。我想知道每当我运行一个类(class)或整个项目时如何隐藏额外的细节。如果可能的话,我只想看到“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
------------------------------------------------------------------------
最佳答案
使用--quiet
或-q
参数运行mvn
命令:
mvn --quiet ...
或
mvn -q ... ...
如果您想在下载或上传时禁止显示传输进度,请使用--no-transfer-progress
或-ntp
:
mvn --no-transfer-progress ....
或
mvn -ntp ... ....
检查here供引用。
单击下面屏幕截图中显示的Maven 设置按钮:
在下面屏幕截图所示的框中输入-q:
按确定按钮,然后运行您的类(class)。
关于java - 如何隐藏额外的细节?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60487843/