java - 如何隐藏额外的细节?

标签 java maven

我是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 设置按钮:

enter image description here

在下面屏幕截图所示的框中输入-q:

enter image description here

确定按钮,然后运行您的类(class)。

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

相关文章:

java - 在 Spring-Boot 中配置 bean

java - 检查扩展类是否是接口(interface)的实例

java - 从 JDK 1.5 到 1.6 的代码迁移

java - 在java中跟踪读取日志

java - m2eclipse 不将 src/main/resources 复制到目标

java - Jenkins 上的 PowerMock 内存泄漏

java - 使用 Selenium 接受 Windows 安全警报

OC4J 中的 java.lang.NoSuchMethodError : javax. persistence.OneToMany.orphanRemoval()Z

java - 如何从 spring boot 定位 Thymeleaf 模板

java - Spark 连接器错误 : WARN NettyUtil: Found Netty's native epoll transport, 但未在基于 linux 的操作系统上运行。改用 NIO