Project templates - attributes for place holders
Am working on adding achive based project templates to my idea plugin.
Currently this is the content of my project-template.xml inside .idea directory of my project template.
---------------------------------------------------------------------------------------------------
<template>
<input-field default="com.ctap">IJ_BASE_PACKAGE</input-field>
</template>
---------------------------------------------------------------------------------------------------
$IJ_BASE_PACKAGE value I can use inside .java, .properties, .xml files as a place holder and corresponding value will be written to resource files, when a new project is created.
Ex:
This is a view of my web.xml inside my project template.
--------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
Similarly what is the place holder I should use to access the "project name" ?
Is there a catalog where I can find all available attribute names, and is there a way to define them. ?
$IJ_BASE_PACKAGE value I can use inside .java, .properties, .xml files as a place holder and corresponding value will be written to resource files, when a new project is created.
Ex:
This is a view of my web.xml inside my project template.
--------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="ISO-8859-1"?>
<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
version="2.4">
<display-name>Archetype Created Web Application</display-name>
<servlet>
<servlet-name>moReceiver</servlet-name>
<servlet-class>hms.kite.samples.api.sms.MoSmsReceiver</servlet-class>
<init-param>
<param-name>smsReceiver</param-name>
<param-value>${IJ_BASE_PACKAGE}.sms.SmsService</param-value>
</init-param>
</servlet>
<servlet-mapping>
<servlet-name>moReceiver</servlet-name>
<url-pattern>/mo-receiver</url-pattern>
</servlet-mapping>
</web-app>
--------------------------------------------------------------------------------------------------
Similarly what is the place holder I should use to access the "project name" ?
Is there a catalog where I can find all available attribute names, and is there a way to define them. ?
请先登录再写评论。
Just went thourgh the IDEA community source code and figure out the answer to my question.
I can use - ${IJ_PROJECT_NAME} attribute