Why Maven changes Eclipse project preferences?

10,925

Try specifying JDK version in pom.xml:

  <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>

and then do 'Update Project Configuration'

Share:
10,925
ilazgo
Author by

ilazgo

Computer Engineer working as software developer.

Updated on June 03, 2022

Comments

  • ilazgo
    ilazgo about 2 years

    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?

  • ilazgo
    ilazgo over 11 years
    Ok, I was missing the source label. This trick solves Java Compiler version issues. But "Unknown Error" of "Maven Java EE Configuration Problem" type persists. How I can know where is the error?
  • ilazgo
    ilazgo over 11 years
    Well, I almost lost an entire day but I finally solve my problems. Solution? Easy: @maximdim 's response and deleting .settings folder from the legacy project.
  • Numan Karaaslan
    Numan Karaaslan over 3 years
    I have spent 2 hours for this annoying issue in the year 2021. Thanks.