0

I'm having configuration problem with Maven in Eclipse. The Marker tab keeps showing the following message:

x- Cannot change version of project facet Dynamic Web Module to 2.3.
x- One or more constraints have not been satisfied.

I did follow the Old Topics1, Old Topics2 and tried to solve problem by changing the version of Dynamic Web Module myproject > properties > Project facets > Dynamic Web Module. First I tried to change the version but Eclipse did not allowed me to do it.

Secondly, I dd try to change my web.xml file and saved but it did not work either.

Here is my web.xml file;

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>

This is how my pom.xml looks like;

<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>
<groupId>net.eMy</groupId>
<artifactId>shopping</artifactId>
<packaging>war</packaging>
<version>0.0.1-SNAPSHOT</version>
<name>shopping Maven Webapp</name>
<url>http://maven.apache.org</url>

<properties>
    <javaee.version>8.0</javaee.version>
</properties>


<dependencies>

    <!-- JAVA EE API -->
    <!-- https://mvnrepository.com/artifact/javax/javaee-api -->
    <dependency>
        <groupId>javax</groupId>
        <artifactId>javaee-api</artifactId>
        <version>${javaee.version}</version>
        <scope>provided</scope>
    </dependency>


    <!-- jUnit -->
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>3.8.1</version>
        <scope>test</scope>
    </dependency>
</dependencies>
<build>
    <plugins>

        <!-- Updating latest version of JAVA -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.1</version>
            <configuration>
                <source>1.8</source>
                <target>1.8</target>
            </configuration>
        </plugin>
    </plugins>

    <finalName>shopping</finalName>
</build>
</project>

Can anybody suggest any other solutions? All help will be appreciated. Thank you.

1 Answers1

0

Ok guys, I did different ways to solve it and this solution did work.

My web.xml was;

<!DOCTYPE web-app PUBLIC
 "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
"http://java.sun.com/dtd/web-app_2_3.dtd" >

<web-app>
<display-name>Archetype Created Web Application</display-name>
</web-app>

and I changed it to;

<web-app xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
                    http://java.sun.com/xml/ns/javaee/web-app_3_1.xsd"
                    version="3.1">
<display-name>Archetype Created Web Application</display-name>

</web-app>

After changing it, i did save and myproject > maven > update project.

But pay attention to versions. It must be the same version as in pom.xml and Dynamic Web Module myproject > properties > Project facets > Dynamic Web Module. So for me, all of them are 3.1.

If anyone having a same issue, I hope this will be helpful. Good evening.