我刚开始使用maven并有疑问。 我的pom.xml包含标签“developer”以及团队的完整详细信息。如何在项目网站上显示此列表?我知道如何将菜单项添加到site.xml。但这个项目应该在哪里引用?
我发现Jakarata中只有一个项目可以做到:maven本身。他们在pom中有标签开发人员,并在现场链接“The Maven Team”。此链接指的是team-list.html。我已经下载了完整的maven源并运行了“mvn site”但是这个文件没有在我的环境中生成,并且对文件进行greting也没有帮助。
有谁知道怎么做?
答案 0 :(得分:4)
mvn site
命令应该有效,你的POM应该如下所示:
...
<!-- List the core committers -->
<developers>
<developer>
<id>karianna</id>
<name>Martijn Verburg</name>
<organization>Ikasan</organization>
<organizationUrl>http://www.ikasan.org</organizationUrl>
<roles>
<role>developer</role>
</roles>
<timezone>0</timezone>
</developer>
...
</developers>
<!-- Contributors -->
<contributors>
<contributor>
<name>Cae Fernandes</name>
<roles>
<role>developer</role>
</roles>
<timezone>-3</timezone>
</contributor>
...
</contributors>
...
答案 1 :(得分:2)
我不确定情况总是如此,但似乎项目小组报告(team-list.html
)默认情况下会在mvn site
期间生成并在项目信息。我刚刚在一个示例项目上测试了它,它确实按预期工作。
如果没有,可以尝试明确配置maven-project-info-reports-plugin
以生成报告。
<project>
...
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-project-info-reports-plugin</artifactId>
<version>2.2</version>
<reportSets>
<reportSet>
<reports>
<report>index</report>
<report>project-team</report>
...
</reports>
</reportSet>
</reportSets>
</plugin>
...
</plugins>
</reporting>
...
</project>
您使用的是特定版本的maven网站插件吗?什么版本的Maven呢?