Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why Maven changes Eclipse project preferences?

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?

like image 561
ilazgo Avatar asked Nov 06 '12 17:11

ilazgo


People also ask

What Maven Update project does in Eclipse?

It will make sure that all referenced dependencies are there, as well as clean the project to make sure that they are included correctly. Dependencies go well without any project update though; just update the pom and the dependencies auto-update in the Eclipse project.

Where is project preferences in Eclipse?

open eclipse, then go to Window menu, select Customize perspective... a windows appears. it has for tabs. select Menu visiblity tab, it will shows all menus with tree view.

What is Maven project in Eclipse?

You can Launch Maven builds from within Eclipse. It does the dependency management for Eclipse build path based on Maven's pom. xml. It resolves Maven dependencies from the Eclipse workspace without installing to local Maven repository (requires dependency project be in same workspace).


1 Answers

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'

like image 112
maximdim Avatar answered Nov 10 '22 06:11

maximdim