Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Blue, Maven: Project configuration is not up-to-date with pom.xml

Tags:

I am using Eclipse Blue 10 & Maven 3 in my development environment.

I generally import maven projects from SVN by following below path:

File > Import> SVN > Checkout Projects from SVN 

Then import all maven projects:

Right click on imported project > Maven4MyEclipse> Existing Maven Projects

I have a maven module called 'project-ear' and this module is to bind all my web applications into one ear.

But whenever I import EAR module as eclipse project, eclipse prompts below error in 'Problems' tab:

Project configuration is not up-to-date with pom.xml. Run project configuration update.

How to resolve this issue? I don't see any way to "Run project configuration update".

Please help.

Pom.xml for EAR module:

<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>
<parent>
    <groupId>com.company.xxx</groupId>
    <artifactId>my</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>
<groupId>com.company.xxx.ear</groupId>
<artifactId>my-ear</artifactId>
<packaging>ear</packaging>
<name>my-ear</name>

<build>
    <finalName>web-app</finalName>
    <plugins>
        <plugin>
            <artifactId>maven-ear-plugin</artifactId>
            <version>2.5</version>
            <configuration>
                <modules>
                    <webModule>
                        <groupId>com.company.xxx.myweb</groupId>
                        <artifactId>my-web</artifactId>
                        <contextRoot>/txcs</contextRoot>
                    </webModule>                        
                </modules>
                <generateApplicationXml>true</generateApplicationXml>
                <displayName>web-app</displayName>
            </configuration>
        </plugin>
    </plugins>
</build>
<dependencies>
    <dependency>
        <groupId>com.company.xxx.myweb</groupId>
        <artifactId>my-web</artifactId>
        <type>war</type>
        <version>${project.version}</version>
    </dependency>       
</dependencies>

like image 855
Narendra Verma Avatar asked Jul 02 '13 06:07

Narendra Verma


4 Answers

To confirm what André Stannek originally mentioned in the comments on the question, the following works to update your project:

  1. Go to package explorer
  2. Right-click the project
  3. Select Maven\Update Project
like image 51
Farskeptic Avatar answered Oct 13 '22 11:10

Farskeptic


I got this problem when I upgrade Java from JRE System Library [JavaSE 1.6] to JRE System Library [JavaSE 1.7].

After did like this the following error is displayed in Problems view Project configuration is not up-to-date with pom.xml. Run project configuration update.

I changed the configuration of compiler in pom.xml, Previously the value of source and target value is 1.6, I changed it to 1.7

<build>
    <plugins>
        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <source>1.7</source>
                <target>1.7</target>
            </configuration>
        </plugin>
    </plugins>
</build>

For get rid of this problem simply follow the below process.

SOLUTION: Right click on the project -> Maven4MyEclipse -> Update Project Configuration...

The below image shown you how to do in MyEclipse IDE.

Upgrade configuration of compiler in pom.xml

or

SOLUTION: Right click on the error in Problems view -> click on Quick Fix

The below image shown you how to do in Eclipse IDE

Problems view in Eclipse

like image 28
UdayKiran Pulipati Avatar answered Oct 13 '22 11:10

UdayKiran Pulipati


1- Click alt + F5

2- Update Maven Project screen will come up. Here, click add out-of-date

3- OK.

like image 31
Ad Infinitum Avatar answered Oct 13 '22 11:10

Ad Infinitum


The following steps worked for me:

  1. Close the project in Eclipse.
  2. Delete the project in Eclipse ( but not the contents ).
  3. Navigate to the project in file system and delete .classpath and .project files.
  4. Go back to Eclipse and import the project as "existing maven project".
like image 36
Mayank Avatar answered Oct 13 '22 12:10

Mayank