IntelliJ IDEA Custom Project Template Replacing XML Values ​​in a New Project

I save the existing project as a template, but when I open a new project using this template, it replaces some xml values ​​with unpopular parameters.

This is from the original XML (path = src / main / WEB-INF / web.xml ):

<web-app version="2.5" 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_2_5.xsd">

After I use the template to create a new project, the same file will look like this:

<web-app version="${WEB_XML_VERSION}" xmlns="http://java.sun.com/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:shttp://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_${WEB_XML_VERSION_FILE}.xsdweb-app_2_5.xsd">

This parameter is not the default parameter supported by IntelliJ, and it is even incorrectly inserted into the string (for example, ${WEB_XML_VERSION_FILE}.xsdweb-app_2_5.xsd)

Is there a way to prevent such a replacement while saving project templates?

+4

Source: https://habr.com/ru/post/1676274/


All Articles