Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change java version and web version on org.eclipse.wst.common.project.facet.core.xml under .settings dir of eclipse project

I want to modify org.eclipse.wst.common.project.facet.core.xml under .settings

<?xml version="1.0" encoding="UTF-8"?>
    <faceted-project>
    <fixed facet="wst.jsdt.web"/>
    <installed facet="java" version="1.5"/>
    <installed facet="jst.web" version="2.3"/>
    <installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>

I would like to change the above java version to 1.6 and web to 3.0; I could change it manually by opening in a notepad, but, after that from eclipse (kepler) if I try to update from Maven -> update project, it says error "Cannot change version of project facet Dynamic Web Module to 2.3."

How can I make maven to know that I want to create web app with version 3.0 and specified java version.

I'm creating maven project (archetype as webapp).

like image 742
Coder Avatar asked Oct 09 '13 20:10

Coder


People also ask

What is Java project facet in Eclipse?

Facets define characteristics and requirements for Java™ EE projects and are used as part of the runtime configuration.


1 Answers

Modified web.xml to have below:

<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_0.xsd" version="3.0">
   <display-name>Archetype Created Web Application</display-name>
</web-app>

and add following plugins as maven 3 wants to have compiler

<plugins>
    <plugin>
        <artifactId>maven-compiler-plugin</artifactId>
        <version>3.1</version>
        <configuration>
            <source>1.6</source>
            <target>1.6</target>
        </configuration>
    </plugin>
</plugins>
like image 113
Coder Avatar answered Nov 04 '22 14:11

Coder