multi-module project and maven reactor build order

99 views
Skip to first unread message

Nat

unread,
Nov 15, 2013, 9:12:55 PM11/15/13
to docbkx-to...@googlegroups.com
I have a multi-module maven project with a documentation set in each module.

I am generating the olink db in the generate-resources phase and the HTML & PDF output in the compile phase.

Any document can link to any other document.

But the build is failing because the all phases of one module are executed before the next module:

module1:
- generate-resources
- compile

module2:
- generate-resources
- compile

So if there is a new target in module2 which module 1 links to, then the build fails.

What I would like to happen is:

generate-resources
- module1
- module2

compile
- module1
- module2

Is there any way to declare a dependency on a particular phase in maven?

Another way of solving the problem would be to create two maven projects, each with the same modules, one which generated the olink dbs, and the other which created the documents themselves.

Has anyone else run into/solved this problem?

Nat 

Mimil Mimil

unread,
Nov 19, 2013, 4:01:24 AM11/19/13
to docbkx-to...@googlegroups.com
Hello,

I would say that maven decide the build order by analysing the dependencies, so if module 2 needs module 1 then module 1 is created before (all phases). From what you explained it seems to be the case, no?

I don't know much the olinkdb process, I guess it needs to be executed before the other docbkx targets. Maybe you could make a profile and execute the olinkdb stuf in it and and after run your other docbkx targets?

Regards,
Cedric,



--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-us...@googlegroups.com.
To post to this group, send email to docbkx-to...@googlegroups.com.
Visit this group at http://groups.google.com/group/docbkx-tools-users.
For more options, visit https://groups.google.com/groups/opt_out.

natk

unread,
Nov 19, 2013, 4:51:58 PM11/19/13
to docbkx-to...@googlegroups.com
Thanks for replying. No, all of the modules compile phases depend on all of the other modules' generate-resources phases, so it can't be solved like that.

I have solved the problem by splitting the project into 2, doing the xref generation in one, and the doc generation in another.

Nat


--
You received this message because you are subscribed to a topic in the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/docbkx-tools-users/5Wp1KCkaODw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to docbkx-tools-us...@googlegroups.com.

Mimil

unread,
Nov 19, 2013, 6:42:47 PM11/19/13
to docbkx-to...@googlegroups.com, docbkx-to...@googlegroups.com
And if you do not attach to the predefined generate-ressource phase?

Cédric,

Nat

unread,
Nov 26, 2013, 7:06:55 PM11/26/13
to docbkx-to...@googlegroups.com
If I don't attach it to a phase, then it doesn't build. Is that what you meant? Or did you mean attach it to another phase? If so, how would that help?

Nat
To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-users+unsub...@googlegroups.com.

To post to this group, send email to docbkx-to...@googlegroups.com.
Visit this group at http://groups.google.com/group/docbkx-tools-users.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to a topic in the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/docbkx-tools-users/5Wp1KCkaODw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to docbkx-tools-users+unsub...@googlegroups.com.

To post to this group, send email to docbkx-to...@googlegroups.com.
Visit this group at http://groups.google.com/group/docbkx-tools-users.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-users+unsub...@googlegroups.com.

Mimil Mimil

unread,
Nov 27, 2013, 5:28:50 PM11/27/13
to docbkx-to...@googlegroups.com
Hello,

if you look at the sample you will see stuff like that:

<profile>
      <id>docbkx.highlighter</id>
      <build>
        <plugins>
          <plugin>
            <groupId>com.agilejava.docbkx</groupId>
            <artifactId>docbkx-maven-plugin</artifactId>
            <version>${project.version}</version>
            <dependencies>
              <dependency>
                  <groupId>net.sf.xslthl</groupId>
                  <artifactId>xslthl</artifactId>
                  <version>2.0.1</version>
                  <scope>runtime</scope>
              </dependency>
              <dependency>
                  <groupId>net.sf.offo</groupId>
                  <artifactId>fop-hyph</artifactId>
                  <version>1.2</version>
                  <scope>runtime</scope>
              </dependency>
            </dependencies>
            <configuration>
              <highlightSource>1</highlightSource>
              <!--highlightXslthlConfig>/file/.../xslthl-config.xml</highlightXslthlConfig-->
              <foCustomization>src/docbkx/docbook-fo.xsl</foCustomization>
              <hyphenate>true</hyphenate>
              <hyphenateVerbatim>true</hyphenateVerbatim>
            </configuration>
          </plugin>
        </plugins>
      </build>
      <properties>
        <example.title>Syntax Highlighting</example.title>
      </properties>
    </profile> and you can run the docbkx plugin using the following command without beeing bounded to a predefined phase: mvn -Pdocbkx.highlighter docbkx:generate-pdf
Regards,
Cedric

To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-us...@googlegroups.com.

Nat

unread,
Jan 9, 2014, 5:18:26 PM1/9/14
to docbkx-to...@googlegroups.com
Thank you, yes, I did end up solving this with profiles, and running the target twice: once for xref generation, and once for output generation.
Cedric

To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-users+unsubscribe@googlegroups.com.

To post to this group, send email to docbkx-to...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/docbkx-tools-users/5Wp1KCkaODw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to docbkx-tools-users+unsubscribe@googlegroups.com.
To post to this group, send email to docbkx-to...@googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "Docbkx Tools Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to docbkx-tools-users+unsubscribe@googlegroups.com.
To post to this group, send email to docbkx-to...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages