开发者

What are some Maven project naming conventions for web application module?

When creating a project with the webapp archetype in Maven, they subtly advise not putting any Java source in the webapp project by not including the "src/main/java" folder.

What do you name your Maven projects?

project-webapp for the project that contains the JSP, CSS, Images, etc.

project for the project that contains domain specific entities

开发者_如何学JAVA? for the project that contains the web application files like Servlets, Listeners, etc.

My first inclination would be to use "webapp" for the project containing the web application files (Servlets/Listeners), however the archetype uses "webapp" to convey the JSP/CSS/Images project and would cause confusion to other developers.


When creating a project with the webapp archetype in Maven, they subtly advise not putting any Java source in the webapp project by not including the "src/main/java" folder.

That's not really true. When you create a project with the maven-archetype-quickstart, you don't get a src/main/resources directory. Would that mean you should not put resources in this project? No.

What do you name your Maven projects?

There is no general rules, nor conventions. Use something that makes sense for your organization and your team. But as I said above, your initial assumption is not true and putting Java code inside a maven war module is a common practice (except for code you want to share between modules).


Not sure if this below link directly answers your question, but it makes sense to refer it

Refer their JIRA task here Document the naming convention for archetypes

As per this, the naming convention can be as below

The Artifact id of the archetype should be of the format -archetype-

Ex: + maven-archetype-quickstart : Which indicates the archetype is from maven and the project is a quick start

Same way you scala-archetype-simple : Which indicates it is from scala and is a simple scala project

Best of luck

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