Hello guys,

I've recently found out something weird while working with the asciidoctor
maven plugin.My project has the following structure:

PARENT:
 - MODULEA
 - MODULEB
 - MODULEC

and the asciidoctor team have created this doxia parser to be able to
render asciidoc content as part of your maven site:

https://github.com/asciidoctor/asciidoctor-maven-plugin/blob/master/src/main/java/org/asciidoctor/maven/site/AsciidoctorParser.java#L53

Note that they are injecting the MavenProject like this:

    @Requirement
    protected MavenProject project;

and when I run the site generation at the PARENT (mvn clean site) this
parser gets called 4 times, and all the 4 times the MavenProject that gets
injected is PARENT.

However, if I run the site generation at PARENT but tell it to resume from
MODULEA:

mvn clean site -rf :MODULEA

then the MavenProject is MODULEA every time. First time it is MODULEA,
second time it is MODULEA and third time it is MODULEA.

This may seem like a very small difference, but if you use properties like
${project.build.directory} then suddenly your site and images are generated
in wrong folders.

My questions is:
  1) Does it look like a bug in Maven reactor? Or perhaps plexus?
  2) Is there any special way that I can inject the current child module of
the mulit-module build. I want the MavenProject that is injected to be
first time MODULEA, second time MODULEB and third time MODULEC.

Regarding point 2 I saw Anders had the same question here:

http://maven.40175.n5.nabble.com/Get-hold-of-MavenProject-object-of-a-module-in-a-multi-module-build-td5811486.html

but I didn't get the answer.

Thank you.

-- 
Regards, Petar!
Karlovo, Bulgaria.
---
Public PGP Key at:
http://pgp.mit.edu:11371/pks/lookup?op=get&search=0x19658550C3110611
Key Fingerprint: A369 A7EE 61BC 93A3 CDFF  55A5 1965 8550 C311 0611

Reply via email to