【问题标题】:FATAL ERROR while compiling Project using Maven 2使用 Maven 2 编译项目时出现致命错误
【发布时间】:2013-08-14 04:14:52
【问题描述】:

我是 Maven 新手,开始将我的项目迁移到 Maven。我创建了以下 POM。 当我发出安装命令时,它给了我致命错误。

我使用的是 maven 2.2.1 版本和 JDK 1.5。

我的POM如下:

<?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>
    <prerequisites>
        <maven>2.2.1</maven>
    </prerequisites>
    <groupId>my.project.group</groupId>
    <artifactId>my.artifact</artifactId>
    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.5.1</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring</artifactId>
            <version>2.5.6.SEC01</version>
        </dependency>
    </dependencies>
</project>

感谢您的帮助。

【问题讨论】:

  • 不要只说致命错误,请发布实际的错误消息。

标签: maven-2


【解决方案1】:

您的项目地址结构中缺少一个强制标记groupId:artifactId:version

在...后面加上一些版本信息(即 1.x.x),然后尝试。

<version>1.0.0</version>

参考:http://maven.apache.org/pom.html

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-07-10
    • 1970-01-01
    • 2016-08-20
    • 2018-08-12
    • 1970-01-01
    • 1970-01-01
    • 2015-06-14
    相关资源
    最近更新 更多