首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Vaadin + maven问题

Vaadin + maven问题
EN

Stack Overflow用户
提问于 2014-04-09 20:46:48
回答 4查看 4.2K关注 0票数 0

我正在尝试为一个新项目设置Vaadin。我正在遵循https://vaadin.com/wiki/-/wiki/Main/Creating+a+Maven+project中记录的步骤

以下命令位于空目录中:

代码语言:javascript
复制
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-application -DarchetypeVersion=7.1.8

出现以下错误:

代码语言:javascript
复制
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:2.2:generate (default-cli) on project standalone-pom: The desired archetype does not exist (com.vaadin:vaadin-archetype-application:7.1.8) -> [Help 1]

我还尝试使用以下命令创建pom:

代码语言:javascript
复制
<?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">
    <modelVersion>4.0.0</modelVersion>

    <groupId>group</groupId>
    <artifactId>artifact</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>war</packaging>
    <name>name</name>
    <description>description</description>

    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
        <vaadin.version>7.1.6</vaadin.version>
    </properties>

    <dependencies>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-server</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client-compiled</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-client</artifactId>
            <version>${vaadin.version}</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-themes</artifactId>
            <version>${vaadin.version}</version>
        </dependency>
    </dependencies>
</project>

运行mvm clean install会导致以下错误:

代码语言:javascript
复制
[ERROR] Failed to execute goal on project artifact: Could not resolve dependencies for project group:artifact:war:1.0-SNAPSHOT: The following artifacts could not be resolved: com.vaadin:vaadin-server:jar:7.1.6, com.vaadin:vaadin-client-compiled:jar:7.1.6, com.vaadin:vaadin-client:jar:7.1.6, com.vaadin:vaadin-themes:jar:7.1.6: Failure to find com.vaadin:vaadin-server:jar:7.1.6 in http://10.255.251.14:9991/nexus/content/groups/public was cached in the local repository, resolution will not be reattempted until the update interval of nexus has elapsed or updates are forced -> [Help 1]

此外,还会看到以下警告:

代码语言:javascript
复制
[WARNING] The POM for com.vaadin:vaadin-server:jar:7.1.6 is missing, no dependency information available
[WARNING] The POM for com.vaadin:vaadin-client-compiled:jar:7.1.6 is missing, no dependency information available
[WARNING] The POM for com.vaadin:vaadin-client:jar:7.1.6 is missing, no dependency information available
[WARNING] The POM for com.vaadin:vaadin-themes:jar:7.1.6 is missing, no dependency information available

起初,我们认为我们的nexus安装可能有一些问题,但我们也尝试在没有nexus的情况下从外部机器运行这些命令。同样的问题。

EN

回答 4

Stack Overflow用户

发布于 2014-04-09 20:50:10

尝试添加

代码语言:javascript
复制
<dependency>
    <groupId>com.vaadin</groupId>
    <artifactId>vaadin-client-compiler</artifactId>
    <version>${vaadin.version}</version>
    <scope>provided</scope>
</dependency>
票数 2
EN

Stack Overflow用户

发布于 2014-04-10 19:20:05

将以下内容添加到您的pom.xml:

代码语言:javascript
复制
<repositories>
        <repository>
            <id>vaadin-addons</id>
            <url>http://maven.vaadin.com/vaadin-addons</url>
        </repository>
        <repository>
            <id>vaadin-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>vaadin-snapshots</id>
            <url>http://oss.sonatype.org/content/repositories/vaadin-snapshots/</url>
            <releases>
                <enabled>false</enabled>
            </releases>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
    </pluginRepositories>

然后,您必须强制更新。示例:mvn install -U

票数 2
EN

Stack Overflow用户

发布于 2014-04-09 22:46:52

这个问题似乎与maven存储库有关,而与vaadin无关。我尝试过在其他国家定位计算机(很可能也是不同的maven仓库镜像),并且工作正常。

更新:我让它工作了一个小时左右,没有改变任何东西,然后它又开始失败了。这可能与目前每个人都为之疯狂的heartbleed bug有关。管理员可能会到处修补它,可能会对存储库服务或我们自己的网络造成一些中断。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/22963011

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档