Maven 依赖问题 : Could not resolve dependencies for project

标签 maven

我在构建 Tomcat .war 的 github CLIFF 存储库时遇到问题。

https://github.com/c4fcm/CLIFF

David-Laxers-MacBook-Pro:CLIFF davidlaxer$ java -version
java version "1.8.0_05"
Java(TM) SE Runtime Environment (build 1.8.0_05-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.5-b02, mixed mode)
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ mvn -version
Apache Maven 3.2.1 (ea8b2b07643dbb1b84b6d16e1f08391b666bc1e9; 2014-02-14T09:37:52-08:00)
Maven home: /Users/davidlaxer/Downloads/apache-maven-3.2.1
Java version: 1.8.0_05, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_05.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.10.5", arch: "x86_64", family: "mac"
David-Laxers-MacBook-Pro:CLIFF davidlaxer$ 


The project builds (e.g. - mvn package) in the CLIFF parent:
E.g. 
[INFO] Reactor Summary:
[INFO] 
[INFO] CLIFF ............................................. SUCCESS [  0.003 s]
[INFO] common ............................................ SUCCESS [  2.854 s]
[INFO] stanford-entity-extractor ......................... SUCCESS [01:21 min]
[INFO] cliff ............................................. SUCCESS [ 18.804 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ----------------------------------------------------------------
It gets a dependency error in the child:
e.g stanford-entity-extractor:

[WARNING] The POM for org.mediameter:common:jar:2.3.0 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ----------------------------------------------------------------
    [ERROR] Failed to execute goal on project stanford-entity-extractor: Could not resolve dependencies for project org.mediameter:stanford-entity-extractor:jar:2.3.0: Could not find artifact org.mediameter:common:jar:2.3.0 in central (http://repo.maven.apache.org/maven2) -> [Help 1

David-Laxers-MacBook-Pro: davidlaxer$ ls -l ~/.m2/repository/org/mediameter/stanford-entity-extractor/2.3.0/
total 16
-rw-r--r--  1 davidlaxer  staff  242 Aug 24 10:28 stanford-entity-extractor-2.3.0.jar.lastUpdated
-rw-r--r--  1 davidlaxer  staff  242 Aug 24 12:02 stanford-entity-extractor-2.3.0.pom.lastUpdated

我在这里没有看到 stanford-entity-extractor:jar:2.3.0 的 .jar:

http://mvnrepository.com/artifact/edu.stanford.nlp/stanford-corenlp

或这里:

https://search.maven.org/#search%7Cga%7C1%7Cstanford-entity-extractor

Maven 然后在 CLIFF 父构建构建 Tomcat 时收到错误:

mvn tomcat7:deploy -DskipTests
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Build Order:
[INFO] 
[INFO] CLIFF
[INFO] common
[INFO] stanford-entity-extractor
[INFO] cliff
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building CLIFF 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF >>>
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) @ CLIFF ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building common 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ common >>>
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/main/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ common ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ common ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /Users/davidlaxer/CLIFF/common/src/test/resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ common ---
[INFO] No sources to compile
[INFO] 
[INFO] --- maven-surefire-plugin:2.16:test (default-test) @ common ---
[INFO] Tests are skipped.
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ common ---
[INFO] 
[INFO] <<< tomcat7-maven-plugin:2.1:deploy (default-cli) @ common <<<
[INFO] 
[INFO] --- tomcat7-maven-plugin:2.1:deploy (default-cli) @ common ---
[INFO] Skipping non-war project
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building stanford-entity-extractor 2.3.0
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] >>> tomcat7-maven-plugin:2.1:deploy (default-cli) @ stanford-entity-extractor >>>
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] CLIFF ............................................. SUCCESS [  1.716 s]
[INFO] common ............................................ SUCCESS [  1.870 s]
[INFO] stanford-entity-extractor ......................... FAILURE [  0.061 s]
[INFO] cliff ............................................. SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.184 s
[INFO] Finished at: 2015-08-25T10:05:16-08:00
[INFO] Final Memory: 12M/181M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project stanford-entity-extractor: Could not resolve dependencies for project org.mediameter:stanford-entity-extractor:jar:2.3.0: Failure to find org.mediameter:common:jar:2.3.0 in http://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central 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
[ERROR] 
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <goals> -rf :stanford-entity-extractor
D

pom.xml in child:

<?xml version="1.0" encoding="UTF-8"?>
<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">
        <parent>
                <artifactId>CLIFF</artifactId>
                <groupId>org.mediameter</groupId>
                <version>2.3.0</version>
        </parent>
        <modelVersion>4.0.0</modelVersion>

        <artifactId>stanford-entity-extractor</artifactId>
        <dependencies>
                <dependency>
                        <groupId>org.mediameter</groupId>
                        <artifactId>common</artifactId>
                        <version>2.3.0</version>
                </dependency>
                <dependency>
                        <groupId>edu.stanford.nlp</groupId>
                        <artifactId>stanford-corenlp</artifactId>
                        <version>3.4.1</version>
                </dependency>
                <dependency>
                        <groupId>org.kohsuke.metainf-services</groupId>
                        <artifactId>metainf-services</artifactId>
                        <version>1.1</version>
                        <optional>true</optional>
                </dependency>
                <dependency>
                   <groupId>com.bericotech</groupId>
                   <artifactId>clavin</artifactId>
                   <version>2.0.0</version>
                </dependency>
        </dependencies>

</project>

David-Laxers-MacBook-Pro:stanford-entity-extractor davidlaxer$ mvn install
[INFO] Scanning for projects...
[INFO] 
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building stanford-entity-extractor 2.3.0
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.maven.apache.org/maven2/org/mediameter/common/2.3.0/common-2.3.0.pom
[WARNING] The POM for org.mediameter:common:jar:2.3.0 is missing, no dependency information available
Downloading: http://repo.maven.apache.org/maven2/org/mediameter/common/2.3.0/common-2.3.0.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.961 s
[INFO] Finished at: 2015-08-26T07:57:53-08:00
[INFO] Final Memory: 8M/167M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project stanford-entity-extractor: Could not resolve dependencies for project org.mediameter:stanford-entity-extractor:jar:2.3.0: Could not find artifact org.mediameter:common:jar:2.3.0 in central (http://repo.maven.apache.org/maven2) -> [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
David-Laxers-MacBook-Pro:stanford-entity-extractor davidlaxer$ 

最佳答案

看起来 stanford-entity-extractor 和 common 是本地或公开不可用的子模块 jar。如果您尚未运行 mvn install,它们的 jar 尚未安装在您的本地存储库中,因此它们将无法解析。

关于Maven 依赖问题 : Could not resolve dependencies for project,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32210233/

相关文章:

java - 无法在 Windows 上运行我的 Maven 项目

java - JBehave Maven RunningStoriesFailed 异常

java - 如何按特定顺序运行 Maven 测试?

java - 如何使用 Synopsys detect 扫描 Java Maven 项目

maven - 建立大象鸟 pig 时发生错误

java.lang.NoClassDefFoundError : javax/faces/context/FacesContext

java - Maven 是否启动了两个不同的 JVM?

Maven-tycho 表示尽管其他依赖项有效,但缺少 Lombok 所需的 Artifact

java - 从 Eclipse 启动使用 Maven 配置的 JavaFX 应用程序

jsp - 预编译 JSP 的正确 WEB-INF 路径是什么?