Docbook and Maven

I’ve released two new versions of the maven sdocbook plugin (note that it’s called sdocbook for historical reasons but it uses the full docbook, not the simplified one). The latest version allows the creation of pdf, html in a single page and html splitted in sections. It also allows the customization of the stylesheets used for transformation.

It’s as easy as running maven sdocbook after you put the docbook source in the sdocbook folder.

To generate the docbook when building the site just add this postGoal to your maven.xml.

    <postGoal name="site">
        <attainGoal name="sdocbook"/>
    </postGoal>

There are two projects where I’ve implemented the docbook transformation using all the features:

  • ONess
  • Acegi Security System for Spring

If you’d like to generate the docbook files as part of the maven generated site (with the navigation bar on the left, logos and footer), you can try the following goal after generating the docbook files, but before xdoc goal.

    <goal name="docbook2xdoc">
        <maven:get var="maven.sdocbook.generated.html"
            plugin="maven-sdocbook-plugin"
            property="maven.sdocbook.generated.html"/>
        <mkdir dir="${maven.gen.docs}/docbook2xdoc"/>

        <j:set var="maven.html2xdoc.dir.bak" value="${maven.html2xdoc.dir}"/>
        <j:set var="maven.gen.docs.bak" value="${maven.gen.docs}"/>

        <j:set var="maven.html2xdoc.dir" value="${maven.sdocbook.generated.html}"/>
        <j:set var="maven.gen.docs" value="${maven.gen.docs}/docbook2xdoc"/>
        <attainGoal name="html2xdoc:transform"/>

        <j:set var="maven.html2xdoc.dir" value="${maven.html2xdoc.dir.bak}"/>
        <j:set var="maven.gen.docs" value="${maven.gen.docs.bak}"/>
    </goal>

Maven Blogs

If you want to get the latest news from the Maven project you can try Maven Blogs, where the blogs of some maven developers are aggregated.

A good new is that Maven 1.0.2 is in the way in less than 24 hours. Thank to all those guys developing this great tool. And of course thanks to all the contributors and users that help improving it.

Maven AspectJ plugin 3.2 released

The maven team is pleased to announce the Maven AspectJ Plugin 3.2 release!

The main change is the ability of weaving only a subset of aspects.

The maven team is pleased to announce the Maven AspectJ Plugin 3.2 release!
http://maven.apache.org/reference/plugins/aspectj/

Changes in this version include:

  New Features:
o Added maven.aspectj.argfiles and maven.aspectj.weaveAspectSources properties.
  Issue: MPASPECTJ-12. Thanks to Mark Proctor.
o Added maven.aspectj.noweave and maven.aspectj.lint properties. Issue:
  MPASPECTJ-13.

  Fixed bugs:
o Added maven.aspectj.source and maven.aspectj.time properties that where
  incorrectly removed.

To automatically install the plugin, type the following on a single line:

maven plugin:download -DgroupId=maven -DartifactId=maven-aspectj-plugin -Dversion=3.2

For a manual installation, you can download the plugin here:
http://www.apache.org/dyn/closer.cgi/java-repository/maven/plugins/maven-aspectj-plugin-3.2.jar

Have fun!
-The maven team

Maven 1.0.1 Released

After a long time from 1.0, the 1.0.1 release is out!.

The maven team is pleased to announce the Maven 1.0.1 release!

Download

This release contains bugfixes since the Maven 1.0 release. In addition, all of
the latest stable plugin releases are included, which include both bugfixes and
some new features.

We recommend that all users upgrade to this release, in particular those using
pre-1.0 betas or release candidates.

Maven is a project management and project comprehension tool. Maven is based
on the concept of a project object model: builds, documentation creation, site
publication, and distribution publication are all controlled from the project
object model. Maven also provides tools to create source metrics, change logs
based directly on source repository, and source cross-references.



Changes in this version can be found here:
Changes

Please note that each plugin has its own changes report - please refer to the plugins
site to see the plugin you are interested in.

Have fun!
-The Apache Maven Team

Another Maven success story: Acegi Security System for Spring

Another project I have just migrated to Maven is the Acegi Security System for Spring. The folder layout was changed (retaining CVS history) to use Maven suggestions, although it’s not needed. The core, subprojects, samples and docs (including docbook generation) were migrated from ant.

Maven multiproject: sharing common files between subprojects

Are you using multiproject and want to use common files in all your subprojects?

Then you can define a variable “rootdir” pointing to the dir where common files are stored, so they can be refered as ${rootdir}/filename, both in your properties (project.properties, build.properties) and project.xml files.

To do so you just need to create a maven.xml in the top level project (supposing you have a LICENSE.txt in the top level dir, you can use any other file). This var will point to the same dir from every subproject.

<project
   xmlns:j="jelly:core"
   xmlns:ant="jelly:ant"
   xmlns:util="jelly:util"
   xmlns:maven="jelly:maven">

    <!-- =========== Set root dir =========== -->

    <j:set var="rootdir">${basedir}</j:set>

    <j:while test="${true}">
        <util:available file="${rootdir}/LICENSE.txt">
            <j:break/>
        </util:available>
        <j:set var="rootdir">${rootdir}/..</j:set>
    </j:while>

    <ant:dirname property="rootdirname" file="${rootdir}/project.xml"/>
    <j:set var="rootdir">${rootdirname}</j:set>
    <echo>Using root dir: ${rootdir}</echo>

</project>

You’d like to set some properties using this new var

# License plugin settings
maven.license.licenseFile=${rootdir}/LICENSE.txt

# multiproject
maven.multiproject.basedir=${rootdir}