<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>» shoss.de</title>
	<atom:link href="http://shoss.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://shoss.de</link>
	<description></description>
	<lastBuildDate>Fri, 31 Dec 2010 15:58:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.4</generator>
		<item>
		<title>DocBook Publishing with Maven and Eclipse</title>
		<link>http://shoss.de/articles/2010/docbook-publishing-with-maven-and-eclipse/</link>
		<comments>http://shoss.de/articles/2010/docbook-publishing-with-maven-and-eclipse/#comments</comments>
		<pubDate>Fri, 31 Dec 2010 15:22:05 +0000</pubDate>
		<dc:creator>Sebastian Hoß</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[docbook]]></category>
		<category><![CDATA[eclipse]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://shoss.de/?p=28</guid>
		<description><![CDATA[Writing DocBook documents always requires one to configure a suitable build system which generates the desired output formats. This post shows how to do that with Maven all from within Eclipse: 1. Download &#38; Install Eclipse &#8230; <a class="more-link" href="http://shoss.de/articles/2010/docbook-publishing-with-maven-and-eclipse/">More<span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Writing DocBook documents always requires one to configure a suitable build system which generates the desired output formats. This post shows how to do that with Maven all from within Eclipse:</p>
<p><strong>1. Download &amp; Install Eclipse</strong></p>
<p>If you have Eclipse not already up and running download it at <a href="http://eclipse.org/downloads/">http://eclipse.org/downloads/</a>- it does not really matter which version you get or have as we are going to add missing plugins anyway.</p>
<p><strong>2. Install m2eclipse Plugin</strong></p>
<p>The <a href="http://m2eclipse.sonatype.org/">m2eclipse plugin</a> embedds a complete Maven 3 runtime inside Eclipse and thus lets us use all of Mavens features. Since we want to use Maven to generate our documents this plugin comes in handy because we won&#8217;t have to switch between Eclipse and a Maven shell all the time.</p>
<p><strong>3. Download DocBook W3C XML-Schema files</strong></p>
<p>To enable validation of your DocBook sources inside of Eclipse you&#8217;ll need the <a href="http://www.docbook.org/xml/5.0/xsd/">DocBook XSD files.</a> Download all three (<em>docbook.xsd</em>, <em>xlink.xsd</em> and <em>xml.xsd</em>) and put them somewhere safe.</p>
<p><strong>4. Install Eclipse XSL Tools</strong> (Optional)</p>
<p>When you plan on splitting your DocBook files into multiple parts you want to enable XSL support in Eclipse so that it won&#8217;t give you any validation errors. To do so install the Eclipse XSL Developer Tools from the main Eclipse repository for your release. I&#8217;m currently on the Helios (3.6) release and therefore it got the XSL tools from the Helios repository as shown in the following picture:</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Install_2010-12-31_15-19-14.png"><img class="aligncenter size-medium wp-image-78" title="Installing the Eclipse XSL Developer Tools" src="http://shoss.de/wp-content/uploads/2010/12/Install_2010-12-31_15-19-14-300x259.png" alt="" width="300" height="259" /></a></p>
<p><strong>5. Install docbkx-archetype</strong> (Optional)</p>
<p>Maven allows one to use predefined archetype as a template for new projects. The<a href="http://code.google.com/p/docbkx-tools/"> docbkx-tools</a> project <a href="http://code.google.com/p/docbkx-tools/wiki/UsingArchetypeTemplate">defines one</a> for DocBook publishing using Maven and their own plugin. Archetypes are not really needed as you can always write everything yourself but most of the time they offer a quickstart to whatever you are going to do. The following files are all derived from the docbkx archetype.</p>
<p>At this point we have all necessary tools and files for DocBook editing and publishing using Maven and Eclipse. To start writing you can now either create a new Maven project inside your Eclipse workspace using the docbkx archetype from step 5 or just a simple Maven project without the use of any archetype. Both ways will result in a <em>pom.xml</em> file which is the main configuration file for your project and the place to configure PDF output, etc. For this post I&#8217;ve started with the archetype project layout but modified it to better reflect the standard Maven layout. It looks as follows:</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/sample-docbook-project-layout.png"><img class="aligncenter size-full wp-image-80" title="Sample DocBook Project Layout" src="http://shoss.de/wp-content/uploads/2010/12/sample-docbook-project-layout.png" alt="" width="260" height="294" /></a>The <em>pom.xml</em> (<a href="https://github.com/sebhoss/maven-docbook-sample/blob/master/pom.xml">link</a>) looks like this:</p>
<script>document.write('<link rel="stylesheet" href="https://gist.github.com/stylesheets/gist/embed.css"/>')

document.write('<div id=\"gist-761059\" class=\"gist\">\n\n        <div class=\"gist-file\">\n          <div class=\"gist-data gist-syntax\">\n              <div class=\"gist-highlight\"><pre><div class=\'line\' id=\'LC1\'><span class=\"cp\">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;<\/span><\/div><div class=\'line\' id=\'LC2\'><span class=\"nt\">&lt;project<\/span> <\/div><div class=\'line\' id=\'LC3\'>&nbsp;&nbsp;<span class=\"na\">xmlns                 =<\/span>   <span class=\"s\">&quot;http://maven.apache.org/POM/4.0.0&quot;<\/span><\/div><div class=\'line\' id=\'LC4\'>&nbsp;&nbsp;<span class=\"na\">xmlns:xsi             =<\/span>   <span class=\"s\">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;<\/span><\/div><div class=\'line\' id=\'LC5\'>&nbsp;&nbsp;<span class=\"na\">xsi:schemaLocation    =<\/span>   <span class=\"s\">&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;<\/span><span class=\"nt\">&gt;<\/span><\/div><div class=\'line\' id=\'LC6\'><br/><\/div><div class=\'line\' id=\'LC7\'>&nbsp;&nbsp;<span class=\"nt\">&lt;modelVersion&gt;<\/span>4.0.0<span class=\"nt\">&lt;/modelVersion&gt;<\/span><\/div><div class=\'line\' id=\'LC8\'><br/><\/div><div class=\'line\' id=\'LC9\'><br/><\/div><div class=\'line\' id=\'LC10\'>&nbsp;&nbsp;<span class=\"c\">&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;<\/span><\/div><div class=\'line\' id=\'LC11\'>&nbsp;&nbsp;<span class=\"c\">&lt;!--                               INFORMATIONS                              --&gt;<\/span><\/div><div class=\'line\' id=\'LC12\'>&nbsp;&nbsp;<span class=\"c\">&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;<\/span><\/div><div class=\'line\' id=\'LC13\'>&nbsp;&nbsp;<span class=\"nt\">&lt;groupId&gt;<\/span>GROUP-ID<span class=\"nt\">&lt;/groupId&gt;<\/span><\/div><div class=\'line\' id=\'LC14\'>&nbsp;&nbsp;<span class=\"nt\">&lt;artifactId&gt;<\/span>ARTIFACT-ID<span class=\"nt\">&lt;/artifactId&gt;<\/span><\/div><div class=\'line\' id=\'LC15\'>&nbsp;&nbsp;<span class=\"nt\">&lt;version&gt;<\/span>YOUR-VERSION<span class=\"nt\">&lt;/version&gt;<\/span><\/div><div class=\'line\' id=\'LC16\'>&nbsp;&nbsp;<span class=\"nt\">&lt;name&gt;<\/span>BOOK NAME HERE<span class=\"nt\">&lt;/name&gt;<\/span><\/div><div class=\'line\' id=\'LC17\'>&nbsp;&nbsp;<span class=\"nt\">&lt;packaging&gt;<\/span>pom<span class=\"nt\">&lt;/packaging&gt;<\/span><\/div><div class=\'line\' id=\'LC18\'><br/><\/div><div class=\'line\' id=\'LC19\'><br/><\/div><div class=\'line\' id=\'LC20\'>&nbsp;&nbsp;<span class=\"c\">&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;<\/span><\/div><div class=\'line\' id=\'LC21\'>&nbsp;&nbsp;<span class=\"c\">&lt;!--                                PROPERTIES                               --&gt;<\/span><\/div><div class=\'line\' id=\'LC22\'>&nbsp;&nbsp;<span class=\"c\">&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;<\/span><\/div><div class=\'line\' id=\'LC23\'>&nbsp;&nbsp;<span class=\"nt\">&lt;properties&gt;<\/span><\/div><div class=\'line\' id=\'LC24\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;project.build.sourceEncoding&gt;<\/span>UTF-8<span class=\"nt\">&lt;/project.build.sourceEncoding&gt;<\/span><\/div><div class=\'line\' id=\'LC25\'>&nbsp;&nbsp;<span class=\"nt\">&lt;/properties&gt;<\/span><\/div><div class=\'line\' id=\'LC26\'><br/><\/div><div class=\'line\' id=\'LC27\'><br/><\/div><div class=\'line\' id=\'LC28\'>&nbsp;&nbsp;<span class=\"c\">&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;<\/span><\/div><div class=\'line\' id=\'LC29\'>&nbsp;&nbsp;<span class=\"c\">&lt;!--                                  BUILD                                  --&gt;<\/span><\/div><div class=\'line\' id=\'LC30\'>&nbsp;&nbsp;<span class=\"c\">&lt;!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --&gt;<\/span><\/div><div class=\'line\' id=\'LC31\'>&nbsp;&nbsp;<span class=\"nt\">&lt;build&gt;<\/span><\/div><div class=\'line\' id=\'LC32\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;plugins&gt;<\/span><\/div><div class=\'line\' id=\'LC33\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;plugin&gt;<\/span><\/div><div class=\'line\' id=\'LC34\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;groupId&gt;<\/span>com.agilejava.docbkx<span class=\"nt\">&lt;/groupId&gt;<\/span><\/div><div class=\'line\' id=\'LC35\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;artifactId&gt;<\/span>docbkx-maven-plugin<span class=\"nt\">&lt;/artifactId&gt;<\/span><\/div><div class=\'line\' id=\'LC36\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;version&gt;<\/span>2.0.11<span class=\"nt\">&lt;/version&gt;<\/span><\/div><div class=\'line\' id=\'LC37\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;executions&gt;<\/span><\/div><div class=\'line\' id=\'LC38\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;execution&gt;<\/span><\/div><div class=\'line\' id=\'LC39\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;id&gt;<\/span>draft-output<span class=\"nt\">&lt;/id&gt;<\/span><\/div><div class=\'line\' id=\'LC40\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;phase&gt;<\/span>pre-site<span class=\"nt\">&lt;/phase&gt;<\/span><\/div><div class=\'line\' id=\'LC41\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;goals&gt;<\/span><\/div><div class=\'line\' id=\'LC42\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;goal&gt;<\/span>generate-pdf<span class=\"nt\">&lt;/goal&gt;<\/span><\/div><div class=\'line\' id=\'LC43\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;goal&gt;<\/span>generate-html<span class=\"nt\">&lt;/goal&gt;<\/span><\/div><div class=\'line\' id=\'LC44\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/goals&gt;<\/span><\/div><div class=\'line\' id=\'LC45\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;configuration&gt;<\/span><\/div><div class=\'line\' id=\'LC46\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c\">&lt;!-- per execution configuration --&gt;<\/span><\/div><div class=\'line\' id=\'LC47\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;draftMode&gt;<\/span>yes<span class=\"nt\">&lt;/draftMode&gt;<\/span><\/div><div class=\'line\' id=\'LC48\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/configuration&gt;<\/span><\/div><div class=\'line\' id=\'LC49\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/execution&gt;<\/span><\/div><div class=\'line\' id=\'LC50\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/executions&gt;<\/span><\/div><div class=\'line\' id=\'LC51\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;configuration&gt;<\/span><\/div><div class=\'line\' id=\'LC52\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"c\">&lt;!-- shared configuration --&gt;<\/span><\/div><div class=\'line\' id=\'LC53\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;sourceDirectory&gt;<\/span>${basedir}/src/main/docbkx<span class=\"nt\">&lt;/sourceDirectory&gt;<\/span><\/div><div class=\'line\' id=\'LC54\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;includes&gt;<\/span>*.dbk<span class=\"nt\">&lt;/includes&gt;<\/span><\/div><div class=\'line\' id=\'LC55\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;generatedSourceDirectory&gt;<\/span>${project.build.directory}/docbkx/generated<span class=\"nt\">&lt;/generatedSourceDirectory&gt;<\/span><\/div><div class=\'line\' id=\'LC56\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;xincludeSupported&gt;<\/span>true<span class=\"nt\">&lt;/xincludeSupported&gt;<\/span><\/div><div class=\'line\' id=\'LC57\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;highlightSource&gt;<\/span>1<span class=\"nt\">&lt;/highlightSource&gt;<\/span><\/div><div class=\'line\' id=\'LC58\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;paperType&gt;<\/span>A4<span class=\"nt\">&lt;/paperType&gt;<\/span><\/div><div class=\'line\' id=\'LC59\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;fop1Extensions&gt;<\/span>1<span class=\"nt\">&lt;/fop1Extensions&gt;<\/span><\/div><div class=\'line\' id=\'LC60\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;foCustomization&gt;<\/span>src/main/resources/stylesheets/fo/docbook.xsl<span class=\"nt\">&lt;/foCustomization&gt;<\/span><\/div><div class=\'line\' id=\'LC61\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/configuration&gt;<\/span><\/div><div class=\'line\' id=\'LC62\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;dependencies&gt;<\/span><\/div><div class=\'line\' id=\'LC63\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;dependency&gt;<\/span><\/div><div class=\'line\' id=\'LC64\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;groupId&gt;<\/span>org.docbook<span class=\"nt\">&lt;/groupId&gt;<\/span><\/div><div class=\'line\' id=\'LC65\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;artifactId&gt;<\/span>docbook-xml<span class=\"nt\">&lt;/artifactId&gt;<\/span><\/div><div class=\'line\' id=\'LC66\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;version&gt;<\/span>5.0<span class=\"nt\">&lt;/version&gt;<\/span><\/div><div class=\'line\' id=\'LC67\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;type&gt;<\/span>pom<span class=\"nt\">&lt;/type&gt;<\/span><\/div><div class=\'line\' id=\'LC68\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;scope&gt;<\/span>runtime<span class=\"nt\">&lt;/scope&gt;<\/span><\/div><div class=\'line\' id=\'LC69\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/dependency&gt;<\/span><\/div><div class=\'line\' id=\'LC70\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/dependencies&gt;<\/span><\/div><div class=\'line\' id=\'LC71\'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/plugin&gt;<\/span><\/div><div class=\'line\' id=\'LC72\'>&nbsp;&nbsp;&nbsp;&nbsp;<span class=\"nt\">&lt;/plugins&gt;<\/span><\/div><div class=\'line\' id=\'LC73\'>&nbsp;&nbsp;<span class=\"nt\">&lt;/build&gt;<\/span><\/div><div class=\'line\' id=\'LC74\'><br/><\/div><div class=\'line\' id=\'LC75\'><span class=\"nt\">&lt;/project&gt;<\/span><\/div><div class=\'line\' id=\'LC76\'><br/><\/div><\/pre><\/div>\n          <\/div>\n\n          <div class=\"gist-meta\">\n            <a href=\"https://gist.github.com/raw/761059/53e318157370aeb88a5f2892dd29f280959a6ede/pom.xml\" style=\"float:right;\">view raw<\/a>\n            <a href=\"https://gist.github.com/761059#file_pom.xml\" style=\"float:right;margin-right:10px;color:#666\">pom.xml<\/a>\n            <a href=\"https://gist.github.com/761059\">This Gist<\/a> brought to you by <a href=\"http://github.com\">GitHub<\/a>.\n          <\/div>\n        <\/div>\n<\/div>\n')
</script><div style='margin-bottom:1em;padding:0;'><noscript><code><pre style='overflow:auto;margin:0;padding:0;border:1px solid #DDD;'>&lt;html&gt;&lt;body&gt;You are being &lt;a href=&quot;https://raw.github.com/gist/761059/pom.xml&quot;&gt;redirected&lt;/a&gt;.&lt;/body&gt;&lt;/html&gt;</pre></code></noscript></div>
<p>As you can see, all DocBook sources are inside the <em>src/main/docbkx</em> folder and will get automatically picked-up by the docbkx-plugin. Also note that I&#8217;ve changed the file extension of all the DocBook files to <em>.dbk</em> which is the default file extension of DocBook files. The files under <em>src/main/resources/xsd</em> (these are the files from step 3) will now be used to validation your sources and provide you with content assist. For that open the Eclipse preferences via <em>Window &gt; Preferences</em> and switch to the <em>XML &gt; XML Catalog</em> category as shown in the following picture.</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Preferences_2010-12-31_14-41-43.png"><img class="aligncenter size-medium wp-image-83" title="Preferences_2010-12-31_14-41-43" src="http://shoss.de/wp-content/uploads/2010/12/Preferences_2010-12-31_14-41-43-300x213.png" alt="" width="300" height="213" /></a></p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Add-XML-Catalog-Element_2010-12-31_14-51-08.png"><img class="aligncenter size-medium wp-image-84" title="Add XML Catalog Element_2010-12-31_14-51-08" src="http://shoss.de/wp-content/uploads/2010/12/Add-XML-Catalog-Element_2010-12-31_14-51-08-300x245.png" alt="" width="300" height="245" /></a></p>
<p>There add a new catalog entry by clicking on the Add button. The final result should look like in the pictures. If you want to use XIncludes as well you have to enable the &#8220;Process XML Inclusions&#8221; checkbox inside the <em>XML &gt; XML Files &gt; Validation</em> category as shown below.</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Preferences_2010-12-31_15-03-45.png"><img class="aligncenter size-medium wp-image-86" title="Preferences_2010-12-31_15-03-45" src="http://shoss.de/wp-content/uploads/2010/12/Preferences_2010-12-31_15-03-45-300x247.png" alt="" width="300" height="247" /></a>At this point we are almost there but we still need to enable the actual validation. For this right-click on your project, select <em>Properties </em>and switch to the <em>Validation </em>category. There add a validation builder to your project and click on the XML validator settings as shown in the following picture.</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Properties-for-simple-docbook_2010-12-31_14-58-26.png"><img class="aligncenter size-medium wp-image-87" title="Enable DocBook validation" src="http://shoss.de/wp-content/uploads/2010/12/Properties-for-simple-docbook_2010-12-31_14-58-26-300x220.png" alt="" width="300" height="220" /></a>Inside the XML validator settings click on the first include group (or create your own) and add a single rule to include files with a DocBook content-type. The DocBook content-type is already configured in the latest versions of Eclipse so no additional work needed. The result should look like the following:</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Validation-Filters-for-XML-Validator_2010-12-31_15-00-58.png"><img class="aligncenter size-medium wp-image-88" title="Validation Filters for XML Validator_2010-12-31_15-00-58" src="http://shoss.de/wp-content/uploads/2010/12/Validation-Filters-for-XML-Validator_2010-12-31_15-00-58-300x237.png" alt="" width="300" height="237" /></a>At this point all validation of DocBook sources works and you have content assist inside those sources. To finally generate some output we are going to create a simple launch configuration with Eclipse which will call Maven to build your project. For that just right-click on your project, select <em>Run As &gt; Maven build&#8230;</em> and set the goal to <em>clean pre-site</em> as shown in the following picture.</p>
<p><a href="http://shoss.de/wp-content/uploads/2010/12/Edit-Configuration_2010-12-31_15-06-29.png"><img class="aligncenter size-medium wp-image-89" title="Edit Configuration_2010-12-31_15-06-29" src="http://shoss.de/wp-content/uploads/2010/12/Edit-Configuration_2010-12-31_15-06-29-219x300.png" alt="" width="219" height="300" /></a></p>
<p>Now hit <em>Run</em>, wait for the process to finish and look into the target folder of your project for final outputs.</p>
<p>The nice thing about this setup is that it can be easily shared via SCM-systems. It only includes source files with the exception of those XSD files from step 3 and the FO stylesheet. But those could be easily moved into seperate projects, modules, plugins or just a network drive to make them accessible for all writers within a team.</p>
<p>(For the impatient I&#8217;ve created a <a href="https://github.com/sebhoss/maven-docbook-sample">sample project at github</a> which includes all necessary files)</p>
]]></content:encoded>
			<wfw:commentRss>http://shoss.de/articles/2010/docbook-publishing-with-maven-and-eclipse/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

