I have a project in a directory called trunk. Its packaging is "pom". It has a <modules> tag with several child projects to run. Each of those projects has its packaging as 'jar' or 'war'. So when I run 'mvn install' from the parent pom project, it goes into the first child jar project, where I must run the maven 2 javadoc plugin as part of 'mvn install' so that the javadocs are generated and so that they can be copied into the next project's War file.
However from the javadoc:javadoc documentation:

   * Automatically executes within the lifecycle phase: |generate-sources|
   * Invokes the execution of the lifecycle phase |generate-sources|
     prior to executing itself.

This fine except the invoked execution of generate-sources does not happen in the first child jar project scope, it gets run in the parent pom project's scope! So it does a generate-sources on ALL of the child projects. This is wrong. It should run in the scope of the project in whose pom file it is invoked. In this case it should run in the first child jar project's scope.

We see this with most of the plugins that are run where they are not originally supposed to run. It causes a lot of problems and forces us to use 'mvn install' individually in each of the child projects.

Reply via email to