6

我有一个要为其部署站点的多模块项目,但似乎我的站点部署配置没有被子项目子模块继承。

  • 父母
    • 模块A
    • 模块B

在文件系统上,它们彼此相对:

/parent/
/moduleA/
/moduleB/

当我运行时:

mvn site-deploy -P documentation

我的父项目已正确部署到:

  • scp://devServer/documentation/webwars/

但是如果子模块继承父distributionManagement,则没有像moduleA或moduleB这样的子项目部署在那里:

  • scp://devServer/documentation/webwars/moduleA
  • scp://devServer/documentation/webwars/moduleB

这是我的父 pom.xml,我删除了一些无关的细节和报告插件(我包括我的 javadoc 插件,它使用 APIViz 和聚合有点时髦,以确保聚合父 javadocs 和子 javadocs 正确使用 APIViz。):

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 
                      http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.webwars</groupId>
    <artifactId> parent</artifactId>
    <packaging>pom</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>parent</name>
    <distributionManagement>
        <site>
            <id>webwarsDev.website</id>
            <url>scp://devServer/documentation/webwars/</url>
        </site>         
    </distributionManagement>
    <modules>
        <module>../moduleA</module>
        <module>../moduleB</module>
    </modules>
    <profiles>
        <profile>
            <id>documentation</id>
            <build>
                <pluginManagement>
                    <plugins>
                        <plugin>
                            <groupId>org.apache.maven.plugins</groupId>
                            <artifactId>maven-pmd-plugin</artifactId>
                            <executions>
                                <execution>
                                    <id>verify_pmd</id>
                                    <phase>verify</phase>
                                    <goals>
                                        <goal>pmd</goal>
                                    </goals>
                                    <configuration>
                                        <linkXref>true</linkXref>
                                        <minimumTokens>20</minimumTokens>
                                        <targetJdk>1.6</targetJdk>
                                    </configuration>
                                </execution>
                            </executions>
                        </plugin>                        

                    </plugins>
                </pluginManagement>
            </build>
            <reporting>
                <plugins>
                  <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-project-info-reports-plugin</artifactId>
                    <version>2.1.2</version>
                    <reportSets>
                      <reportSet>
                        <reports>
                          <report>project-team</report>
                          <report>cim</report>
                          <report>scm</report>
                        </reports>
                      </reportSet>
                    </reportSets>
                  </plugin>

                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-javadoc-plugin</artifactId>
                        <version>2.6.1</version>
                        <configuration>
                            <!-- Default configuration for all reports -->
                            <detectOfflineLinks>true</detectOfflineLinks>
                            <!--
                                <detectLinks>true</detectLinks>
                            -->
                            <detectJavaApiLink>true</detectJavaApiLink>
                            <linksource>true</linksource>
                            <useStandardDocletOptions>true</useStandardDocletOptions>
                            <charset>UTF-8</charset>
                            <encoding>UTF-8</encoding>
                            <docencoding>UTF-8</docencoding>
                            <breakiterator>true</breakiterator>
                            <version>true</version>
                            <author>true</author>
                            <keywords>true</keywords>
                            <minmemory>128m</minmemory>
                            <maxmemory>512m</maxmemory>
                         <doclet>org.jboss.apiviz.APIviz</doclet>
                                    <docletArtifact>
                                        <groupId>org.jboss.apiviz</groupId>
                                        <artifactId>apiviz</artifactId>
                                        <version>1.3.0.GA</version>
                                    </docletArtifact>
                                    <additionalparam> 
                                    -charset UTF-8
                                    -docencoding UTF-8 
                                    -version 
                                    -author
                                    -breakiterator 
                                    -linksource 
                                    -sourcetab 4
                                    -windowtitle "${project.name} ${project.version} API Reference"
                                    -doctitle "${project.name} ${project.version} API Reference"
                                    -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved." 
                                    -link    http://java.sun.com/javase/6/docs/api/

                                    </additionalparam>                             
                        </configuration>
                        <reportSets>
                            <reportSet>
                                <id>non-aggregate</id>
                                <configuration>
                                    <!-- Specific configuration for the non aggregate report -->
                                    <doclet>org.jboss.apiviz.APIviz</doclet>
                                    <docletArtifact>
                                        <groupId>org.jboss.apiviz</groupId>
                                        <artifactId>apiviz</artifactId>
                                        <version>1.3.0.GA</version>
                                    </docletArtifact>
                                    <additionalparam> 
                                    -charset UTF-8
                                    -docencoding UTF-8 
                                    -version 
                                    -author
                                    -breakiterator 
                                    -linksource 
                                    -sourcetab 4
                                    -windowtitle "${project.name} ${project.version} API Reference"
                                    -doctitle "${project.name} ${project.version} API Reference"
                                    -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved." 
                                    -link    http://java.sun.com/javase/6/docs/api/
                                    -sourceclasspath ${project.build.outputDirectory} 
                                    </additionalparam>              
                                </configuration>
                            <reports>
                                <report>javadoc</report>
                            </reports>
                          </reportSet>
                          <reportSet>
                            <id>aggregate</id>
                            <configuration>
                              <!-- Specific configuration for the aggregate report -->
                                  <doclet>org.jboss.apiviz.APIviz</doclet>
                                    <docletArtifact>
                                        <groupId>org.jboss.apiviz</groupId>
                                        <artifactId>apiviz</artifactId>
                                        <version>1.3.0.GA</version>
                                    </docletArtifact>
                                    <additionalparam> 
                                    -charset UTF-8
                                    -docencoding UTF-8 
                                    -version 
                                    -author
                                    -breakiterator 
                                    -linksource 
                                    -sourcetab 4
                                    -windowtitle "${project.name} ${project.version} API Reference"
                                    -doctitle "${project.name} ${project.version} API Reference"
                                    -bottom "Copyright © ${project.inceptionYear}-Present ${project.organization.name}. All Rights Reserved." 
                                    -link    http://java.sun.com/javase/6/docs/api/

                                    </additionalparam>                                
                            </configuration>
                            <reports>
                              <report>aggregate</report>
                            </reports>
                          </reportSet>
                        </reportSets>
                    </plugin>
                    <plugin>
                        <groupId>org.apache.maven.plugins</groupId>
                        <artifactId>maven-jxr-plugin</artifactId>
                        <configuration>
                            <linkJavadoc>true</linkJavadoc>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>cobertura-maven-plugin</artifactId>
                        <configuration>
                            <formats>
                                <format>xml</format>
                                <format>html</format>
                            </formats>
                        </configuration>
                    </plugin>
                    <plugin>
                        <groupId>org.codehaus.mojo</groupId>
                        <artifactId>findbugs-maven-plugin</artifactId>
                        <version>2.1</version>
                    </plugin>
                </plugins>
            </reporting>
        </profile>
    </profiles>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>                
            </plugins>
        </pluginManagement>
    </build>
