Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/5.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
Java Maven构建现有Groovy项目时出错_Java_Maven_Groovy_Openjdk - Fatal编程技术网

Java Maven构建现有Groovy项目时出错

Java Maven构建现有Groovy项目时出错,java,maven,groovy,openjdk,Java,Maven,Groovy,Openjdk,我想从以下github项目复制分支iswc13:。 我在本地克隆项目,然后切换到iswc13分支。 我的环境是Ubuntu 16.04、Maven 3.3.9和Openjdk版本“1.8.0_121”。 我需要帮助,因为我在编译项目时遇到以下错误 Downloading: http://repository.codehaus.org/org/codehaus/groovy/groovy-eclipse-batch/maven-metadata.xml Downloading: http://ne

我想从以下github项目复制分支iswc13:。 我在本地克隆项目,然后切换到iswc13分支。 我的环境是Ubuntu 16.04、Maven 3.3.9和Openjdk版本“1.8.0_121”。 我需要帮助,因为我在编译项目时遇到以下错误

Downloading: http://repository.codehaus.org/org/codehaus/groovy/groovy-eclipse-batch/maven-metadata.xml
Downloading: http://nexus.codehaus.org/snapshots/org/codehaus/groovy/groovy-eclipse-batch/maven-metadata.xml
[WARNING] Could not transfer metadata org.codehaus.groovy:groovy-eclipse-batch/maven-metadata.xml from/to codehaus.org (http://repository.codehaus.org): repository.codehaus.org: Name or service not known
[WARNING] Could not transfer metadata org.codehaus.groovy:groovy-eclipse-batch/maven-metadata.xml from/to codehaus-snapshots (http://nexus.codehaus.org/snapshots/): nexus.codehaus.org: Name or service not known
[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] Compiling 1 source file to /home/caleb/workspace/KnowledgeGraphIdentification/nell_lazy/target/classes
Annotation processing got disabled, since it requires a 1.6 compliant JVM
----------
1. ERROR in /home/caleb/workspace/KnowledgeGraphIdentification/nell_lazy/src/main/java/edu/umd/cs/psl/kgi/RunKGI.groovy (at line 1)
    package edu.umd.cs.psl.kgi;
    ^
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files
----------
2. ERROR in /home/caleb/workspace/KnowledgeGraphIdentification/nell_lazy/src/main/java/edu/umd/cs/psl/kgi/RunKGI.groovy (at line 1)
    package edu.umd.cs.psl.kgi;
    ^
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
----------
2 problems (2 errors)[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Found 2 errors and 0 warnings.
[INFO] 1error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.569 s
[INFO] Finished at: 2017-01-30T18:06:48+01:00
[INFO] Final Memory: 14M/315M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project kgi: Compilation failure
[ERROR] Found 2 errors and 0 warnings.
当我运行mvn compile-X时,我有以下几点:

[INFO] Using Groovy-Eclipse compiler to compile both Java and Groovy files
[INFO] Compiling 1 source file to /home/caleb/workspace/KnowledgeGraphIdentification/nell_lazy/target/classes
Annotation processing got disabled, since it requires a 1.6 compliant JVM
----------
1. ERROR in /home/caleb/workspace/KnowledgeGraphIdentification/nell_lazy/src/main/java/edu/umd/cs/psl/kgi/RunKGI.groovy (at line 1)
    package edu.umd.cs.psl.kgi;
    ^
The type java.io.ObjectInputStream cannot be resolved. It is indirectly referenced from required .class files
----------
2. ERROR in /home/caleb/workspace/KnowledgeGraphIdentification/nell_lazy/src/main/java/edu/umd/cs/psl/kgi/RunKGI.groovy (at line 1)
    package edu.umd.cs.psl.kgi;
    ^
The type java.util.Map$Entry cannot be resolved. It is indirectly referenced from required .class files
----------
2 problems (2 errors)[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] Found 2 errors and 0 warnings.
[INFO] 1error
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.499 s
[INFO] Finished at: 2017-01-30T18:15:54+01:00
[INFO] Final Memory: 13M/307M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project kgi: Compilation failure
[ERROR] Found 2 errors and 0 warnings.
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.3.1:compile (default-compile) on project kgi: Compilation failure
Found 2 errors and 0 warnings.

    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
    at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
    at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
    at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
    at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
    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)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.CompilationFailureException: Compilation failure
Found 2 errors and 0 warnings.

    at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:656)
    at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:128)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
    ... 20 more
[ERROR] 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

这是一个Java版本的问题。该项目是用以前版本的Java完成的,没有使用我当前的设置,即Openjdk版本“1.8.0_121”。我不得不使用为Java1.8制作的
pom.xml
。我用这个替换了当前的,它编译成功了

您是否可以共享引发此错误的groovy类,如果它测试一个特定的类,那么也可以。是引发此错误的类。