有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java使用Maven构建类路径失败

我正在与git的Knowledge Graph Identification repository合作。根据自述。md文件,我可以使用batsh fetchDataset.sh下载数据集。然后,我尝试使用以下命令使用Maven构建类路径

~/KnowledgeGraphIdentification/nell_lazy$ mvn dependency:build-classpath -Dmdep.outputFile=classpath.out

但构建失败,并显示以下消息

[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building kgi 1.0.-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for edu.umd.cs:psl-groovy:jar:1.1 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.306 s
[INFO] Finished at: 2018-10-15T16:28:45+05:30
[INFO] Final Memory: 9M/303M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project kgi: Could not resolve dependencies for project edu.umd.cs.psl.kgi:kgi:jar:1.0.-SNAPSHOT: Failure to find edu.umd.cs:psl-groovy:jar:1.1 in https://scm.umiacs.umd.edu/maven/lccd/content/repositories/psl-releases/ was cached in the local repository, resolution will not be reattempted until the update interval of psl-releases has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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/DependencyResolutionException

因此,我检查了Maven和Java安装

Apache Maven 3.3.9
Maven home: /usr/share/maven
Java version: 1.8.0_181, vendor: Oracle Corporation
Java home: /usr/lib/jvm/java-8-openjdk-amd64/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "4.15.0-34-generic", arch: "amd64", family: "unix"

因此,对于我使用maven构建的类路径在这里失败的原因,我希望能提供一些信息


共 (1) 个答案

  1. # 1 楼答案

    我刚刚运行了这个程序,并考虑发布解决方案。 因为我运行的是早期版本的psl,所以我无法构建类路径,因为KGI工件在最新版本中不可用

    因此,对于任何新用户,请注意以下几点: 通过用这个金丝雀版本pom.xml替换pom.xml文件,我成功地构建了它。 除此之外,还有以下psl目录

    • psl cli
    • psl核心
    • psl groovy
    • psl解析器

    this repo开始,需要在你正在进行的实验中提供

    然后,下面将成功构建创建classpath.out文件的类路径

    mvn dependency:build-classpath -Dmdep.outputFile=classpath.out