Maven原型:生成目录

时间:2012-08-27 16:57:27

标签: java maven maven-archetype

我正在尝试让我的maven原型根据来自package和artifactId之类的用户输入生成目录结构。

这个想法是,我有一个类模板:

package ${package}.endpoints.${rootArtifactId};

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;

/** Example resource class hosted at the URI path "/myresource"
*/
@Path("/echo")
public class Echo {

/** Method processing HTTP GET requests, producing "text/plain" MIME media
 * type.
 * @return String that will be send back as a response of type "text/plain".
 */
@GET 
@Produces("text/plain")
public String say() {
    return "Hi there!";
 }
}

使用字符串替换正在生成包,但是我希望此文件的输出文件夹也是/ $ package / endpoints / $ artifactId

我找不到办法。例如,我可以使用__artifactId __- context.xml替换单个文件。但我不知道如何强制maven为速度模板文件创建子文件夹。

有什么想法吗?

0 个答案:

没有答案