maven


Is it possible to specify a dependency on a particular maven phase?


I am using the maven-docbkx-plugin to generate HTML and PDF output from docbook sources. I have several books, and these link to each other using olinks.
The olink database is generated in one maven phase (generate-resources), and the actual HTML and PDF generation, which looks up this database is executed in a subsequent maven phase (compile).
I have divided the maven project into a multi-module project, as each book has tens of included sub-documents. The docbkx-maven-plugin configuration is all done in the parent, then it is just the top-level docbook source that needs to be specified in the child POM.
But ... this does not work dependency-wise, as each module requires that the generate-resources of every other module has been run before it runs its compile phase, so that it can access the olink database of each of the other books.
Is there a way to do this in maven? Or will I need to re-structure into two maven projects (which will break the modularity of this project considerably, as all of the configuration will need to be declared in each project)?
The structure of the parent POM is:
...
<build>
<plugins>
<pluginManagenent>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.14</version>
<executions>
<execution>
<id>xrefdb</id>
<phase>generate-resources</phase>
<configuration>
...
</configuration>
<goals>
<goal>generate-html</goal>
</goals>
</execution>
<execution>
<id>html</id>
<phase>compile</phase>
<configuration>
...
</configuration>
<goals>
<goal>generate-html</goal>
</goals>
</execution>
</executions>
</plugin>
</pluginManagement>
</plugins>
</build>
</project>
And the modules:
<project>
...
<build>
<plugins>
<plugin>
<groupId>com.agilejava.docbkx</groupId>
<artifactId>docbkx-maven-plugin</artifactId>
<version>2.0.14</version>
<configuration>
...
</configuration>
</plugin>
</plugins>
</build>
</project>
I've done a bit more research on this, and from what I have read, what I am asking is not possible (but I would be happy to be advised otherwise). I have split my project into two, and given them a common parent from which they can draw their common configuration.
Another way I've solved this problem is to use maven profiles. I perform the first pass of all the modules in the first profile, then perform the second pass in a second profile.
It means the project has to be run twice to build all of its artifacts, but it is much more maintainable than spreading the sources over multiple projects.

Related Links

Maven - Reading a property from an external properties file
Want to build multimodule pom which builds 2 ear from same project in maven
maven deploy does not work the way it is supposed to. Or am i wrong?
Maven: Making Jars With Dependencies: Example From Book Doesn't Work
Artifactory permissions
maven: which jaxb plugin to use? [duplicate]
Maven - delegate plugin execution to submodule
Set directory in Maven Antrun Plugin
Maven assembly:single issue
Where can I get the NaturalDocs Maven plugin?
define additional source directory in maven
Java: Maven: get pom.xml information in properties file (mercurial hash as version)
Jetty 8 Maven Plugin jetty:run-war not detecting WebApplicationInitializer
maven how to install a jar with a classifier and not install the default one
Maven proxy settings not working
Maven: No marketplace entries found to handle castor, antrun, and ear plugins

Categories

HOME
maven
winforms
amazon-ec2
mfc
json.net
plot
q
at-command
maven-3
spring-jdbc
malloc
ravendb
alignment
remote-access
decimal
libtiff
google-pagespeed
errorlevel
arabic
wijmo
crystal-reports-2010
kannel
fgetcsv
spring-mybatis
madlib
bluestacks
google-rich-snippets
directx-10
junit5
.net-4.0
google-sites-2016
lxd
azure-sql-database
gammu
hexo
suricata
stacked
hue
angularjs-factory
reportingservices-2005
total-commander
user-accounts
xml-documentation
smartcontracts
return-value
worker-thread
windows-mobile-6.5
mcafee
vtigercrm
mediaelement
objective-c-swift-bridge
spring-android
heidisql
savon
asp.net-4.5
lua-5.1
moveit
master-slave
uid
hsv
python-3.2
mono-embedding
remobjects
camanjs
codeigniter-routing
responsive-slides
message-driven-bean
mcts
dir
mylyn
android-screen-support
selected
sublist
asyncfileupload
joyent
xmlspy
yui-datatable
telerik-scheduler
revisions
jquery-ui-droppable
thunderbird-lightning
compiler-specific
memory-size
yagni
anti-piracy
nerddinner
zune
grid-system
paul-graham
3gp

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App