【问题标题】:Could not resolve dependencies, Failure to find jar无法解析依赖关系,找不到 jar
【发布时间】:2015-07-10 02:13:50
【问题描述】:

我正在尝试运行 vaadin-charts-demo。

与此类似的问题: Maven Could not resolve dependencies, artifacts could not be resolved

[INFO] <<< vaadin-maven-plugin:7.4.6:compile (default-cli) < process-resources @ vaadin-charts-demo <<<
[WARNING] The POM for com.vaadin.demo:vaadin-charts-examples:jar:3.0-SNAPSHOT is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.414 s
[INFO] Finished at: 2015-07-09T20:57:33-05:00
[INFO] Final Memory: 12M/225M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project vaadin-charts-demo: Could not resolve dependencies for project com.vaadin.demo:vaadin-charts-demo:war:3.0-SNAPSHOT: Failure to find com.vaadin.demo:vaadin-charts-examples:jar:3.0-SNAPSHOT in https://maven.vaadin.com/vaadin-addons was cached in the local repository, resolution will not be reattempted until the update interval of vaadin-addons 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

pom.xml 内容:

<?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/maven-v4_0_0.xsd">

<parent>
    <groupId>com.vaadin.addon</groupId>
    <artifactId>vaadin-charts-parent</artifactId>
    <version>3.0-SNAPSHOT</version>
</parent>

<modelVersion>4.0.0</modelVersion>

<groupId>com.vaadin.demo</groupId>
<artifactId>vaadin-charts-demo</artifactId>
<packaging>war</packaging>

<name>Vaadin Charts Demo</name>

<dependencies>

    <dependency>
        <groupId>com.vaadin.addon</groupId>
        <artifactId>vaadin-charts</artifactId>
        <version>${project.version}</version>
    </dependency>
    <dependency>
        <groupId>com.vaadin.demo</groupId>
        <artifactId>vaadin-charts-examples</artifactId>
        <version>${project.version}</version>
    </dependency>

    <!-- Vaadin -->
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-server</artifactId>
    </dependency>
    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-themes</artifactId>
    </dependency>

    <dependency>
        <groupId>org.reflections</groupId>
        <artifactId>reflections</artifactId>
        <version>0.9.8</version>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>commons-io</groupId>
        <artifactId>commons-io</artifactId>
        <version>2.4</version>
    </dependency>

    <dependency>
        <groupId>org.eclipse.jetty</groupId>
        <artifactId>jetty-webapp</artifactId>
        <version>8.1.13.v20130916</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.vaadin.addons</groupId>
        <artifactId>googleanalyticstracker</artifactId>
        <version>2.1.0</version>
    </dependency>

    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin-maven-plugin</artifactId>
        <version>7.6.0.alpha2</version>
    </dependency>

</dependencies>

<build>
    <resources>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>true</filtering>
            <includes>
                <include>**/config.properties</include>
            </includes>
        </resource>
        <resource>
            <directory>src/main/resources</directory>
            <filtering>false</filtering>
            <excludes>
                <exclude>**/config.properties</exclude>
            </excludes>
        </resource>
    </resources>
    <plugins>
        <plugin>
            <artifactId>maven-deploy-plugin</artifactId>
            <configuration>
                <skip>true</skip>
            </configuration>
        </plugin>
        <plugin>
            <artifactId>maven-war-plugin</artifactId>
            <version>2.4</version>
            <configuration>
                <packagingExcludes>**/gwt-unitCache/*,**/widgetsets/WEB-INF/**/*</packagingExcludes>
            </configuration>
        </plugin>

        <!-- As we are doing "inplace" GWT compilation, ensure the widgetset -->
        <!-- directory is cleaned properly -->
        <plugin>
            <artifactId>maven-clean-plugin</artifactId>
            <version>2.4.1</version>
            <configuration>
                <filesets>
                    <fileset>
                        <directory>src/main/webapp/VAADIN/widgetsets</directory>
                    </fileset>
                </filesets>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <configuration>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <!-- We are doing "inplace" but into subdir VAADIN/widgetsets.
                    This way compatible with Vaadin eclipse plugin. -->
                <webappDirectory>${basedir}/src/main/webapp/VAADIN/widgetsets
                </webappDirectory>
                <hostedWebapp>${basedir}/target/ignore/VAADIN/widgetsets
                </hostedWebapp>
                <noServer>true</noServer>
                <!-- Remove draftCompile when project is ready -->
                <draftCompile>false</draftCompile>
                <compileReport>true</compileReport>
                <!-- <style>PRETTY</style> -->
                <strict>true</strict>
                <runTarget>http://localhost:8080/</runTarget>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>resources</goal>
                        <goal>update-widgetset</goal>
                    </goals>
                </execution>
                <execution>
                    <id>compile-widgetset-on-compile</id>
                    <phase>compile</phase>
                    <goals>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <plugin>
            <groupId>org.mortbay.jetty</groupId>
            <artifactId>jetty-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

尝试谷歌搜索 vaadin-chart-examples 和 chart-demos maven、repository 等,但没有找到解决方案。如何解决?

[[编辑]] 该项目是从这里导入的: https://github.com/vaadin/charts/tree/7a55e8dab5b9941a05603c2624a576866e86045d

按照以下说明: https://github.com/vaadin/charts/blob/7a55e8dab5b9941a05603c2624a576866e86045d/DevInstructions.md

安装后,无法编译小部件

说明书是给 Luna 的,我用的是 Mars,不知道这对事情有什么影响。

【问题讨论】:

  • 您最初是如何设置项目的?您从哪里获得添加此依赖项的信息?为什么用 eclipse 标记问题? 问题中没有提及它。
  • 我添加了编辑 - 当我尝试编译小部件时出现警告/错误

标签: eclipse maven vaadin vaadin7 vaadin-charts


【解决方案1】:

您是否尝试为 Vaadin 插件添加此存储库:

    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>

【讨论】:

  • 是的,它没有用。它还有另一个项目文件夹作为其依赖项之一,并且它的 pom 具有存储库。这是否意味着它们是连接的/相关的/就像在当前项目 pom 中一样?
  • @newMAD 显然,您仍然需要将所有依赖项添加到两个 pom。检查 this link 是否通过 maven 依赖项链接项目。
【解决方案2】:

如果您之前只构建过vaadin-charts-demo,那么之前也构建过vaadin-charts-parent

The parent includes vaadin-charts-examples as &lt;module&gt;. 因此,如果您没有至少构建一次parent(或examples),那么您的 Eclipse 工作区中没有任何模块的工件可用,并且您的本地 Maven 存储库将从那里解析.

请记住,Aggregation and InheritancePOM Relationships 的不同类型。

要从 Eclipse 工作区解决依赖关系,请参阅 您的 Eclipse Maven 项目> → PropertiesMaven → [✔] Resolve来自 Workspace 项目的依赖项。

【讨论】:

    猜你喜欢
    • 2014-09-22
    • 2023-03-29
    • 2018-07-05
    • 2014-05-06
    • 2018-12-15
    • 2022-01-17
    • 2020-08-16
    • 2019-12-19
    • 2018-11-21
    相关资源
    最近更新 更多