在Maven原型中将src / main / webapp放在哪里并声明?

时间:2018-07-31 13:49:04

标签: maven java-ee maven-archetype

我将index.xhtml之类的Web应用程序文件放置在src/main/resources/archetype-resources/src/main/webapp中,并尝试在src/main/resources/META-INF/maven/archetype.xml中声明它们,但是只有

<sources> = src/main/java
<resources> = src/main/resources
<testSources> = src/test/java
<testResources> = src/test/resources
<siteResources> = src/site

根据getting started guide

问题是该指南包含一个警告,指出它引用了Archetype模型版本1.0,并引用了an issue report to adjust the guide to 2.0,两年来都没有取得进展。我无法估计1.0模型的过时程度以及该解决方案是否可能仅适用于2.x模型-以及如何获得它,因为没有指南,我也不想猜测如何使用它关于源代码和无用的两个字的XML属性文档注释。也许Maven原型已经过时了(关于文档重要部分如此糟糕的维护的唯一很好的解释)?

添加

<sources>
    <source>src/main/webapp/index.xhtml</source>
</sources>

archetype.xml导致mvn archetype:generate由于Failed to execute goal org.apache.maven.plugins:maven-archetype-plugin:3.0.1:generate (default-cli) on project standalone-pom: Template 'src/main/webapp/index.xhtml' not in directory 'src/main/java'而失败。

0 个答案:

没有答案