You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Jason van Zyl <ja...@maven.org> on 2005/10/27 00:18:03 UTC

Re: my plugin is invoked okay directly but not at all as part of site.

On Wed, 2005-10-26 at 08:35 +0200, David Sag wrote:
> 
> I took the day off work yesterday as I was sick, and took the time to
> check out all the maven-plugins stuff from SVN.  Reading through the
> code I 'discovered' reference to the AbstractMavenReport - something
> that so far has not made its way into the documentation, and which
> almost certainly explains why my QALabMojo (which only extends
> AbstractMojo) is not working as a report :-) 
> 
> I'll look further into this today.  Is there any documentation I
> should be reading?  Any more hidden classes I should know about?  Or
> shoudl I just read the entire source code? 
> 
> I'm still not quite sure how I tell the report which goal to run
> however.

I've noted it for documentation, but as always the best way is to look
at an existing example.

> Kind regards,
> Dave Sag 
> 
> 
> 
> 
>   
> 
> Brett Porter <br...@apache.org> wrote on 24/10/2005 08:12:30 PM:
> 
> > It's hard without a full POM to tell exactly what you are doing. Let
> me 
> > explain how this is processed.
> > 
> > Your Mojo should extend AbstractMavenReport, which enables it as
> both a 
> > report and a mojo.
> > 
> > When running as a mojo, configuration is used with first winning:
> > 1) build plugin execution configuration
> > 2) build plugin general configuration
> > 3) reporting plugin general configuration
> > 
> > When running as a report, configuration is used with the first
> winning:
> > 1) reporting plugin individual report configuration
> > 2) reporting plugin general configuration
> > 
> > So in general you configure the report in the reporting section,
> adding 
> > configuration only specific to build executions in the build
> section.
> > 
> > Hope this helps.
> > 
> > - Brett
> > 
> > David Sag wrote:
> > > 
> > > still more on this.
> > > 
> > > if i move the configuration from out of the eexcutions and up into
> the 
> > > main plugin thus:
> > > 
> > > <plugin>
> > >     <groupId>com.davesag</groupId>
> > >     <artifactId>qalab-plugin</artifactId>
> > >     <configuration>
> > >         <quiet>false</quiet>
> > >
> <handler>net.objectlab.qalab.parser.CheckstyleStatMerge</handler>
> > >         
> > > <inputFile>${project.build.directory}/target/checkstyle-result.
> > xml</inputFile> 
> > > 
> > >     </configuration>
> > >     <executions>
> > >         <execution>
> > >              <goals>
> > >                 <goal>merge</goal>
> > >              </goals>
> > >          </execution>
> > >      </executions>
> > > </plugin>
> > > 
> > > the configuration is recongnised okay.  but that's no good for me
> as i 
> > > need different configs for different goals.
> > > 
> > > 
> > > Kind regards,
> > > Dave Sag
> > > 
> > > 
> > > 
> > > 
> > >  
> > > 
> > > David Sag <ds...@epo.org> wrote on 24/10/2005 04:05:09 PM:
> > > 
> > >  >
> > >  > Even weirder -
> > >  >
> > >  > the below is slightly wrong.
> > >  >
> > >  > in my reporting block I must specify the plugin config again
> thus:
> > >  >
> > >  > <plugin>
> > >  >     <groupId>com.davesag</groupId>
> > >  >     <artifactId>qalab-plugin</artifactId>
> > >  >     <configuration>
> > >  >         <quiet>false</quiet>
> > >  >         
> > > <handler>net.objectlab.qalab.parser.CheckstyleStatMerge</handler>
> > >  >
> <inputFile>${project.build.directory}/target/checkstyle-
> > >  > result.xml</inputFile>
> > >  >     </configuration>
> > >  > </plugin>
> > >  >
> > >  > or maven claims that i have not specified any parameters.
> > >  >
> > >  > i still get nothing generated if i run mvn site however
> > >  >
> > >  > if i remove the entire reporting block i get the same error, as
> if i
> > >  > had not configured it.
> > >  >
> > >  > so can someone please explain what the sotry is with plugin
> > >  > configuration?  it seems you must configure plugins both in the
> > >  > build section AND the reporting section for anything to work.
> > >  >
> > >  > similarly for the javadoc plugin, as of the latest change, i
> must
> > >  > now specify source = 1.4 in both the rewporting configuration
> of the
> > >  > plugin, AND the build configuration of the plugin.
> > >  >
> > >  > am i just hopelessly confused?
> > >  >
> > >  > Kind regards,
> > >  > Dave Sag
> > >  >
> > >  >
> > >  > [image removed]
> > >  >
> > >  >  
> > >  >
> > >  > David Sag <ds...@epo.org> wrote on 24/10/2005 03:55:25 PM:
> > >  >
> > >  > >
> > >  > > Dear People,
> > >  > >
> > >  > > My mojo is built and installed.
> > >  > >
> > >  > > I have specified the goal and phase thus:
> > >  > >  * @goal merge
> > >  > >  * @phase validate
> > >  > >
> > >  > > I have added a reference to the <build> block of a shell
> project thus:
> > >  > >
> > >  > > <plugin>
> > >  > >     <groupId>com.davesag</groupId>
> > >  > >     <artifactId>qalab-plugin</artifactId>
> > >  > >     <executions>
> > >  > >         <execution>
> > >  > >             <id>qalab-blah</id>
> > >  > >             <phase>validate</phase>
> > >  > >             <configuration>
> > >  > >                 <quiet>false</quiet>
> > >  > >                 <handler>net.objectlab.qalab.parser.
> > >  > > CheckstyleStatMerge</handler>
> > >  > >                 <inputFile>${project.build.directory}
> > >  > > /target/checkstyle-result.xml</inputFile>
> > >  > >             </configuration>
> > >  > >              <goals>
> > >  > >                 <goal>merge</goal>
> > >  > >              </goals>
> > >  > >          </execution>
> > >  > >      </executions>
> > >  > > </plugin>
> > >  > >
> > >  > > when i type
> > >  > >
> > >  > > mvn qalab:merge
> > >  > >
> > >  > > i get an error telling me it can't read from the checkstyle
> results
> > >  > > file.  this is a reasonable result.
> > >  > >
> > >  > > BUT
> > >  > >
> > >  > > in the reporting section of the pom.xml I have added
> > >  > >
> > >  > > <plugin>
> > >  > >     <groupId>com.davesag</groupId>
> > >  > >     <artifactId>qalab-plugin</artifactId>
> > >  > > </plugin>
> > >  > >
> > >  > > and when I type
> > >  > >
> > >  > > mvn site
> > >  > >
> > >  > > it's as if my plugin just wasn't even there.  It never gets
> run.
> > >  > >
> > >  > > the checkstyle report is run (yet to work out how to get it
> to
> > >  > > export as an xml file), and the javadocs are generated and so
> forth,
> > >  > > but my qalab plugin may as well not exist.
> > >  > >
> > >  > > if i try deliberately breaking the name then maven complains
> that
> > >  > > there is no such plugin, so it's sort of working, but it's
> just not
> > >  > > actually doing anything.
> > >  > >
> > >  > > is there a specific phase I need to bind to to get the
> reporting to 
> > > work?
> > >  > >
> > >  > > how can i be sure that the other reports have already run?
> > >  > >
> > >  > >
> > >  > > Kind regards,
> > >  > > Dave Sag
> > >  > >
> > >  > >
> > >  > > [image removed]
> > >  > >
> > >  > >  
> > 
> >
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> > 
-- 
jvz.

Jason van Zyl
jason at maven.org
http://maven.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org