Maven错误 - org.apache.maven.lifecycle.LifecycleExecutionException但Project仍在执行

时间:2016-11-22 22:24:29

标签: maven netbeans

我在eclipse上运行我的项目,在切换到netbeans之后出现了这个错误:

  

无法在项目PortfolioManagement上执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli):命令执行失败。退出并出现错误:1(退出值:1) - > [帮助1]   org.apache.maven.lifecycle.LifecycleExecutionException:无法在项目PortfolioManagement上执行目标org.codehaus.mojo:exec-maven-plugin:1.2.1:exec(default-cli):命令执行失败。       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:217)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)       在org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)       在org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)       在org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)       在org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)       在org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)       在org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)       在org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)       在org.apache.maven.cli.MavenCli.main(MavenCli.java:141)       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)       at java.lang.reflect.Method.invoke(Method.java:498)       在org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)       在org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)       在org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)       在org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)   引起:org.apache.maven.plugin.MojoExecutionException:命令执行失败。       在org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:362)       在org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)       在org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)       ......还有19个   引起:org.apache.commons.exec.ExecuteException:进程退出并显示错误:1(退出值:1)       在org.apache.commons.exec.DefaultExecutor.executeInternal(DefaultExecutor.java:377)       在org.apache.commons.exec.DefaultExecutor.execute(DefaultExecutor.java:160)       在org.codehaus.mojo.exec.ExecMojo.executeCommandLine(ExecMojo.java:610)       在org.codehaus.mojo.exec.ExecMojo.execute(ExecMojo.java:352)       ......还有21个

这是我的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/maven-v4_0_0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>portfolio</groupId>
  <artifactId>PortfolioManagement</artifactId>
  <packaging>jar</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>PortfolioManagement</name>
  <url>http://maven.apache.org</url>
  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version> 
      <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/org.json/json -->
    <dependency>
        <groupId>org.json</groupId>
        <artifactId>json</artifactId>
        <version>20160810</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpclient</artifactId>
      <version>4.5.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpcore</artifactId>
      <version>4.4.5</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpmime</artifactId>
      <version>4.5.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpasyncclient</artifactId>
      <version>4.1.2</version>
    </dependency>
    <dependency>
      <groupId>org.apache.httpcomponents</groupId>
      <artifactId>httpasyncclient-cache</artifactId>
      <version>4.1.2</version>
    </dependency>
  </dependencies>
  <build>
    <plugins>
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.5.1</version>
      <configuration>
        <source>1.8</source>
        <target>1.8</target>
      </configuration>
    </plugin>
    </plugins>
  </build>
</project>

重要的是要指出在项目执行之后正在发生此错误,因此项目运行正常但在完成后此错误正在打印。有什么建议吗?

0 个答案:

没有答案