当前位置: 首页>>代码示例>>Java>>正文


Java PluginManagerException类代码示例

本文整理汇总了Java中org.apache.maven.plugin.PluginManagerException的典型用法代码示例。如果您正苦于以下问题:Java PluginManagerException类的具体用法?Java PluginManagerException怎么用?Java PluginManagerException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PluginManagerException类属于org.apache.maven.plugin包,在下文中一共展示了PluginManagerException类的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: executeMojo

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
/**
 * Taken from MojoExecutor of Don Brown. Make it working with Maven 3.1.
 * 
 * @param plugin
 * @param goal
 * @param configuration
 * @param env
 * @throws MojoExecutionException
 * @throws PluginResolutionException
 * @throws PluginDescriptorParsingException
 * @throws InvalidPluginDescriptorException
 * @throws PluginManagerException
 * @throws PluginConfigurationException
 * @throws MojoFailureException
 */
private void executeMojo( Plugin plugin, String goal, Xpp3Dom configuration )
    throws MojoExecutionException, PluginResolutionException, PluginDescriptorParsingException,
    InvalidPluginDescriptorException, MojoFailureException, PluginConfigurationException, PluginManagerException
{

    if ( configuration == null )
    {
        throw new NullPointerException( "configuration may not be null" );
    }

    PluginDescriptor pluginDescriptor = getPluginDescriptor( plugin );

    MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo( goal );
    if ( mojoDescriptor == null )
    {
        throw new MojoExecutionException( "Could not find goal '" + goal + "' in plugin " + plugin.getGroupId()
            + ":" + plugin.getArtifactId() + ":" + plugin.getVersion() );
    }

    MojoExecution exec = mojoExecution( mojoDescriptor, configuration );
    pluginManager.executeMojo( getMavenSession(), exec );
}
 
开发者ID:khmarbaise,项目名称:iterator-maven-plugin,代码行数:38,代码来源:IteratorMojo.java

