使用netbeans创建maven项目

时间:2018-01-10 22:56:58

标签: java image maven netbeans tagging

我是maven的初学者以及imagga注释服务。我正在尝试this tutorial。我做了(下载并安装)步骤。第二步没有详细描述,但我尽力做到最好。当我在测试部分运行代码时出现此错误

cd C:\Users\fatto\Documents\NetBeansProjects\mavenproject1; "JAVA_HOME=C:\\Program Files\\Java\\jdk1.8.0_151" cmd /c "\"\"C:\\Program Files\\NetBeans 8.2\\java\\maven\\bin\\mvn.bat\" -Dexec.args=\"-classpath %classpath com.imagga.api.imagga.ImaggaTest\" -Dexec.executable=\"C:\\Program Files\\Java\\jdk1.8.0_151\\bin\\java.exe\" -Dmaven.ext.class.path=\"C:\\Program Files\\NetBeans 8.2\\java\\maven-nblib\\netbeans-eventspy.jar\" -Dfile.encoding=UTF-8 org.codehaus.mojo:exec-maven-plugin:1.2.1:exec\""
Running NetBeans Compile On Save execution. Phase execution is skipped and output directories of dependency projects (with Compile on Save turned on) will be used instead of their jar artifacts.
Scanning for projects...
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.pom

Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.pom (8 KB at 6.1 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/28/mojo-parent-28.pom

Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/mojo-parent/28/mojo-parent-28.pom (26 KB at 40.3 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/codehaus-parent/3/codehaus-parent-3.pom

Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/codehaus-parent/3/codehaus-parent-3.pom (5 KB at 8.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.jar

Downloaded: http://repo.maven.apache.org/maven2/org/codehaus/mojo/exec-maven-plugin/1.2.1/exec-maven-plugin-1.2.1.jar (37 KB at 37.9 KB/sec)

------------------------------------------------------------------------
Building mavenproject1 0.1.0
------------------------------------------------------------------------

--- exec-maven-plugin:1.2.1:exec (default-cli) @ mavenproject1 ---
Downloading: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/maven/maven-plugin-api/2.0/maven-plugin-api-2.0.pom (601 B at 1.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-exec/1.1/commons-exec-1.1.pom

Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-exec/1.1/commons-exec-1.1.pom (11 KB at 25.4 KB/sec)
Downloading: http://repo.maven.apache.org/maven2/org/apache/commons/commons-exec/1.1/commons-exec-1.1.jar

Downloaded: http://repo.maven.apache.org/maven2/org/apache/commons/commons-exec/1.1/commons-exec-1.1.jar (52 KB at 90.3 KB/sec)
Calling endpoint: categorize
Exception in thread "main" java.lang.RuntimeException: Uncompilable source code - cannot find symbol
  symbol:   variable ApiInvoker
  location: class com.imagga.api.imagga.ImaggaTest
    at com.imagga.api.imagga.ImaggaTest.testCategorizeCategorizations(ImaggaTest.java:17)
    at com.imagga.api.imagga.ImaggaTest.main(ImaggaTest.java:142)
------------------------------------------------------------------------
BUILD FAILURE
------------------------------------------------------------------------
Total time: 5.944s
Finished at: Thu Jan 11 01:37:51 AST 2018
Final Memory: 6M/123M
------------------------------------------------------------------------
Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2.1:exec (default-cli) on project mavenproject1: Command execution failed. Process exited with an error: 1 (Exit value: 1) -> [Help 1]

To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.

For more information about the errors and possible solutions, please read the following articles:
[Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

我不确定我是以错误的方式创建项目还是确切的问题是什么。

复制它并将其粘贴到项目中后的代码如下图所示

Screenshot

我不确定红线的原因

使用命令行构建后的项目

Build result with command line

谢谢

0 个答案:

没有答案