@Override public void setupMojoExecution( MavenSession session, MavenProject project, MojoExecution mojoExecution ) throws PluginNotFoundException, PluginResolutionException, PluginDescriptorParsingException, MojoNotFoundException, InvalidPluginDescriptorException, NoPluginFoundForPrefixException, LifecyclePhaseNotFoundException, LifecycleNotFoundException, PluginVersionResolutionException { MojoDescriptor mojoDescriptor = mojoExecution.getMojoDescriptor(); if ( mojoDescriptor == null ) { mojoDescriptor = pluginManager.getMojoDescriptor( mojoExecution.getPlugin(), mojoExecution.getGoal(), project.getRemotePluginRepositories(), session.getRepositorySession() ); mojoExecution.setMojoDescriptor( mojoDescriptor ); } mojoExecutionConfigurator( mojoExecution ).configure( project, mojoExecution, MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) ); finalizeMojoConfiguration( mojoExecution ); calculateForkedExecutions( mojoExecution, session, project, new HashSet<MojoDescriptor>() ); }
if ( MojoExecution.Source.CLI.equals( mojoExecution.getSource() ) )
/** * Determines if all projects in the reactor should be purged from their dependencies. When this goal is started on * the command-line, it is always the case. When it is bound to a phase in the lifecycle, it is never the case. * * @return <code>true</code> if all projects in the reactor should be purged, <code>false</code> otherwise. */ private boolean shouldPurgeAllProjectsInReactor() { Source source = mojoExecution.getSource(); return reactorProjects.size() > 1 && source == Source.CLI; }
private void logWelcome() { if (mojoExecution != null && CLI.equals(mojoExecution.getSource())) { getLog().info("Thanks for calling me! Let's see what I can do for you..."); } }
private void logGoodbye() { if (mojoExecution != null && CLI.equals(mojoExecution.getSource())) { getLog().info("Expected something different? Don't like the results? " + "Hop on over to https://github.com/ImmobilienScout24/deadcode4j to learn more!"); } }
if( mojoExecution.getSource() != MojoExecution.Source.LIFECYCLE ) { logger.info("Skipping, not invoked in build lifecycle."); return;