1
resposta

Erro: Type Cannot change version of project facet Dynamic Web Module to 3.1. lojaweb

Oi pessoal, Por favor, apesar de funcionar, continuo com um erro no projeto, sabem como posso resolver?

Erro: Cannot change version of project facet Dynamic Web Module to 3.1.

web.xml:

pom.xml:

4.0.0

<groupId>br.com.maven</groupId>
<artifactId>lojaweb</artifactId>
<version>1.0.0-SNAPSHOT</version>
<packaging>war</packaging>

<name>lojaweb Maven Webapp</name>
<!-- FIXME change it to the project's website -->
<url>http://www.example.com</url>

<properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <maven.compiler.source>1.7</maven.compiler.source>
    <maven.compiler.target>1.7</maven.compiler.target>
</properties>

<dependencies>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.11</version>
        <scope>test</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/javax.servlet/javax.servlet-api -->
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>javax.servlet-api</artifactId>
        <version>4.0.1</version>
        <scope>provided</scope>
    </dependency>
    <!-- https://mvnrepository.com/artifact/br.com.caelum.stella/caelum-stella-core -->
    <dependency>
        <groupId>br.com.caelum.stella</groupId>
        <artifactId>caelum-stella-core</artifactId>
        <version>2.1.3</version>
    </dependency>
</dependencies>

<build>
    <finalName>lojaweb</finalName>
    <pluginManagement><!-- lock down plugins versions to avoid using Maven 
            defaults (may be moved to parent pom) -->
        <plugins>
            <plugin>
                <groupId>org.eclipse.jetty</groupId>
                <artifactId>jetty-maven-plugin</artifactId>
                <version>9.4.28.v20200408</version>
                <configuration>
                    <scanIntervalSeconds>10</scanIntervalSeconds>
                    <webApp>
                        <contextPath>/loja</contextPath>
                    </webApp>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
1 resposta

No eclipse, clique com o botão direito no projeto,

Clique em Properties,

Clique em Project Facets,

Altere o valor para 3.1 no Dynamic Web Module, conforme mencionado na imagem abaixo.