@Override public void projectSkipped( ExecutionEvent event ) { if ( logger.isInfoEnabled() ) { logger.info( "" ); infoLine( '-' ); infoMain( "Skipping " + event.getProject().getName() ); logger.info( "This project has been banned from the build due to previous failures." ); infoLine( '-' ); } }
@Override public void sessionStarted( ExecutionEvent event ) { if ( logger.isInfoEnabled() && event.getSession().getProjects().size() > 1 ) { infoLine( '-' ); infoMain( "Reactor Build Order:" ); logger.info( "" ); final List<MavenProject> projects = event.getSession().getProjects(); for ( MavenProject project : projects ) { int len = LINE_LENGTH - project.getName().length() - project.getPackaging().length() - 2; logger.info( project.getName() + chars( ' ', ( len > 0 ) ? len : 1 ) + '[' + project.getPackaging() + ']' ); } totalProjects = projects.size(); } }
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 addJarManifest(String uberJar, MavenProject project, String mainClass) throws IOException { Path path = Paths.get(uberJar); URI uri = URI.create("jar:" + path.toUri()); String user = System.getProperty("user.name"); String manifestContent = IO.load("manifest-template.mf") .replace("$user", user) .replace("$java", Msc.javaVersion()) .replace("$name", project.getName()) .replace("$version", project.getVersion()) .replace("$groupId", project.getGroupId()) .replace("$organization", project.getOrganization() != null ? U.or(project.getOrganization().getName(), "?") : "?") .replace("$url", U.or(project.getUrl(), "?")) .replace("$main", U.safe(mainClass)); try (FileSystem fs = FileSystems.newFileSystem(uri, U.map())) { Path manifest = fs.getPath("META-INF/MANIFEST.MF"); try (Writer writer = Files.newBufferedWriter(manifest, StandardCharsets.UTF_8, StandardOpenOption.CREATE)) { writer.write(manifestContent); } } }
@Override public void forkedProjectStarted( ExecutionEvent event ) { if ( logger.isInfoEnabled() && event.getMojoExecution().getForkedExecutions().size() > 1 ) { logger.info( "" ); infoLine( '>' ); infoMain( "Forking " + event.getProject().getName() + " " + event.getProject().getVersion() ); infoLine( '>' ); } } }
+ "%n%nSee the dependency-check report for more details.%n%n", mp.getName(), summary.toString()); getLog().warn(msg);
String building = "Building " + event.getProject().getName() + " " + event.getProject().getVersion();
int size; if (getLog().isDebugEnabled()) { getLog().debug(String.format("Collecting descendants of %s", project.getName())); if (mpp.compareTo(mod.getBasedir()) == 0 && descendants.add(mod) && getLog().isDebugEnabled()) { getLog().debug(String.format("Descendant module %s added", mod.getName())); if (project.equals(p.getParent()) || descendants.contains(p.getParent())) { if (descendants.add(p) && getLog().isDebugEnabled()) { getLog().debug(String.format("Descendant %s added", p.getName())); if (p.getModules() != null && p.getModules().contains(modTest.getName()) && descendants.add(modTest) && getLog().isDebugEnabled()) { getLog().debug(String.format("Descendant %s added", modTest.getName())); getLog().debug(String.format("Descendant module %s added", addedDescendant.getName()));
private void validateProjects( List<MavenProject> projects ) { Map<String, MavenProject> projectsMap = new HashMap<>(); for ( MavenProject p : projects ) { String projectKey = ArtifactUtils.key( p.getGroupId(), p.getArtifactId(), p.getVersion() ); projectsMap.put( projectKey, p ); } for ( MavenProject project : projects ) { // MNG-1911 / MNG-5572: Building plugins with extensions cannot be part of reactor for ( Plugin plugin : project.getBuildPlugins() ) { if ( plugin.isExtensions() ) { String pluginKey = ArtifactUtils.key( plugin.getGroupId(), plugin.getArtifactId(), plugin.getVersion() ); if ( projectsMap.containsKey( pluginKey ) ) { logger.warn( project.getName() + " uses " + plugin.getKey() + " as extensions, which is not possible within the same reactor build. " + "This plugin was pulled from the local repository!" ); } } } } }
protected void initializePublisher( @NonNull String packageName ) throws MojoExecutionException { getLog().debug( "Initializing publisher" ); if ( projectName == null || projectName.equals( "" ) ) { projectName = this.session.getCurrentProject().getName(); } try { AndroidPublisher publisher = AndroidPublisherHelper.init( projectName, publisherEmail, p12File ); edits = publisher.edits(); AndroidPublisher.Edits.Insert editRequest = edits.insert( packageName, null ); AppEdit edit = editRequest.execute(); editId = edit.getId(); } catch ( Exception e ) { throw new MojoExecutionException( e.getMessage(), e ); } }
final String msg = String.format("Fatal exception(s) analyzing %s", getProject().getName()); if (this.isFailOnError()) { throw new MojoExecutionException(msg, returnEx); final String msg = String.format("Exception(s) analyzing %s", getProject().getName()); if (getLog().isDebugEnabled()) { getLog().debug(msg, returnEx);
final String msg = String.format("Unable to build dependency graph on project %s", project.getName()); getLog().debug(msg, ex); return new ExceptionCollection(msg, ex);
if (ex.isFatal()) { exCol.setFatal(true); final String msg = String.format("Fatal exception(s) analyzing %s", childProject.getName()); if (this.isFailOnError()) { throw new MojoExecutionException(msg, exCol);
project.getName() + ":" + dependencyNode.getArtifact().getScope()); if (deps != null) { Dependency d = null; project.getName(), d.getDisplayFileName())); } else if (getLog().isDebugEnabled()) { final String msg = String.format("More than 1 dependency was identified in first pass scan of '%s' in project %s", dependencyNode.getArtifact().getId(), project.getName()); getLog().debug(msg); dependencyNode.getArtifact().getId(), dependencyNode.getArtifact().getScope(), project.getName()); getLog().debug(msg); } else { final String msg = String.format("No analyzer could be found for '%s:%s' in project %s", dependencyNode.getArtifact().getId(), dependencyNode.getArtifact().getScope(), project.getName()); getLog().warn(msg); dependencyNode.getArtifact().getId(), project.getName()); getLog().debug(msg); if (exCol == null) {
engine.writeReports(p.getName(), p.getGroupId(), p.getArtifactId(), p.getVersion(), outputDir, getFormat()); } catch (ReportException ex) { if (exCol == null) {
final File includeFile = new File(fileSet.getDirectory(), include).getAbsoluteFile(); if (includeFile.exists()) { engine.scan(includeFile, project.getName());
log.info("Reading existing json file [{}] (for module {})...", gitPropsFile.getAbsolutePath(), project.getName()); log.info("Reading existing properties file [{}] (for module {})...", gitPropsFile.getAbsolutePath(), project.getName()); } catch (CannotReadFileException ex) { log.info("Cannot read properties file [{}] (for module {})...", gitPropsFile.getAbsolutePath(), project.getName()); shouldGenerate = true; if (isJsonFormat) { try (Writer outputWriter = new OutputStreamWriter(outputStream, sourceCharset)) { log.info("Writing json file to [{}] (for module {})...", gitPropsFile.getAbsolutePath(), project.getName()); ObjectMapper mapper = new ObjectMapper(); mapper.writerWithDefaultPrettyPrinter().writeValue(outputWriter, sortedLocalProperties); log.info("Writing properties file to [{}] (for module {})...", gitPropsFile.getAbsolutePath(), project.getName()); log.info("Properties file [{}] is up-to-date (for module {})...", gitPropsFile.getAbsolutePath(), project.getName());