Friday, 27 September 2013

Maven archetype generation

Maven archetype generation

I use mvn archetype:create-from-project commant and I do not know hove to
castomize my archetype, for example I have next prop xml file:
<?xml version="1.0" encoding="utf-8"?>
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd
http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd"
version="2.0">
<portlet>
<portlet-name>MyPortletName</portlet-name>
<portlet-class>org.springframework.web.portlet.DispatcherPortlet</portlet-class>
<init-param>
<name>contextConfigLocation</name>
<value>/WEB-INF/context/portlet-context.xml</value>
</init-param>
<supports>
<mime-type>text/html</mime-type>
<portlet-mode>view</portlet-mode>
</supports>
<portlet-info>
<title>My portlet</title>
</portlet-info>
</portlet>
</portlet-app>
And I want pass portlet name and title as parametrs when generate
arcetype, and some lines in xml will changed to this, for example:
...
<portlet-name>${portletName}</portlet-name>
....
<portlet-info>
<title>${portletTitle}</title>
</portlet-info>
So want full castomized template, it is possible?

No comments:

Post a Comment