Refine search
private static void requireValidDockerFilePath(@Nonnull Log log, @Nonnull Path contextDirectory, @Nullable Path dockerfile) throws MojoFailureException { log.info("Path(dockerfile): " + dockerfile); log.info("Path(contextDirectory): " + contextDirectory); if (dockerfile == null && !Files.exists(contextDirectory.resolve("Dockerfile")) && !Files.exists(contextDirectory.resolve("dockerfile"))) { // user did not override the default value log.error("Missing Dockerfile in context directory: " + contextDirectory); throw new MojoFailureException("Missing Dockerfile in context directory: " + contextDirectory); } if (dockerfile != null) { if (!Files.exists(dockerfile)) { log.error("Missing Dockerfile at " + dockerfile); throw new MojoFailureException("Missing Dockerfile at " + dockerfile); } if (!dockerfile.startsWith(contextDirectory)) { log.error("Dockerfile " + dockerfile + " is not a child of the context directory: " + contextDirectory); throw new MojoFailureException("Dockerfile " + dockerfile + " is not a child of the context directory: " + contextDirectory); } } }
report.add(moveIfChanged(file, tmpPath)); if (!file.delete()) { throw new MojoFailureException(format("can not delete %s", file)); throw new MojoFailureException(format("%s should start with %s", absPath, tmpPath)); report.addNew(); } else if (!FileUtils.contentEquals(file, outputFile)) { getLog().info(format("%s has changed", relPath)); if (!outputFile.delete()) { throw new MojoFailureException(format("can not delete %s", outputFile)); File parentDir = outputFile.getParentFile(); if (parentDir.exists() && !parentDir.isDirectory()) { throw new MojoFailureException(format("can not move %s to %s as %s is not a dir", file, outputFile, parentDir)); throw new MojoFailureException(format("can not move %s to %s as dir %s can not be created", file, outputFile, parentDir)); throw new MojoFailureException(format("can not delete %s", file));
@Override public void notifyProgressEvent( Engine engine, int event, File src, int pMode, Throwable error, Object param) throws Exception { if (event == EVENT_END_PROCESSING_SESSION) { getLog().info(format("Freemarker generation took %dms", sw.elapsed(TimeUnit.MILLISECONDS))); sw.reset(); Report report = moveIfChanged(tmp, tmpPathNormalized); if (!tmp.delete()) { throw new MojoFailureException(format("can not delete %s", tmp)); } getLog().info(format("Incremental output update took %dms", sw.elapsed(TimeUnit.MILLISECONDS))); getLog().info(format("new: %d", report.newFiles)); getLog().info(format("changed: %d", report.changedFiles)); getLog().info(format("unchanged: %d", report.unchangedFiles)); } } } );
@Override public void execute() throws MojoExecutionException, MojoFailureException { if (mainClass == null) { throw new MojoExecutionException("main class not configured"); } try (URLClassLoader loader = new Classpath(mavenProject).toClassLoader()) { Path srcdir = new File(mavenProject.getBuild().getSourceDirectory()).toPath(); Path bindir = new File(mavenProject.getBuild().getOutputDirectory()).toPath(); getLog().debug("Using classloader " + loader); getLog().debug(" source: " + srcdir); getLog().debug(" bin: " + bindir); Path output = new ApiParser(srcdir) .with(loader) .export(bindir, mainClass); getLog().info("API file: " + output); } catch (Exception x) { throw new MojoFailureException("ApiTool resulted in exception: ", x); } } }
getLog().info( deviceLogLinePrefix + "Attempting to start " + info.packageName + "/" + info.activity ); if ( shellOutput.getOutput().contains( "Error" ) ) throw new MojoFailureException( shellOutput.getOutput() ); if ( pid == -1 ) throw new MojoFailureException( "Cannot find stated process " + info.packageName ); getLog().info( deviceLogLinePrefix + "Process " + debugPort + " launched" ); throw new MojoFailureException( "Cannot create forward tcp: " + debugPort + " jdwp: " + pid, ex throw new MojoFailureException( deviceLogLinePrefix + "Input/Output error", ex ); throw new MojoFailureException( deviceLogLinePrefix + "Command timeout", ex ); throw new MojoFailureException( deviceLogLinePrefix + "ADB rejected the command", ex ); throw new MojoFailureException( deviceLogLinePrefix + "Unresponsive command", ex );
throw new MojoFailureException("unable to open file", ex); log.info("Assembled " + count + " scripts");
if ( mavenTestSkip ) getLog().info( "maven.test.skip set - skipping tests" ); return false; getLog().info( "maven.skip.tests set - skipping tests" ); return false; getLog().info( "android.test.skip set - skipping tests" ); return false; throw new MojoFailureException( "android.test.skip must be configured as 'true', 'false' or 'auto'." );
throw new MojoFailureException("can not write to output dir: " + outputPath); throw new MojoFailureException("templates not found in dir: " + outputPath); break; default: throw new MojoFailureException("scope must be compile or test"); getLog().info(format("Freemarker generation:\n scope: %s,\n config: %s,\n templates: %s", scope, config.getAbsolutePath(), templatesPath)); final File tmp = Files.createTempDirectory("freemarker-tmp").toFile(); getLog().info("Adding maven data loader"); settings.setEngineAttribute(MavenDataLoader.MAVEN_DATA_ATTRIBUTE, new MavenData(project)); settings.add(Settings.NAME_DATA, format("maven: %s()", MavenDataLoader.class.getName())); throw new MojoFailureException(MiscUtil.causeMessages(e), e);
getLog().info( "Attempting to update manifest " + destinationManifestFile ); getLog().debug( " usesSdk=" + parsedUsesSdk ); getLog().debug( " versionName=" + parsedVersionName ); throw new MojoFailureException( "XML I/O error: " + destinationManifestFile, e ); throw new MojoFailureException( "Unable to prepare XML parser", e ); throw new MojoFailureException( "Unable to parse XML: " + destinationManifestFile, e ); throw new MojoFailureException( "Unable write XML: " + destinationManifestFile, e );
try getLog().info( "Deleting the old " + imageType ); throw new MojoFailureException( message ); for ( AbstractInputStreamContent contentGraphic : contentGraphicList ) getLog().info( "Uploading " + imageType + " " + i + " out of " + contentGraphicList.size() ); images.upload( packageName, editId, locale, imageType, contentGraphic ).execute(); i++;
final String msg = "Unable to purge the local NVD when using a non-default connection string"; if (this.isFailOnError()) { throw new MojoFailureException(msg); if (db.exists()) { if (db.delete()) { getLog().info("Database file purged; local copy of the NVD has been removed"); } else { final String msg = String.format("Unable to delete '%s'; please delete the file manually", db.getAbsolutePath()); if (this.isFailOnError()) { throw new MojoFailureException(msg); final String msg = String.format("Unable to purge database; the database file does not exist: %s", db.getAbsolutePath()); if (this.isFailOnError()) { throw new MojoFailureException(msg);
public void execute() throws MojoExecutionException, MojoFailureException getLog().info( "Skipping OpenAPI specification resolution" ); return; getLog().info( "Resolving OpenAPI specification.." ); } catch (Exception e1) { getLog().error( "Error reading/deserializing openapi file" , e); throw new MojoFailureException(e.getMessage(), e); throw new MojoFailureException(e.getMessage(), e); throw new MojoFailureException(e.getMessage(), e); } catch (IOException e) { getLog().error( "Error writing API specification" , e);
if ( versionNameAttrib == null || ! StringUtils.equals( parsedVersionName, versionNameAttrib.getValue() ) ) getLog().info( "Setting " + ATTR_VERSION_NAME + " to " + parsedVersionName ); manifestElement.setAttribute( ATTR_VERSION_NAME, parsedVersionName ); dirty = true; || ( parsedVersionCodeAutoIncrement && parsedVersionCodeUpdateFromVersion ) ) throw new MojoFailureException( "versionCodeAutoIncrement, versionCodeUpdateFromVersion and versionCode " + "are mutual exclusive. They cannot be specified at the same time. Please specify either " + "versionCodeAutoIncrement, versionCodeUpdateFromVersion or versionCode!" ); getLog().info( "Setting " + ATTR_VERSION_CODE + " to " + parsedVersionCode ); manifestElement.setAttribute( ATTR_VERSION_CODE, String.valueOf( parsedVersionCode ) ); dirty = true; .equals( parsedSharedUserId, sharedUserIdAttrib.getValue() ) ) getLog().info( "Setting " + ATTR_SHARED_USER_ID + " to " + parsedSharedUserId ); manifestElement.setAttribute( ATTR_SHARED_USER_ID, parsedSharedUserId ); dirty = true;
throw new MojoFailureException( "\n\n One of the parameters android.deployapk.packagename " + "or android.deployapk.filename is required. \n" ); getLog().info( "Ignoring invalid file parameter." ); getLog().debug( response.getMessage() );
/** * Deploy the app to the attached devices and emulators. * * @throws MojoExecutionException * @throws MojoFailureException */ public void execute() throws MojoExecutionException, MojoFailureException { ConfigHandler configHandler = new ConfigHandler( this, this.session, this.execution ); configHandler.parseConfiguration(); ValidationResponse response = DeployApk.validFileParameter( parsedFilename ); if ( response.isValid() ) { getLog().info( "Deploying apk file at " + parsedFilename ); deployApk( parsedFilename ); } else { throw new MojoFailureException( response.getMessage() ); } } }
@Override public void execute() throws MojoFailureException { if (testFailureIgnore && !isTestingPhase()) { getLog().info("testFailureIgnore property is ignored in non test phases"); } if (!(skipTestPhase() || skipExecution())) { if (installDirectory == null) { installDirectory = workingDirectory; } try { execute(new FrontendPluginFactory(workingDirectory, installDirectory, new RepositoryCacheResolver(repositorySystemSession))); } catch (TaskRunnerException e) { if (testFailureIgnore && isTestingPhase()) { getLog().error("There are test failures.\nFailed to run task: " + e.getMessage(), e); } else { throw new MojoFailureException("Failed to run task", e); } } catch (FrontendException e) { throw MojoUtils.toMojoFailureException(e); } } else { getLog().info("Skipping execution."); } }
getLog().info( deviceLogLinePrefix + "Running tests for specified test package: " + str ); getLog().info( deviceLogLinePrefix + "Running tests for specified test classes/methods: " + parsedClasses ); getLog().info( deviceLogLinePrefix + "Running instrumentation tests in " + parsedInstrumentationPackage ); try if ( testRunListener.hasFailuresOrErrors() && !testFailSafe ) throw new MojoFailureException( deviceLogLinePrefix + "Tests failed on device." ); throw new MojoFailureException( deviceLogLinePrefix + "Test run failed to complete: " + testRunListener.getTestRunFailureCause() ); throw new MojoFailureException( deviceLogLinePrefix + testRunListener.getExceptionMessages() );
throw new MojoFailureException( "Incomplete listing" ); getLog().info( "Updating the listing for " + packageName ); final Listing listing = new Listing(); listing.setTitle( title );
getLog().info( deviceLogLinePrefix + "Running ui uiautomator tests in" + parsedJarFile ); try if ( testRunListener.hasFailuresOrErrors() && !isIgnoreTestFailures() ) throw new MojoFailureException( deviceLogLinePrefix + "Tests failed on device." ); throw new MojoFailureException( deviceLogLinePrefix + "Test run failed to complete: " + testRunListener.getTestRunFailureCause() ); throw new MojoFailureException( deviceLogLinePrefix + testRunListener.getExceptionMessages() );
monkeyTestRunner.setMonitorNativeCrash( parsedMonitorNativeCrashes ); getLog().info( deviceLogLinePrefix + "Running ui monkey tests" ); try if ( testRunListener.hasFailuresOrErrors() && !isIgnoreTestFailures() ) throw new MojoFailureException( deviceLogLinePrefix + "Tests failed on device." ); throw new MojoFailureException( deviceLogLinePrefix + "Test run failed to complete: " + testRunListener.getTestRunFailureCause() ); throw new MojoFailureException( deviceLogLinePrefix + testRunListener.getExceptionMessages() );