Hi, we're using Maven 2.0.7 (same problem also seems to exist on 2.0.4). This seems like something so basic I'm hoping there is a simple explanation/workaround.
What we're seeing is that some multi-project configurations succeed on 'mvn package' but fail on 'mvn generate-sources'. They are failing when one project in the reactor references another project in the reactor which is not installed in the local repo. It seems that the referenced project has not quite "made it" into the reactor this early in the phase lifecycle. But it does work correctly if you target a later phase at the outset which I find really confusing (my understanding was that Maven executes the phases in order, so the final phase chosen should not affect the execution of earlier phases??). The problem only occurs when a plugin binds itself to the generate-sources phase and has @requiresDependencyResolution, presumably because this is what triggers resolution of the referenced dependency too early in the lifecycle, and hence the error. We are seeing this problem when trying to run 'mvn eclipse:eclipse' because this only executes the generate-sources phase by default and we have other mojos which genuinely do generate source, such as java2wsdl. A workaround is to always run 'mvn install' before 'mvn eclipse:eclipse' to get all projects into the local repo. Another workaround is to run 'mvn package eclipse:eclipse' (voodoo!!). I have a sample multi-project and mojo to demonstrate this behaviour but you can see it easily with the antrun mojo and many others. Is this a bug - should I raise a JIRA on it? Many thanks, Alfie. Communications on or through ioko's computer systems may be monitored or recorded to secure effective system operation and for other lawful purposes. Unless otherwise agreed expressly in writing, this communication is to be treated as confidential and the information in it may not be used or disclosed except for the purpose for which it has been sent. If you have reason to believe that you are not the intended recipient of this communication, please contact the sender immediately. No employee is authorised to conclude any binding agreement on behalf of ioko with another party by e-mail without prior express written confirmation. ioko365 Ltd. VAT reg 656 2443 31. Reg no 3048367. All rights reserved.