Class PluginRealmHelper


  • @Component(role=PluginRealmHelper.class)
    public class PluginRealmHelper
    extends java.lang.Object
    Helper class that allows execution of components from maven plugin class realms. Normally, these components are not visible from tycho-core extensions plugin and require treatment. Typical usage
     @Requirement
     private EquinoxServiceFactory equinox;
     
     @Requirement
     private PluginRealmHelper pluginRealmHelper;
     
     ...
     
     public void someMethod(final MavenSession session, final MavenProject project) throws MavenExecutionException {
        pluginRealmHelper..execute(session, project, new Runnable() {
            public void run() {
                try {
                    equinox.lookup(SomeComponent.class).someComponentMethod();
                } catch (ComponentLookupException e) {
                    // have not found anything
                }
            }
        }, new PluginFilter() {
            public boolean accept(PluginDescriptor descriptor) {
                return true if the plugin is relevant;
            }
        });
     }
     
    • Field Detail

      • logger

        @Requirement
        private org.codehaus.plexus.logging.Logger logger
      • pluginManager

        @Requirement
        private org.apache.maven.plugin.MavenPluginManager pluginManager
      • buildPluginManager

        @Requirement
        private org.apache.maven.plugin.BuildPluginManager buildPluginManager
      • pluginDescriptorCache

        @Requirement
        private org.apache.maven.plugin.PluginDescriptorCache pluginDescriptorCache
      • lifecyclePluginResolver

        @Requirement
        private org.apache.maven.lifecycle.internal.LifecyclePluginResolver lifecyclePluginResolver
    • Constructor Detail

      • PluginRealmHelper

        public PluginRealmHelper()
    • Method Detail

      • execute

        public void execute​(org.apache.maven.execution.MavenSession session,
                            org.apache.maven.project.MavenProject project,
                            java.lang.Runnable runnable,
                            PluginRealmHelper.PluginFilter filter)
                     throws org.apache.maven.MavenExecutionException
        Throws:
        org.apache.maven.MavenExecutionException
      • newMavenExecutionException

        private static org.apache.maven.MavenExecutionException newMavenExecutionException​(java.lang.Exception cause)