[英]maven-site-plugin: <body> tag is not being inherited
If I do an mvn site:effective-site
on my parent I get this: 如果我在父母上做一个
mvn site:effective-site
,我会得到:
<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>
Here's my site_en.xml thats in the same project as the parent pom 这是我的site_en.xml,即与父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>
Here's my pom structure for that project 这是该项目的pom结构
<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>
Here's the subproject pom that's not inheriting the body: 这是不继承主体的子项目pom:
<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>
This helped, if set in parent pom's site.xml. 如果在父pom的site.xml中进行设置,则将有帮助。 Explicit inheritance settings are apparently required, at least in site plugin v.3.7.
显然,至少在站点插件v.3.7中,显式继承设置是必需的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.