What you say is right but my pb is the following: my plugin is an aggregator style, which means I want only one execution on the root pom. If I set a phase this behavior does not happen!
my plugin will be executed once per sub-pom :( On 9/1/06, Jared Bunting <[EMAIL PROTECTED]> wrote:
Sounds like the phase thing might point at the problem - say you had two executions defined. This is useful if you want to define the same goal (or different goals) to be run in different phases. But, just running it from the command line, how would maven know which one to use? Following this logic, it would make sense that only the base plugin configuration, not the configuration of individual executions, would apply when running the goal directly from the command line. Maybe somebody with a bit more knowledge could confirm whether this makes sense, or I'm way off base? On 9/1/06, Alexis Midon <[EMAIL PROTECTED]> wrote: > > thanks all for your answers, actually the problem as not due to > 'protected' > modifier nor to 'expression' attribute. > Something was wrong with my pom. > > The command I use is: mvn mygroupId:foobar:copyfile > > Configuration was not taken into account when I write: > > <plugin> > <groupId>mygroupId</groupId> > <artifactId>maven-foobar-plugin</artifactId> > <executions> > <execution> > <id>copy:file</id> > <goals> > <goal>copyfile</goal> > </goals> > <configuration> > <sourceDirectory>target</sourceDirectory> > <outputDirectory>${project.build.directory > }/toto</outputDirectory> > <includes> > <include>*.jar</include> > </includes> > <excludes> > <exclude>**</exclude> > </excludes> > </configuration> > </execution> > </executions> > </plugin> > > > But everything works fine if we remove the <executions> tag and move > upward > <configuration> like: > > <plugin> > <groupId>murex.maven.plugins</groupId> > <artifactId>maven-production-plugin</artifactId> > <configuration> > <sourceDirectory>target</sourceDirectory> > <outputDirectory>${project.build.directory > }/toto</outputDirectory> > <includes> > <include>*.jar</include> > </includes> > <excludes> > <exclude>**</exclude> > </excludes> > </configuration> > </plugin> > > > I do not really understand what's wrong, is it the lake of <phase> tag > (the > plugin does not set a default phase)? > Explanations would be very appreciate. > > Thanks all, > > Alexis > > > On 8/31/06, Jared Bunting <[EMAIL PROTECTED]> wrote: > > > > Another thought - the guide here talks about using private fields for > mojo > > configuration - i noticed that yours is protected. It specifically > > mentions > > that setters can be used in place of private fields, but makes no > mention > > of > > protected fields. Now, while it would make sense to me that the > protected > > field should work, it might be something worth trying... > > > > On 8/31/06, Ovidio Mallo <[EMAIL PROTECTED]> wrote: > > > > > > Hi Alexis, > > > > > > you may try with > > > > > > @parameter expression="${excludes}" > > > > > > in the annotation of your array. I can't test it right now, but I > > > guess this should work. > > > > > > Regards, > > > Ovidio > > > > > > Alexis Midon wrote: > > > > Hi all, > > > > > > > > I'm currently writting a custom plugin, but I've got a problem with > > the > > > > parameter settings. > > > > Here is it: > > > > > > > > My plugin declares a String array as follow: > > > > > > > > > > > > /** > > > > * The collection of exclude patterns to be applied on the > > > > sourceDirectory > > > > * > > > > * @parameter > > > > */ > > > > protected String[] excludes; > > > > > > > > > > > > In the pom file I add the following tag: > > > > > > > > <execution> > > > > ... > > > > <configuration> > > > > ... > > > > <excludes> > > > > <exclude>*.jar</exclude> > > > > <exclude>**/.foo</exclude> > > > > </excludes> > > > > </configuration> > > > > </execution> > > > > > > > > > > > > Unfortunately the String array remains null :( > > > > Where's the hell is the bug please?! > > > > > > > > Thanks a lot for your help, > > > > > > > > Alexis > > > > > > > > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > > For additional commands, e-mail: [EMAIL PROTECTED] > > > > > > > > > > > >