19

First of all, I'm using Ubuntu 12.04, Eclipse Juno with embebbed maven 3.0.4 (m2eclipse) and I have to work in a legacy project which I got from a SVN repositroy.

I'm stuck in a sort of configuration problem with Maven and Eclipse.

At the first time I did a Maven > Update project and I got an "Unknown Error" of "Maven Java EE Configuration Problem" type. I checked my project's properties and I've realized that java compliance level is set to 1.5 but I have 1.6 JRE activated. Well, I've changed to 1.6 version (in Java Facet too), but when I do a Maven > Update project, my project's properties are restored to default (a.k.a. 1.5 version), and the Unknown error persists.

My pom.xml file seems to be ok, and I also try to update project with an empty pom.xml (just with modelVersion, groupId, artifactId, version, name and url tags) and I always get the same error.

I'm really stuck. Someone has a clue?

4

1 回答 1

36

尝试在 pom.xml 中指定 JDK 版本:

  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-compiler-plugin</artifactId>
        <configuration>
          <source>1.6</source>
          <target>1.6</target>
        </configuration>
      </plugin>
    </plugins>
  </build>

然后执行“更新项目配置”

于 2012-11-06T18:16:36.430 回答