命名用Maven Archetype生成的项目的根目录 [英] Name the root directory of project generated with Maven Archetype

查看:72
本文介绍了命名用Maven Archetype生成的项目的根目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何控制我的maven原型创建的maven模块顶层目录的名称?目前它创建了一个名为$artifactId 的新文件夹.或者更直接,有没有办法让我的原型可以创建一个以模块的 artifactId 命名的文件夹,但用下划线代替破折号?

How can I control the name of the top directory of the maven module created by my maven archetype? Currently it creates a new folder named$artifactId. Or even more directly, is there a way that my archetype can create a folder named after the module's artifactId, but with dashes replaced by underscores?

推荐答案

artifactId 的命名约定是使用破折号(连字符).我认为没有任何方法可以使模块的目录命名为 artifactId 以外的名称.话虽如此,您的模块与您的 artifactId 的名称相同是唯一的约定,而不是要求.这意味着在您的项目生成后,您可以简单地将 artifactId 或模块文件夹名称或两者都更改为您想要的任何名称.

The naming convention for artifactId's is to use dashes (hyphens). I don't think there is any way to make the module's directory named something other than the artifactId. That being said, it is onlvy convention, not a requirement, that your module be named the same as your artifactId. This means that after your project is generated, you could simply change either the artifactId or module folder name or both to whatever you want.

这篇关于命名用Maven Archetype生成的项目的根目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