maven-site-plugin:< body>标签没有被继承 [英] maven-site-plugin: <body> tag is not being inherited
问题描述
如果我对父母做mvn site:effective-site
,我会得到:
If I do an mvn site:effective-site
on my parent I get this:
<project>
<bannerLeft>
<name>xxx :: Open Source Parent POM</name>
</bannerLeft>
<publishDate />
<version />
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.5</version>
</skin>
<body>
<menu ref="parent" />
<menu ref="reports" />
</body>
</project>
但是,如果我在一个子项目上这样做,我会得到:
However, if I do it on a child project I get this:
<project>
<bannerLeft>
<name>xxx :: Parent</name>
</bannerLeft>
<publishDate />
<version />
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.5</version>
</skin>
<body />
</project>
这是我的site_en.xml,它与父pom在同一项目中
Here's my site_en.xml thats in the same project as the parent pom
<project>
<body>
<menu ref="parent" />
<menu ref="modules" />
<menu ref="reports" />
</body>
<skin>
<groupId>org.apache.maven.skins</groupId>
<artifactId>maven-fluido-skin</artifactId>
<version>1.5</version>
</skin>
</project>
这是该项目的pom结构
Here's my pom structure for that project
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>org.myorg</groupId>
<artifactId>oss-parent</artifactId>
<packaging>pom</packaging>
<version>6-SNAPSHOT</version>
...
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.5.1</version>
</plugin>
</plugins>
</pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<configuration>
<attach>true</attach>
</configuration>
</plugin>
</plugins>
</build>
这是不继承主体的子项目pom:
Here's the subproject pom that's not inheriting the body:
<project>
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.myorg</groupId>
<artifactId>oss-parent</artifactId>
<version>6-SNAPSHOT</version>
</parent>
...
<artifactId>my-project</artifactId>
...
</project>
有什么作用?当然,我并不是唯一一个需要整个企业使用网站模板的人!
What gives? Surely I'm not the only one that needs a site template for their whole enterprise!
推荐答案
<body>
<menu ref="parent" inherit="bottom"/>
<menu ref="reports" inherit="bottom"/>
<menu ref="modules" inherit="bottom"/>
</body>
如果在父pom的site.xml中进行了设置,这将有所帮助.显然,至少在站点插件v.3.7中,显式继承设置是必需的.
This helped, if set in parent pom's site.xml. Explicit inheritance settings are apparently required, at least in site plugin v.3.7.
这篇关于maven-site-plugin:< body>标签没有被继承的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!