public void warn( Throwable error ) { logger.warn( "", error ); }
public void warn( Throwable error ) { logger.warn( "", error ); }
private void cleanupTemporaryFiles( List<File> files ) { for ( File file : files ) { // really don't care if it failed here only log warning if ( !file.delete() ) { logger.warn( "skip failed to delete temporary file : " + file.getAbsolutePath() ); file.deleteOnExit(); } } }
public void warn( CharSequence content ) { logger.warn( toString( content ) ); }
public void warn( CharSequence content, Throwable error ) { logger.warn( toString( content ), error ); }
@Override public void artifactDescriptorMissing( RepositoryEvent event ) { logger.warn( "The POM for " + event.getArtifact() + " is missing, no dependency information available" ); }
public void warn( CharSequence content, Throwable error ) { logger.warn( toString( content ), error ); }
public void warn( CharSequence content ) { logger.warn( toString( content ) ); }
private void handleChecksumFailure( String checksumPolicy, String message, Throwable cause ) throws ChecksumFailedException { if ( ArtifactRepositoryPolicy.CHECKSUM_POLICY_FAIL.equals( checksumPolicy ) ) { throw new ChecksumFailedException( message, cause ); } else if ( !ArtifactRepositoryPolicy.CHECKSUM_POLICY_IGNORE.equals( checksumPolicy ) ) { // warn if it is set to anything other than ignore logger.warn( "*** CHECKSUM FAILED - " + message + " - IGNORING" ); } // otherwise it is ignore }
private void validateActivatedProfiles( List<MavenProject> projects, List<String> activeProfileIds ) { Collection<String> notActivatedProfileIds = new LinkedHashSet<>( activeProfileIds ); for ( MavenProject project : projects ) { for ( List<String> profileIds : project.getInjectedProfileIds().values() ) { notActivatedProfileIds.removeAll( profileIds ); } } for ( String notActivatedProfileId : notActivatedProfileIds ) { logger.warn( "The requested profile \"" + notActivatedProfileId + "\" could not be activated because it does not exist." ); } }
@Override public void artifactDescriptorInvalid( RepositoryEvent event ) { StringBuilder buffer = new StringBuilder( 256 ); buffer.append( "The POM for " ); buffer.append( event.getArtifact() ); buffer.append( " is invalid, transitive dependencies (if any) will not be available" ); if ( logger.isDebugEnabled() ) { logger.warn( buffer + ": " + event.getException().getMessage() ); } else { logger.warn( buffer + ", enable debug logging for more details" ); } }
@Override public void metadataResolved( RepositoryEvent event ) { Exception e = event.getException(); if ( e != null ) { if ( e instanceof MetadataNotFoundException ) { logger.debug( e.getMessage() ); } else if ( logger.isDebugEnabled() ) { logger.warn( e.getMessage(), e ); } else { logger.warn( e.getMessage() ); } } }
public void updateScopeCurrentPom( Artifact artifact, String ignoredScope ) { logger.debug( indent + artifact + " (not setting artifactScope to: " + ignoredScope + "; local artifactScope " + artifact.getScope() + " wins)" ); // TODO better way than static? this might hide messages in a reactor if ( !ignoredArtifacts.contains( artifact ) ) { logger.warn( "\n\tArtifact " + artifact + " retains local artifactScope '" + artifact.getScope() + "' overriding broader artifactScope '" + ignoredScope + "'\n" + "\tgiven by a dependency. If this is not intended, modify or remove the local artifactScope.\n" ); ignoredArtifacts.add( artifact ); } }
private void logMissingSiblingProjectArtifact( Artifact artifact ) { if ( logger == null || !logger.isDebugEnabled() ) { return; } if ( logger.isDebugEnabled() ) { StringBuffer message = new StringBuffer(); message.append( "WARNING: A dependency of the current project (or of one the plugins used in its build) was found in the reactor, " ); message.append( "\nbut had not been built at the time it was requested. It will be resolved from the repository instead." ); message.append( "\n\nCurrent Project: " ).append( getName() ); message.append( "\nRequested Dependency: " ).append( artifact.getId() ); message.append( "\n\nNOTE: You may need to run this build to the 'compile' lifecycle phase, or farther, in order to build the dependency artifact." ); message.append( "\n" ); logger.debug( message.toString() ); } else { logger.warn( "Requested project artifact: " + artifact.getId() + " is not available at this time. Resolving externally." ); } }
private void validatePrerequisitesForNonMavenPluginProjects( List<MavenProject> projects ) { for ( MavenProject mavenProject : projects ) { if ( !"maven-plugin".equals( mavenProject.getPackaging() ) ) { Prerequisites prerequisites = mavenProject.getPrerequisites(); if ( prerequisites != null && prerequisites.getMaven() != null ) { logger.warn( "The project " + mavenProject.getId() + " uses prerequisites" + " which is only intended for maven-plugin projects " + "but not for non maven-plugin projects. " + "For such purposes you should use the maven-enforcer-plugin. " + "See https://maven.apache.org/enforcer/enforcer-rules/requireMavenVersion.html" ); } } } }
public void addProfile( Profile profile ) { String profileId = profile.getId(); Profile existing = profilesById.get( profileId ); if ( existing != null ) { logger.warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + ") with new instance from source: " + profile.getSource() ); } profilesById.put( profile.getId(), profile ); Activation activation = profile.getActivation(); if ( activation != null && activation.isActiveByDefault() ) { activateAsDefault( profileId ); } }
public void addProfile( Profile profile ) { String profileId = profile.getId(); Profile existing = (Profile) profilesById.get( profileId ); if ( existing != null ) { container.getLogger().warn( "Overriding profile: \'" + profileId + "\' (source: " + existing.getSource() + ") with new instance from source: " + profile.getSource() ); } profilesById.put( profile.getId(), profile ); Activation activation = profile.getActivation(); if ( activation != null && activation.isActiveByDefault() ) { activateAsDefault( profileId ); } }
public void checkRequiredMavenVersion( PluginDescriptor pluginDescriptor ) throws PluginIncompatibleException { String requiredMavenVersion = pluginDescriptor.getRequiredMavenVersion(); if ( StringUtils.isNotBlank( requiredMavenVersion ) ) { try { if ( !runtimeInformation.isMavenVersion( requiredMavenVersion ) ) { throw new PluginIncompatibleException( pluginDescriptor.getPlugin(), "The plugin " + pluginDescriptor.getId() + " requires Maven version " + requiredMavenVersion ); } } catch ( RuntimeException e ) { logger.warn( "Could not verify plugin's Maven prerequisite: " + e.getMessage() ); } } }
private Result<? extends ProjectDependencyGraph> buildGraph( MavenSession session, MavenExecutionResult result ) { Result<? extends ProjectDependencyGraph> graphResult = graphBuilder.build( session ); for ( ModelProblem problem : graphResult.getProblems() ) { if ( problem.getSeverity() == ModelProblem.Severity.WARNING ) { logger.warn( problem.toString() ); } else { logger.error( problem.toString() ); } } if ( !graphResult.hasErrors() ) { ProjectDependencyGraph projectDependencyGraph = graphResult.get(); session.setProjects( projectDependencyGraph.getSortedProjects() ); session.setAllProjects( projectDependencyGraph.getAllProjects() ); session.setProjectDependencyGraph( projectDependencyGraph ); } return graphResult; }