Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/387.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
运行exec:java时发出killAfter不推荐的警告_Java_Maven_Exec Maven Plugin - Fatal编程技术网

运行exec:java时发出killAfter不推荐的警告

运行exec:java时发出killAfter不推荐的警告,java,maven,exec-maven-plugin,Java,Maven,Exec Maven Plugin,我注意到,每次在MAVEN中运行exec:java命令时都会收到此警告 [警告]警告:现在不推荐使用killAfter。你需要它吗?请对MEXEC-6发表评论 我怎样才能摆脱它?我一直在找,但没有线索 POM.xml: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven

我注意到,每次在MAVEN中运行exec:java命令时都会收到此警告

[警告]警告:现在不推荐使用killAfter。你需要它吗?请对MEXEC-6发表评论

我怎样才能摆脱它?我一直在找,但没有线索

POM.xml:

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>foodfinder</groupId>
  <artifactId>food-client</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <name>Food Finder client</name>
  <description>The client application for the Food Finder</description>
  <dependencies>
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20140107</version>
    </dependency>
    <dependency>
        <groupId>org.apache.uima</groupId>
        <artifactId>uimaj-tools</artifactId>
        <version>2.6.0</version>
    </dependency>
    <dependency>
        <groupId>commons-validator</groupId>
        <artifactId>commons-validator</artifactId>
        <version>1.4.0</version>
    </dependency>
    <dependency>
        <groupId>com.razican.utils</groupId>
        <artifactId>java-utils</artifactId>
        <version>0.1.0</version>
    </dependency>
    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.3.2</version>
    </dependency>
  </dependencies>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>
  <issueManagement>
    <system>GitHub</system>
    <url>https://github.com/Razican/FoodClient/issues</url>
  </issueManagement>
  <ciManagement>
    <system>Travis-CI</system>
    <url>https://travis-ci.org/Razican/FoodClient</url>
  </ciManagement>
  <repositories>
    <repository>
        <id>Java-Utils</id>
        <url>https://raw.github.com/Razican/Java-Utils/mvn-repo/</url>
        <snapshots>
            <enabled>true</enabled>
            <updatePolicy>always</updatePolicy>
        </snapshots>
    </repository>
  </repositories>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.2</version>
        <configuration>
          <source>1.7</source>
          <target>1.7</target>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-assembly-plugin</artifactId>
        <version>2.5.1</version>
        <configuration>
          <archive>
            <manifest>
              <mainClass>foodfinder.client.Launcher</mainClass>
            </manifest>
          </archive>
          <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
          </descriptorRefs>
        </configuration>
      </plugin>
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <version>1.3.2</version>
          <executions>
            <execution>
              <goals>
                <goal>java</goal>
              </goals>
            </execution>
          </executions>
          <configuration>
            <mainClass>foodfinder.client.Launcher</mainClass>
          </configuration>
      </plugin>
    </plugins>
  </build>
</project>

4.0.0
食客
食品客户
0.0.1-快照
食物查询客户端
Food Finder的客户端应用程序
org.json
json
20140107
org.apache.uima
uimaj工具
2.6.0
通用验证器
通用验证器
1.4.0
com.razican.utils
java utils
0.1.0
org.apache.commons
commons-lang3
3.3.2
UTF-8
github
https://github.com/Razican/FoodClient/issues
特拉维斯CI
https://travis-ci.org/Razican/FoodClient
Java Utils
https://raw.github.com/Razican/Java-Utils/mvn-repo/
真的
总是
org.apache.maven.plugins
maven编译器插件
3.2
1.7
1.7
org.apache.maven.plugins
maven汇编插件
2.5.1
foodfinder.client.Launcher
带有依赖项的jar
org.codehaus.mojo
execmaven插件
1.3.2
JAVA
foodfinder.client.Launcher

要消除此警告,您需要修改pom.xml

  <plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.3.2</version>
      <executions>
        <execution>
          <goals>
            <goal>java</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <!--
          to get rid of the warning: [WARNING] Warning: killAfter is now deprecated. Do you need it ? Please comment on MEXEC-6.
          see: method execute() in https://github.com/ispringer/exec-maven-plugin/blob/master/src/main/java/org/codehaus/mojo/exec/ExecJavaMojo.java
        -->
        <killAfter>-1</killAfter>
        <mainClass>foodfinder.client.Launcher</mainClass>
      </configuration>
  </plugin>
选择一个:

1) 通过添加以下内容更改pom中的exec maven插件配置:

<killAfter>-1</killAfter>

更新至exec maven插件的1.4.0版。警告不再出现。

也许你应该阅读MEXEC-6 JIRA版本。除了删除消息之外,这实际上还有什么作用?@jjpe请查看源代码搜索。如果你不需要这个选项,你可以决定是否抑制它。如果你需要这个选项,你应该在提到的bug报告上留下评论。
<killAfter>-1</killAfter>
-Dexec.killAfter=-1