Question

I have a multi-module project and I want to deploy on the project's site an HTML version of my source code using the JXR maven plugin.

The problem is that the JXR plugin runs well, the XREF folder is properly generated for each of my module, but when I use the mvn site:stage command in order to retrieve all the project's site content and to have all link properly generated it does not retrieve the XREF folders.

Here is an extract of my POM file where the JXR plugin is configured:

<plugin>
   <groupId>org.codehaus.mojo</groupId>
   <artifactId>jxr-maven-plugin</artifactId>
   <configuration>
      <aggregate>true</aggregate>
   </configuration>
</plugin>

Here is the command I use to create and stage my site:

mvn site site:stage

Do you guys have any idea?

Thanks in advance.

r.

Was it helpful?

Solution

Not sure this is relevant, but your command is running the site twice, mvn site will generate the site, and site:stage will also run the site, perhaps this is causing problems but I honestly can't see why.

Looking at the JXR documentation, it only mentions the site:site goal, I can't see why it wouldn't be run properly for the site:stage goal as it extends it. If you run the site goal, then copy the output to another directory, run the site:stage goal and compare the output it might give some insight into the problem.

Update: I tried this myself and the xref was included and aggregated nicely in c:\test\stage with the cross references correctly managed. I've included the configuration I used.

In my parent pom I defined the site configuration like this:

<build>
  <plugins>
    <plugin>
      <artifactId>maven-site-plugin</artifactId>
      <executions>
        <execution>
          <phase>prepare-package</phase>
          <goals>
            <goal>stage</goal>
          </goals>
        </execution>
      </executions>
      <configuration>
        <stagingDirectory>c:\test\stage</stagingDirectory>
      </configuration>
    </plugin>
  </plugins>
</build>

The distributionManagement section was configured with the site information (not really needed as I set the stagingDirectory above, but the goal won't run without it).

<distributionManagement>  
  <site>
    <id>mojo.website</id>
    <name>Mojo Website</name>
    <url>scp://test/</url>
  </site>
</distributionManagement>

My JXR configuration in the parent pom was as follows:

<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jxr-plugin</artifactId>
  <reportSets>
    <reportSet>
      <id>src-xref</id>
      <reports>
        <report>jxr</report>
      </reports>
    </reportSet>
    <reportSet>
      <id>test-xref</id>
      <reports>
        <report>test-jxr</report>
      </reports>
    </reportSet>
  </reportSets>
  <configuration>
    <aggregate>true</aggregate>
  </configuration>
</plugin>

The commandline run was mvn clean site:stage

Edit: Per the comments, there is a codehaus jxr plugin with slightly different semantics. Be sure to use the org.apache.maven.plugins version rather than the org.codehaus.mojo version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top