26

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>

Narendra Verma
  • 2,372
  • 6
  • 34
  • 61

6 Answers6

81

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
Martijn Pieters
  • 1,048,767
  • 296
  • 4,058
  • 3,343
Farskeptic
  • 2,910
  • 2
  • 19
  • 15
11

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

UdayKiran Pulipati
  • 6,579
  • 7
  • 67
  • 92
  • How can you prevent eclipse adding so much bullshit to the .classpath? The added attributes are useless in every single case I remember. – BlackEye Jun 12 '15 at 19:30
4

1- Click alt + F5

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

3- OK.

Ad Infinitum
  • 3,560
  • 27
  • 33
1

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".
Mayank
  • 981
  • 7
  • 9
0

Take a backup of project. 1-Delete the project from workspace. 2-import the project. 3-mvn clean install

It works fine in STS .

0

If you are working with a Maven Project, try:

  1. right click in the project.
  2. "Configure"
  3. "Convert to Maven Project"

The project will convert to Maven project and will compile all libs Java and Maven