Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [m2e-dev] Reading a plugin's configuration during project configuration

Yes, this should work. Are you sure outputDirectory is correct?

--
Regards,
Igor

On 11-10-30 4:12 PM, Navarro Perez, Antonio wrote:
Hi,

Am 28.10.2011 um 20:40 schrieb Ian Robertson:

The main unpleasantness is getting the field values by reflection. The class loader for configuredMojo will almost certainly not be the class loader for your configurator, so reflection will really be your only option.

That worked for me, thanks!

Still, I now have a problem in my custom BuildParticipant, a buildContext.refresh(outputDirectory) has no effect at all on my Eclipse workspace. I still have to refresh manually (pressing F5) to update the generated content in that folder. I am doing nothing more than calling...

   @Override
   public Set<IProject>  build(int kind, IProgressMonitor monitor) throws Exception {

     Set<IProject>  result = null;

     IMaven maven = MavenPlugin.getMaven();
     BuildContext buildContext = this.getBuildContext();

     if (!buildContext.isIncremental()) {

       result = super.build(kind, monitor);

       File outputDirectory = maven.getMojoParameterValue(
           this.getSession(),
           this.getMojoExecution(),
           Constants.OUTPUTDIRECTORY_PARAMETER,
           File.class);

       outputDirectory = outputDirectory != null ? outputDirectory : new File(Constants.DEFAULT_OUTPUT_DIRECTORY);
       buildContext.refresh(outputDirectory);

     }

     return result;
   }

Is that expected behavior?

Viele Grüße



Back to the top