</project>

我已经尝试在每个子项目模块中定义显式分布管理,除了由于某种原因子项目站点没有 index.html 之外,这些模块可以正确部署?

我没有任何 src/site/ 文件,例如 src/site/site.xml 或 src/site/apt/index.apt。

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>com.webwars</groupId>
        <artifactId>parent</artifactId>
        <version>1.0-SNAPSHOT</version>
        <relativePath>../parent</relativePath>
    </parent>
    <groupId>com.webwars</groupId>
    <artifactId>moduleA</artifactId>
    <packaging>jar</packaging>
    <version>1.0-SNAPSHOT</version>
    <name>moduleA</name>
    <distributionManagement>
        <site>
            <id>webwarsDev.website</id>
            <url>scp://devServer/documentation/webwars/moduleA</url> 
        </site>
    </distributionManagement>
4

1 回答 1

1

我可能错了,但我认为您需要配置maven-project-info-reports-plugin以生成“索引”报告,目前并非如此(您已将其配置为生成 project-team、cim 和 scm仅报告)。您需要添加索引报告:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-project-info-reports-plugin</artifactId>
  <version>2.1.2</version>
  <reportSets>
    <reportSet>
      <reports>
        <report>index</report>
        <report>project-team</report>
        <report>cim</report>
        <report>scm</report>
      </reports>
    </reportSet>
  </reportSets>
</plugin>
于 2009-11-12T11:52:53.787 回答