Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.MojoFailureException


        Embedder embedder = newEmbedder();
        getLog().info("Running stories as embeddables using embedder " + embedder);
        try {
            embedder.runAsEmbeddables(classNames());
        } catch (RuntimeException e) {
            throw new MojoFailureException("Failed to run stories as embeddables", e);
        }
    }
View Full Code Here


        Embedder embedder = newEmbedder();
        getLog().info("Mapping stories as embeddables using embedder " + embedder);
        try {
            embedder.runAsEmbeddables(classNames());
        } catch (RuntimeException e) {
            throw new MojoFailureException("Failed to map stories as embeddables", e);
        }
    }
View Full Code Here

            {
                FileUtils.forceDelete( felixCacheDir );
            }
            catch ( IOException e )
            {
                throw new MojoFailureException( "failed to delete old Felix cache directory: "
                    + felixCacheDir.getAbsolutePath() );
            }
        }

        // -------------------------------------------------------------------
View Full Code Here

                                      reporter.getErrors().size(),
                                      reporter.getWarnings().size() ) );

        if ( fail )
        {
            throw new MojoFailureException( "Baseline failed, see generated report" );
        }
    }
View Full Code Here

        {
            range = VersionRange.createFromVersionSpec( comparisonVersion );
        }
        catch ( InvalidVersionSpecificationException e )
        {
            throw new MojoFailureException( "Invalid comparison version: " + e.getMessage() );
        }

        final Artifact previousArtifact;
        try
        {
            previousArtifact =
                factory.createDependencyArtifact( project.getGroupId(),
                                                  project.getArtifactId(),
                                                  range,
                                                  project.getPackaging(),
                                                  comparisonClassifier,
                                                  Artifact.SCOPE_COMPILE );

            if ( !previousArtifact.getVersionRange().isSelectedVersionKnown( previousArtifact ) )
            {
                getLog().debug( "Searching for versions in range: " + previousArtifact.getVersionRange() );
                @SuppressWarnings( "unchecked" )
                // type is konwn
                List<ArtifactVersion> availableVersions =
                    metadataSource.retrieveAvailableVersions( previousArtifact, localRepository,
                                                              project.getRemoteArtifactRepositories() );
                filterSnapshots( availableVersions );
                ArtifactVersion version = range.matchVersion( availableVersions );
                if ( version != null )
                {
                    previousArtifact.selectVersion( version.toString() );
                }
            }
        }
        catch ( OverConstrainedVersionException ocve )
        {
            throw new MojoFailureException( "Invalid comparison version: " + ocve.getMessage() );
        }
        catch ( ArtifactMetadataRetrievalException amre )
        {
            throw new MojoExecutionException( "Error determining previous version: " + amre.getMessage(), amre );
        }
View Full Code Here

                String failok = builder.getProperty( "-failok" );
                if ( null == failok || "false".equalsIgnoreCase( failok ) )
                {
                    jarFile.delete();

                    throw new MojoFailureException( "Error(s) found in bundle configuration" );
                }
            }

            // attach bundle to maven project
            jarFile.getParentFile().mkdirs();
View Full Code Here

        if ( hasErrors )
        {
            String failok = analyzer.getProperty( "-failok" );
            if ( null == failok || "false".equalsIgnoreCase( failok ) )
            {
                throw new MojoFailureException( "Error(s) found in manifest configuration" );
            }
        }

        Jar jar = analyzer.getJar();
View Full Code Here

      /*
       * Abort if there are errors
       */
      if (parsingResult.hasErrors()) {
        throw new MojoFailureException("Invalid xml Apam Metadata syntax.");
      }
     
      if (validatorResult.hasErrors()) {
        throw new MojoFailureException("Invalid Apam component declaration");
      }
     
      /*
       * Generate the OBR metadata corresponding to this project
       */

      ApamComponentRepositoryBuilder builder  = new ApamComponentRepositoryBuilder(acr);

            ErrorReport generatorResult = new ErrorReport(getLog());
            String obrProjectContent  = builder.build(context,projectRepository,generatorResult);

      if (generatorResult.hasErrors()) {
        throw new MojoFailureException("Error generating ACR metadata");
      }

      /*
       * Modify the OBR file that will be merged by the felix maven plugin at install
       * time to modify the output repository
View Full Code Here

        getLog().info("Bundle Stability Reached - Waiting for runner service");

        Object runner = waitForRunnerService(felix.getBundleContext());

        if (runner == null) {
            throw new MojoFailureException("Cannot intialize the testing framework");
        }

        getLog().info("Runner Service available");

        invokeRun(runner, felix.getBundleContext());

        try {
            felix.stop();
            felix.waitForStop(5000);
            // Delete felix-cache
            File cache = new File(m_targetDir.getAbsolutePath() + "/felix-cache");
            cache.delete();
        } catch (Exception e) {
            getLog().error(e);
        }

        if (m_totalErrors > 0 || m_totalFailures > 0) {
            if (! testFailureIgnore) {
            throw new MojoFailureException("There are test failures. \n\n"
                    + "Please refer to " + m_reportsDirectory.getAbsolutePath()
                    + " for the individual test results.");
            } else {
                getLog().warn("There are test failures. \n\n"
                    + "Please refer to " + m_reportsDirectory.getAbsolutePath()
View Full Code Here

        }

        if (count == 500) {
            getLog().error("Bundle stability isn't reached after 500 tries");
            dumpBundles(context);
            throw new MojoFailureException("Cannot reach the bundle stability");
        }

        //DEBUG
        Bundle[] bundles = context.getBundles();
        getLog().debug("Bundles List");
        for (int i = 0; i < bundles.length; i++) {
            getLog().debug(bundles[i].getSymbolicName() + " - " + bundles[i].getVersion() + " - " + bundles[i].getState());
        }
        getLog().debug("--------------");
        // END DEBUG

        boolean serviceStability = false;
        count = 0;
        int count1 = 0;
        int count2 = 0;
        while (! serviceStability && count < 500) {
            try {
                ServiceReference[] refs = context.getServiceReferences((String) null, null);
                count1 = refs.length;
                Thread.sleep(500);
                refs = context.getServiceReferences((String) null, null);
                count2 = refs.length;
                serviceStability = count1 == count2;
            } catch (Exception e) {
                getLog().error(e);
                serviceStability = false;
                // Nothing to do, while recheck the condition
            }
            count++;
        }

        if (count == 500) {
            getLog().error("Service stability isn't reached after 500 tries (" + count1 + " != " + count2);
            dumpBundles(context);
            throw new MojoFailureException("Cannot reach the service stability");
        }

        try {
            ServiceReference[] refs = context.getServiceReferences((String) null, null);
            getLog().debug("Service List");
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.MojoFailureException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.