Hi all,

I am using a flat multi-module layout for my build. Unfortunately, some (but not all!) inter-module links are broken on a "site-deploy".

Here is the simplest case that doesn't work, using the following (flat) directory layout:

parent
  src/site
    site.xml
  pom.xml
child
  src/site
    site.xml
  pom.xml

Here's the parent project's POM:
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.example</groupId>
  <artifactId>parent</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>pom</packaging>
  <name>Parent Project</name>
  <modules>
    <!-- flat multi-module build -->
    <module>../child</module>
  </modules>
  <distributionManagement>
    <site>
      <id>tmp</id>
      <url>file:///tmp/deploy/parent</url>
    </site>
  </distributionManagement>
  <build>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-site-plugin</artifactId>
        <version>2.1</version>
      </plugin>
    </plugins>
  </build>
</project>

And here's the child project's POM:
<project>
  <modelVersion>4.0.0</modelVersion>
  <parent>
    <groupId>org.example</groupId>
    <artifactId>parent</artifactId>
    <version>0.0.1-SNAPSHOT</version>
  </parent>
  <artifactId>child</artifactId>
  <packaging>pom</packaging>
  <name>Child Project</name>
  <distributionManagement>
    <site>
      <id>tmp</id>
      <url>file:///tmp/deploy/child</url>
    </site>
  </distributionManagement>
</project>

Both projects use an identical src/site/site.xml:
<project>
  <body>
    <menu ref="parent"/>
    <menu ref="modules"/>
  </body>
</project>

Now, after a "site-deploy" /tmp/deploy contains two directories side-by-side, as expected per the distributionManagement element in the projects' POMs: /tmp/deploy/parent and /tmp/deploy/child.

But the "Modules" link from the parent project to the child project points to <file:///tmp/deploy/parent/child/index.html>; thus, it is broken. :-(

For some strange reason, however, the "Parent Project" link found in <file:///tmp/deploy/child/index.html> points to the correct page, namely <file:///tmp/deploy/parent/index.html>; not all parts of Maven seem to ignore my request for a flat multi-module layout. There is hope. ;-)

So, hopefully, somebody can shed some light on what is going on and why Maven behaves the way it does.

Best wishes,

Andreas Sewe

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to