示例2: calculateExecutionPlan

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
@SuppressWarnings( { "UnusedDeclaration" } )
public MavenExecutionPlan calculateExecutionPlan( MavenSession session, boolean setup, String... tasks )
    throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
    MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
    PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
    PluginVersionResolutionException
{
    List<TaskSegment> taskSegments =
        lifecycleTaskSegmentCalculator.calculateTaskSegments( session, Arrays.asList( tasks ) );

    TaskSegment mergedSegment = new TaskSegment( false );

    for ( TaskSegment taskSegment : taskSegments )
    {
        mergedSegment.getTasks().addAll( taskSegment.getTasks() );
    }

    return lifecycleExecutionPlanCalculator.calculateExecutionPlan( session, session.getCurrentProject(),
                                                                    mergedSegment.getTasks(), setup );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:21,代码来源:DefaultLifecycleExecutor.java

示例3: loadPluginFully

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
public PluginDescriptor loadPluginFully( Plugin plugin, MavenProject project, MavenSession session )
    throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
    InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,
    PluginVersionNotFoundException
{
    PluginDescriptor pluginDescriptor = loadPluginDescriptor( plugin, project, session );

    try
    {
        pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
    }
    catch ( PluginResolutionException e )
    {
        throw new PluginManagerException( plugin, e.getMessage(), e );
    }

    return pluginDescriptor;
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:19,代码来源:DefaultPluginManager.java

示例4: startProject

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void startProject(MavenProject project, String executionId, XmlPlexusConfiguration process) throws InvalidPluginDescriptorException, PluginResolutionException, PluginDescriptorParsingException, PluginNotFoundException, PluginConfigurationException, MojoFailureException, MojoExecutionException, PluginManagerException {
    Plugin plugin = this.project.getPlugin("org.wildfly.swarm:wildfly-swarm-plugin");

    Xpp3Dom config = getConfiguration(project, executionId);
    Xpp3Dom processConfig = getProcessConfiguration(process);

    Xpp3Dom globalConfig = getGlobalConfig();
    Xpp3Dom mergedConfig = Xpp3DomUtils.mergeXpp3Dom(processConfig, config);
    mergedConfig = Xpp3DomUtils.mergeXpp3Dom(mergedConfig, globalConfig);

    PluginDescriptor pluginDescriptor = this.pluginManager.loadPlugin(plugin, project.getRemotePluginRepositories(), this.repositorySystemSession);
    MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo("start");
    MojoExecution mojoExecution = new MojoExecution(mojoDescriptor, mergedConfig);
    mavenSession.setCurrentProject(project);
    this.pluginManager.executeMojo(mavenSession, mojoExecution);

    List<SwarmProcess> launched = (List<SwarmProcess>) mavenSession.getPluginContext(pluginDescriptor, project).get(SWARM_PROCESS);

    List<SwarmProcess> procs = (List<SwarmProcess>) getPluginContext().get(SWARM_PROCESS);

    if (procs == null) {
        procs = new ArrayList<>();
        getPluginContext().put(SWARM_PROCESS, procs);
    }

    procs.addAll(launched);

    mavenSession.setCurrentProject(this.project);
}
 
开发者ID:wildfly-swarm,项目名称:wildfly-swarm,代码行数:31,代码来源:MultiStartMojo.java

示例5: startProject

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
@SuppressWarnings("unchecked")
protected void startProject(MavenProject project, String executionId, XmlPlexusConfiguration process) throws InvalidPluginDescriptorException, PluginResolutionException, PluginDescriptorParsingException, PluginNotFoundException, PluginConfigurationException, MojoFailureException, MojoExecutionException, PluginManagerException {
    Plugin plugin = this.project.getPlugin("org.wildfly.swarm:wildfly-swarm-plugin");

    Xpp3Dom config = getConfiguration(project, executionId);
    Xpp3Dom processConfig = getProcessConfiguration(process);

    Xpp3Dom globalConfig = getGlobalConfig();
    Xpp3Dom mergedConfig = Xpp3DomUtils.mergeXpp3Dom(processConfig, config);
    mergedConfig = Xpp3DomUtils.mergeXpp3Dom(mergedConfig, globalConfig);

    PluginDescriptor pluginDescriptor = this.pluginManager.loadPlugin(plugin, project.getRemotePluginRepositories(), this.repositorySystemSession);
    MojoDescriptor mojoDescriptor = pluginDescriptor.getMojo("start");
    MojoExecution mojoExecution = new MojoExecution(mojoDescriptor, mergedConfig);
    mavenSession.setCurrentProject(project);
    this.pluginManager.executeMojo(mavenSession, mojoExecution);

    List<SwarmProcess> launched = (List<SwarmProcess>) mavenSession.getPluginContext(pluginDescriptor, project).get("swarm-process");

    List<SwarmProcess> procs = (List<SwarmProcess>) getPluginContext().get("swarm-process");

    if (procs == null) {
        procs = new ArrayList<>();
        getPluginContext().put("swarm-process", procs);
    }

    procs.addAll(launched);

    mavenSession.setCurrentProject(this.project);
}
 
开发者ID:wildfly-swarm-archive,项目名称:ARCHIVE-wildfly-swarm,代码行数:31,代码来源:MultiStartMojo.java

示例6: getPluginComponent

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
public Object getPluginComponent( Plugin plugin, String role, String roleHint )
    throws PluginManagerException, ComponentLookupException
{
    MavenSession session = legacySupport.getSession();

    PluginDescriptor pluginDescriptor;
    try
    {
        pluginDescriptor =
            pluginManager.getPluginDescriptor( plugin, session.getCurrentProject().getRemotePluginRepositories(),
                                               session.getRepositorySession() );

        pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
    }
    catch ( Exception e )
    {
        throw new PluginManagerException( plugin, e.getMessage(), e );
    }

    ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
    try
    {
        Thread.currentThread().setContextClassLoader( pluginDescriptor.getClassRealm() );

        return container.lookup( role, roleHint );
    }
    finally
    {
        Thread.currentThread().setContextClassLoader( oldClassLoader );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:32,代码来源:DefaultPluginManager.java

示例7: getPluginComponents

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
public Map getPluginComponents( Plugin plugin, String role )
    throws ComponentLookupException, PluginManagerException
{
    MavenSession session = legacySupport.getSession();

    PluginDescriptor pluginDescriptor;
    try
    {
        pluginDescriptor =
            pluginManager.getPluginDescriptor( plugin, session.getCurrentProject().getRemotePluginRepositories(),
                                               session.getRepositorySession() );

        pluginManager.setupPluginRealm( pluginDescriptor, session, null, null, null );
    }
    catch ( Exception e )
    {
        throw new PluginManagerException( plugin, e.getMessage(), e );
    }

    ClassLoader oldClassLoader = Thread.currentThread().getContextClassLoader();
    try
    {
        Thread.currentThread().setContextClassLoader( pluginDescriptor.getClassRealm() );

        return container.lookupMap( role );
    }
    finally
    {
        Thread.currentThread().setContextClassLoader( oldClassLoader );
    }
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:32,代码来源:DefaultPluginManager.java

示例8: loadPluginDescriptor

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
public PluginDescriptor loadPluginDescriptor( Plugin plugin, MavenProject project, MavenSession session )
    throws ArtifactResolutionException, PluginVersionResolutionException, ArtifactNotFoundException,
    InvalidVersionSpecificationException, InvalidPluginException, PluginManagerException, PluginNotFoundException,
    PluginVersionNotFoundException
{
    return verifyPlugin( plugin, project, session.getSettings(), session.getLocalRepository() );
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:8,代码来源:DefaultPluginManager.java

示例9: reportExceptions

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
@NbBundle.Messages({
    "TXT_Artifact_Resolution_problem=Artifact Resolution problem",
    "TXT_Artifact_Not_Found=Artifact Not Found",
    "TXT_Cannot_Load_Project=Unable to properly load project",
    "TXT_Cannot_read_model=Error reading project model",
    "TXT_NoMsg=Exception thrown while loading maven project at {0}. See messages.log for more information."
})
private Collection<ProjectProblem> reportExceptions(MavenExecutionResult res) {
    List<ProjectProblem> toRet = new ArrayList<ProjectProblem>();
    for (Throwable e : res.getExceptions()) {
        LOG.log(Level.FINE, "Error on loading project " + project.getProjectDirectory(), e);
        if (e instanceof ArtifactResolutionException) { // XXX when does this occur?
            toRet.add(ProjectProblem.createError(TXT_Artifact_Resolution_problem(), getDescriptionText(e)));
            problemReporter.addMissingArtifact(((ArtifactResolutionException) e).getArtifact());
            
        } else if (e instanceof ArtifactNotFoundException) { // XXX when does this occur?
            toRet.add(ProjectProblem.createError(TXT_Artifact_Not_Found(), getDescriptionText(e)));
            problemReporter.addMissingArtifact(((ArtifactNotFoundException) e).getArtifact());
        } else if (e instanceof ProjectBuildingException) {
            toRet.add(ProjectProblem.createError(TXT_Cannot_Load_Project(), getDescriptionText(e), new SanityBuildAction(project)));
            if (e.getCause() instanceof ModelBuildingException) {
                ModelBuildingException mbe = (ModelBuildingException) e.getCause();
                for (ModelProblem mp : mbe.getProblems()) {
                    LOG.log(Level.FINE, mp.toString(), mp.getException());
                    if (mp.getException() instanceof UnresolvableModelException) {
                        // Probably obsoleted by ProblemReporterImpl.checkParent, but just in case:
                        UnresolvableModelException ume = (UnresolvableModelException) mp.getException();
                        problemReporter.addMissingArtifact(EmbedderFactory.getProjectEmbedder().createProjectArtifact(ume.getGroupId(), ume.getArtifactId(), ume.getVersion()));
                    } else if (mp.getException() instanceof PluginResolutionException) {
                        Plugin plugin = ((PluginResolutionException) mp.getException()).getPlugin();
                        // XXX this is not actually accurate; should rather pick out the ArtifactResolutionException & ArtifactNotFoundException inside
                        problemReporter.addMissingArtifact(EmbedderFactory.getProjectEmbedder().createArtifact(plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion(), "jar"));
                    } else if (mp.getException() instanceof PluginManagerException) {
                        PluginManagerException ex = (PluginManagerException) mp.getException();                            
                        problemReporter.addMissingArtifact(EmbedderFactory.getProjectEmbedder().createArtifact(ex.getPluginGroupId(), ex.getPluginArtifactId(), ex.getPluginVersion(), "jar"));
                    }
                }
            }
        } else {
            String msg = e.getMessage();
            if(msg != null) {
                LOG.log(Level.INFO, "Exception thrown while loading maven project at " + project.getProjectDirectory(), e); //NOI18N
                toRet.add(ProjectProblem.createError(TXT_Cannot_read_model(), msg));
            } else {
                String path = project.getProjectDirectory().getPath();
                toRet.add(ProjectProblem.createError(TXT_Cannot_read_model(), TXT_NoMsg(path)));
                LOG.log(Level.WARNING, "Exception thrown while loading maven project at " + path, e); //NOI18N
            }
        }
    }
    return toRet;
}
 
开发者ID:apache,项目名称:incubator-netbeans,代码行数:53,代码来源:MavenModelProblemsProvider.java

示例10: calculateExecutionPlan

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
MavenExecutionPlan calculateExecutionPlan( MavenSession session, String... tasks )
throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException,
MojoNotFoundException, NoPluginFoundForPrefixException, InvalidPluginDescriptorException,
PluginManagerException, LifecyclePhaseNotFoundException, LifecycleNotFoundException,
PluginVersionResolutionException;
 
开发者ID:gems-uff,项目名称:oceano,代码行数:6,代码来源:LifecycleExecutor.java

示例11: executeMojo

import org.apache.maven.plugin.PluginManagerException; //导入依赖的package包/类
public void executeMojo( MavenProject project, MojoExecution execution, MavenSession session )
    throws MojoExecutionException, ArtifactResolutionException, MojoFailureException, ArtifactNotFoundException,
    InvalidDependencyVersionException, PluginManagerException, PluginConfigurationException
{
    throw new UnsupportedOperationException();
}
 
开发者ID:gems-uff,项目名称:oceano,代码行数:7,代码来源:DefaultPluginManager.java


注:本文中的org.apache.maven.plugin.PluginManagerException类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。