views:

548

answers:

1

Hi,

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.

+3  A: 

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.

Rich Seller
Actually the site command generates the XREF folder properly. The problem is linked to the stage command which seems unable to retrieve this XREF folder.I tried to remove the site and launch only the site:stage but the problem is the same...
reef
Hi,Thanks for your help.ANyway this does not work with my configuration. This could be linked to the version I use (Maven 2.2.1-RC1).Which version do you use?
reef
I tested this on 2.0.9 and 2.2.0, I've not tried it on 2.2.1
Rich Seller
Ok,Really don'y know why it does not work with my configuration.I also tried with 2.2.0 and still the same pb...
reef
I'm guessing now, but try declaring the exact version of the jxr plugin and using a fresh local repository (change it in your settings.xml), it may be you're using a broken/old version or something similar
Rich Seller
Ok got it!This was indeed linked to the plugin configuration. Actually my configuration was extracted from an article on the Maven 2 site generation usage and the plugin groupId is wrong on this documentation (org.codehaus.mojo instead of org.apache.maven.plugins)...Thanks a lots for your time and your help!!
reef
no problem, I'll add that clarification to the answer
Rich Seller
Glad to see it was solved. Thanks for the answers :-)
KLE