See http://maven.apache.org/doxia/book/index.html
The section titles need to match the source documents name, eg
<section>
<id>section-1</id>
</section>
will get the source from a file apt/section-1.apt, or
xdoc/section-1.xml, etc. You don't have to specify a title tag inside a
section, the title will be taken from the source document. Actually I
don't know what the file tag is for, you certainly don't need it...
HTH,
-Lukas
Giovanni Pedone wrote:
hello,
may you please publish a quick tutorial on how to set up dozia and use it ?
I have a maven project with documentantion generated by "maven site" given a
set of xdoc documents under src/site/xdoc with a maven site.xml for
generation.
I would like to generate the same docs thru doxia maven plugin and get the
output into different formats.
How can I do that?
I dont understand if I need to have the content files named exactly like the
sections id defined in the book.xml.
Also do I MUST specify title and file tags elements inside the section
element of book.xml ?
When I tried the following then I got this error:
[INFO] [doxia:render-books]
[INFO]
------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO]
------------------------------------------------------------------------
[INFO] null
[INFO]
------------------------------------------------------------------------
[INFO] Trace
java.lang.reflect.UndeclaredThrowableException
at $Proxy0.text(Unknown Source)
at
org.apache.maven.doxia.module.docbook.DocBookParser.handleText(DocBookParser
.java:686)
at
org.apache.maven.doxia.parser.AbstractXmlParser.parseXml(AbstractXmlParser.j
ava:96)
at
org.apache.maven.doxia.parser.AbstractXmlParser.parse(AbstractXmlParser.java
:53)
at org.apache.maven.doxia.DefaultDoxia.parse(DefaultDoxia.java:59)
at
org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer.rend
erSection(AbstractITextBookRenderer.java:260)
at
org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer.rend
erChapter(AbstractITextBookRenderer.java:216)
at
org.apache.maven.doxia.book.services.renderer.AbstractITextBookRenderer.rend
erBook(AbstractITextBookRenderer.java:142)
at
org.apache.maven.doxia.book.DefaultBookDoxia.renderBook(DefaultBookDoxia.jav
a:126)
at
org.apache.maven.doxia.plugin.DoxiaRenderBooksMojo.execute(DoxiaRenderBooksM
ojo.java:214)
at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManage
r.java:443)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLife
cycleExecutor.java:539)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(De
faultLifecycleExecutor.java:493)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifec
ycleExecutor.java:463)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFail
ures(DefaultLifecycleExecutor.java:311)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(Defa
ultLifecycleExecutor.java:278)
at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycle
Executor.java:143)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:334)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:125)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:280)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39
)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl
.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at
org.apache.maven.doxia.sink.PipelineSink.invoke(PipelineSink.java:55)
... 28 more
Caused by: java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:79)
at
org.apache.maven.doxia.module.itext.SinkActionContext.getCurrentAction(SinkA
ctionContext.java:83)
at
org.apache.maven.doxia.module.itext.ITextSink.text(ITextSink.java:1354)
... 33 more
This is waht I tried:
-------------------
pom.xml
-------------------
<plugin>
<groupId>org.apache.maven.doxia</groupId>
<artifactId>doxia-maven-plugin</artifactId>
<version>1.0-alpha-9</version>
<executions>
<execution>
<phase>pre-site</phase>
<goals>
<goal>render-books</goal>
</goals>
</execution>
</executions>
<configuration>
<books>
<book>
<directory>src/site</directory>
<descriptor>src/site/book.xml</descriptor>
<formats>
<format>
<id>xdoc</id>
</format>
<format>
<id>pdf</id>
</format>
<format>
<id>rtf</id>
</format>
</formats>
</book>
</books>
</configuration>
</plugin>
-------------------
book.xml:
-------------------
<?xml version="1.0" encoding="UTF-8"?>
<book>
<id>doxia-example-book</id>
<title>XFire User Manual</title>
<chapters>
<chapter>
<id>bind</id>
<title>Bindings</title>
<sections>
<section>
<id>bindings</id>
</section>
</sections>
</chapter>
</chapters>
</book>
-------------------
bindings.xml:
-------------------
<document>
<properties>
<title>Page Title</title>
<author email="[EMAIL PROTECTED]">John Doe</author>
</properties>
<body>
<section name="bindings">
<p>Hi!</p>
ciao ciao gio
</section>
</body>
</document>
----------------------------------------------------------------------------
"La presente comunicazione elettronica contiene informazioni aziendali non
private. Eventuali risposte alla presente potrebbero essere conosciute, per
motivi organizzativi e di sicurezza, dal personale di Postecom S.p.a."