简体   繁体   English

如何防止Spring Tool Suite maven JVM进程在Mac的Dock上放置Java图标?

[英]How to keep the Spring Tool Suite maven JVM processes from placing java icons on Dock for a mac?

Using: 使用:

  • Mac OS X 10.9.5 Mac OS X 10.9.5
  • Spring Tool Suite 3.6.1.RELEASE Spring Tool Suite 3.6.1。发布
  • Using the maven-surefire-plugin to run unit tests in a forked mode. 使用maven-surefire-plugin在分支模式下运行单元测试。

Spring Tool Suite 3.6.1.RELEASE Using the maven-surefire-plugin to run unit tests in a forked mode. Spring Tool Suite 3.6.1.RELEASE使用maven-surefire-plugin在分支模式下运行单元测试。

All the solutions to this problem I found around the web were about putting -Djava.awt.headless=true in various places: Spring Preferences->Java->Installed JREs->Default VM arguments, MAVEN_OPTS, .mavenrc, Run Configurations, etc. None of them stopped the icons from populating the Mac Dock. 我在网上发现的所有解决此问题的方法都是将-Djava.awt.headless = true放在各个位置:Spring偏好设置-> Java->已安装的JREs->默认VM参数,MAVEN_OPTS,.mavenrc,运行配置等。他们都没有阻止图标填充Mac Dock。

How to keep the Spring Tool Suite maven JVM processes from placing java icons on Dock for a mac? 如何防止Spring Tool Suite maven JVM进程在Mac的Dock上放置Java图标?

--Pat - 拍

After trying every suggestion found here and elsewhere on the web to try to get the java VM to stop putting the Java cup icon on the Mac Dock, I've found the solution for what was causing it in my case. 在尝试了在网上和其他地方找到的所有建议,并尝试使Java VM停止将Java cup图标放置在Mac Dock上之后,我找到了造成这种情况的解决方案。 I am posting it hoping it will help others. 我发布它希望对其他人有帮助。

What does work, at least in my particular case, is given the following in our pom.xml to configure surefire: 至少在我的特定情况下,在pom.xml中提供了以下用于配置surefire的方法:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-surefire-plugin</artifactId>
  <version>${org.apache.maven.plugins.surefire-version}</version>
  <configuration>
    <argLine>-Djava.awt.headless=true</argLine>
    <reuseForks>false</reuseForks>
    <forkCount>20</forkCount>
    <excludedGroups>com.xxx.yyyy.util.IntegrationTests</excludedGroups>
  </configuration>
</plugin>

The fix being the adding of the -Djava.awt.headless=true. 解决方法是添加-Djava.awt.headless = true。

You will also want to configure MAVEN_OPTS. 您还将需要配置MAVEN_OPTS。 I did it in my .bashrc file: 我在.bashrc文件中做到了:

export MAVEN_OPTS=-Djava.awt.headless=true 出口MAVEN_OPTS = -Djava.awt.headless = true

No more annoying icons pop up now and take focus from the current window. 现在不再弹出烦人的图标并从当前窗口集中注意力。

Hope this is helpful. 希望这会有所帮助。

--Pat - 拍

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM