Showing posts with label site. Show all posts
Showing posts with label site. Show all posts

28 February 2011

Maven 2.1 site command trouble

The maven site command allows you to generate project documentation, as explained in an earlier post for maven 2.0.

Running  mvn:site with Maven version 2.1, I had some problems however:

  1.  site plugin version error
    SiteToolException: ArtifactNotFoundException: The skin does not exist: Un able to determine the release version
    Apparently the skin plugin does not install automatically with a version, so force the issue, from the command line:
    $ svn checkout http://svn.apache.org/repos/asf/maven/skins/trunk/
    $ cd trunk
    $ mvn install -DupdateReleaseInfo=true
  2. doxia ArrayIndexOutOfBoundsException
    [WARNING] Deprecated API called - not org.apache.maven.doxia.sink.Sink
    instance and no SinkFactory available. Please update this plugin.
    [INFO] ------------------------------------------------------------------------
    [ERROR] FATAL ERROR
    [INFO] ------------------------------------------------------------------------
    [INFO] 1
    [INFO] ------------------------------------------------------------------------
    [DEBUG] Trace
    java.lang.ArrayIndexOutOfBoundsException: 1
            at org.apache.maven.doxia.module.xhtml.XhtmlSink.tableCell(XhtmlSink.java:791) 
    This error is caused by some maven/module version mismatches.
    To solve this second issue, add a <pluginManagement> element under the build element to set compatible versions. <pluginManagement> has a <plugins> child element. Do not confuse this with the <plugins> child of the <buid> element.
    <project>
       ...
       <build>
         <pluginManagement>
             <plugins>
               <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-site-plugin</artifactId>
                 <version>2.1.1</version>
                 <dependencies>
                   <dependency>
                    <groupId>commons-httpclient</groupId>
                    <artifactId>commons-httpclient</artifactId>
                    <version>3.1</version>
                    <exclusions>
                     <exclusion>
                       <groupId>commons-logging</groupId>
                       <artifactId>commons-logging</artifactId>
                     </exclusion>
                   </exclusions>
                 </dependency>
                </dependencies>
              </plugin>
            </plugins>
        </pluginManagement>
        ...
     </build>
      ...
    </project>
    
     This modification takes care of the exception, and your documentation generation will succeed. The [WARNING]s above, however, will remain.

30 April 2009

mvn site

We're using maven 2 as a build system in our project. Now that I'm writing the doc, the site generator comes in handy.
The doc shows a good list of information you can generate out of the box.
Just make sure you include the index goal, or you won't have an index.html top file.
The rest of the documentation is terse, as usual in maven, but there's a nice javaworld article on the topic.
As I'm just generating doc, not pusing to a web server I need to link to all my different modules on disk. You do this by using the staging goal:

# mvn site:stage -DstagingDirectory=C:\projectlocal

i had a heap overflow running this, so i had to set an environment variable to increase it:

#set maven_opts=-xmx1024m -xx:maxpermsize=128m