Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.MojoExecutionException


    protected String getPackaging() throws MojoExecutionException
    {
        final String packaging = this.project.getPackaging();
        if (packaging == null || packaging.trim().length() == 0)
        {
            throw new MojoExecutionException(
                "This project must have the packaging defined, when attempting to deploy exploded");
        }
        return packaging;
    }
View Full Code Here


        try
        {
            final File animalQuizSourceFile = new File(this.animalQuizSourcePath);
            if (!animalQuizSourceFile.exists())
            {
                throw new MojoExecutionException("The animal-quiz model location is invalid");
            }
           
            this.copyFile(
                    animalQuizSourceFile,
                    new File(
                            this.animalQuizOutputDirectory,
                            animalQuizSourceFile.getName()));
        }
        catch (final Throwable throwable)
        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured copying the animal-quiz model '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

        try
        {
            final File carRentalSystemSourceFile = new File(this.carRentalSystemSourcePath);
            if (!carRentalSystemSourceFile.exists())
            {
                throw new MojoExecutionException("The car-rental-system model location is invalid");
            }
           
            this.copyFile(
                    carRentalSystemSourceFile,
                    new File(
                            this.carRentalSystemOutputDirectory,
                            carRentalSystemSourceFile.getName()));
        }
        catch (final Throwable throwable)
        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured copying the car-rental-system model '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

                    System.setSecurityManager(oldSm);
                    DefaultResourceManager.clearInstance();
                }
            } catch (Throwable e) {
                e.printStackTrace();
                throw new MojoExecutionException(e.getMessage(), e);
            }
        }
               
        if (project != null && sourceRoot != null) {
            project.addCompileSourceRoot(sourceRoot);
View Full Code Here

        try
        {
            final File mappingSourceDir = new File(this.mappingsSourceDirectory);
            if (!mappingSourceDir.exists())
            {
                throw new MojoExecutionException("Mapping source location is invalid");
            }
           
            final File[] files = mappingSourceDir.listFiles();
            for (int i = 0; i < files.length; i++)
            {
                // Ignore CVS dir/files
                if (!files[i].getName().equalsIgnoreCase("cvs"))
                {
                    this.copyFile(
                            files[i],
                            new File(this.mappingsOutputDirectory, files[i].getName()));
                }
            }
        }
        catch (final Throwable throwable)
        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured copying mappings '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

        try
        {
            final File documentationSourceDir = new File(this.documentationSourceDirectory);
            if (!documentationSourceDir.exists())
            {
                throw new MojoExecutionException("Documentation source location is invalid");
            }
           
            /**
             * Retrieve a directory listing with a filename filter
             */
            FilenameFilter filter = new FilenameFilter()
            {
                final String[] filteredReports =
                {
                        "cvs",
                        "integration.html",
                        "dependencies.html",
                        "dependency-convergence.html",
                        "issue-tracking.html",
                        "mailing-lists.html",
                        "license.html",
                        "project-summary.html",
                        "team-list.html",
                        "source-repository.html"
                };

                public boolean accept(File dir, String name)
                {
                    boolean accept = true;
                    for (int i = 0; i < filteredReports.length; i++)
                    {
                        if (name.equalsIgnoreCase(filteredReports[i]))
                        {
                            accept =  false;
                        }
                    }
                    return accept;
                }
            };
            final File[] files = documentationSourceDir.listFiles(filter);
            for (int i = 0; i < files.length; i++)
            {
                this.copyFile(
                        files[i],
                        new File(
                                this.documentationOutputDirectory,
                                files[i].getName()));
            }
        }
        catch (final Throwable throwable)
        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured copying documentation/reporting artifacts '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

        try
        {
            final File jmiApiSourceFile = new File(this.jmiApiSourcePath);
            if (!jmiApiSourceFile.exists())
            {
                throw new MojoExecutionException("JMI API source location is invalid");
            }
           
            this.unpack(
                    jmiApiSourceFile,
                    new File(this.jmiApiOutputDirectory));
        }
        catch (final Throwable throwable)
        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured unpacking JMI 1.4 API '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

        try
        {
            final File umlDocCarRentalSampleSourceFile = new File(this.umlDocCarRentalSampleSourcePath);
            if (!umlDocCarRentalSampleSourceFile.exists())
            {
                throw new MojoExecutionException("UmlDoc car-rental-sample source location is invalid");
            }
           
            this.unpack(
                    umlDocCarRentalSampleSourceFile,
                    new File(this.umlDocCarRentalSampleOutputDirectory));
        }
        catch (final Throwable throwable)
        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured unpacking UmlDoc for car-rental-sample '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

        {
            if (throwable instanceof MojoExecutionException)
            {
                throw (MojoExecutionException)throwable;
            }
            throw new MojoExecutionException("An error occured creating namespace site document '" +
                this.project.getArtifactId() + "'",
                ExceptionUtils.getRootCause(throwable));
        }
    }
View Full Code Here

                            }
                        }
                    }
                } catch (Exception e) {
                    e.printStackTrace();
                    throw new MojoExecutionException(e.getMessage(), e);
                }
            }
       
            if (!result) {
                throw new MojoExecutionException("Could not delete redundant dirs");
            }               
        }
       
        if (project != null && sourceRoot != null) {
            project.addCompileSourceRoot(sourceRoot);
View Full Code Here

TOP

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

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.