简体   繁体   English

maven通过mvn网站引用多个模块

[英]maven multiple modules reference through mvn site

This is the structure of my project: 这是我的项目的结构:

aokshop
    -- aokshop-core
    -- aokshop-admin
    -- aokshop-service
    -- pom.xml

And then I run with command: mvn site 然后我用命令运行: mvn site

It generate a "site" folder in parent aokshop and every children modules, then I open the "index.html" file in aokshop, it likes that: 它在父aokshop和每个子模块中生成一个“站点”文件夹,然后在aokshop中打开“ index.html”文件,它就像这样: 在此处输入图片说明

It lists all the modules. 它列出了所有模块。 But I can't open the children modules, 但是我无法打开子模块

file:///G:/workspace/aokshop/target/site/aokshop-admin/index.html

It can't find, I have used the maven-jxr-plugin and config it like: 找不到,我已经使用过maven-jxr-plugin并将其配置为:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jxr-plugin</artifactId>
  <version>2.4</version>
  <reportSets>
    <reportSet>
      <id>aggregate</id>
      <reports>
        <report>aggregate</report>
        <report>test-aggregate</report>
      </reports>
    </reportSet>
  </reportSets>
</plugin>

So can I do that I can reference the children modules in parent "index.html". 因此,我可以在父“ index.html”中引用子模块吗?

An excerpt from the docs : 摘录自文档

Note that links between module sites in a multi module build will not work, since local build directory structure doesn't match deployed site. 请注意,多模块构建中模块站点之间的链接将不起作用,因为本地构建目录结构与部署的站点不匹配。

This means you need to do a staging to check you links and the whole layout etc. This can be achieved by using the stage goal . 这意味着您需要分阶段检查链接和整个布局等。这可以通过使用stage目标来实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM