Package org.apache.maven.plugin

Examples of org.apache.maven.plugin.MojoExecutionException


        try {
            getLog().info("Generating Java sources in " + getTargetDirectory() + " from schemas available in " + getDirectory() + "...");
            CodeGen.main((String[]) args.toArray(new String[args.size()]));
        } catch (JiBXException e) {
            Throwable cause = (e.getRootCause() != null) ? e.getRootCause() : e;
            throw new MojoExecutionException(cause.getLocalizedMessage(), cause);
        } catch (Exception e) {
            Throwable cause = (e.getCause() != null) ? e.getCause() : e;
            throw new MojoExecutionException(cause.getLocalizedMessage(), cause);
        }

        getLog().debug("Adding " + getTargetDirectory() + " as source directory...");
        project.addCompileSourceRoot(getTargetDirectory());
    }
View Full Code Here


           
            try {
                if (outFile == null)
                  outFile = inFile;
                if (!MyTestRoundtrip.runTest(mappedClass, null, inFile, outFile)) {
                throw new MojoExecutionException("Class did not round-trip document on document-compare");               
                }
          } catch (Exception e) {
              Throwable cause = (e.getCause() != null) ? e.getCause() : e;
              throw new MojoExecutionException(cause.getLocalizedMessage(), cause);
          } finally
            Thread.currentThread().setContextClassLoader(parent)// Restore
          }
        }
        else
        // Run the DocumentComparator
            if (outFile == null)
            {
                getLog().info("For JiBX document compare you must supply two documents or a class and a document");
              return
            }
            try {
              File fileIn = new File(inFile);
              File fileOut = new File(outFile);
                // compare with output document to be matched
                InputStreamReader brdr = new FileReader(fileIn);
                InputStreamReader frdr = new FileReader(fileOut);
              DocumentComparator comp = new DocumentComparator(System.err);
              if (comp.compare(frdr, brdr))
                getLog().info("JiBX document compare successful");
              else
                throw new MojoExecutionException("Documents are not equal on document-compare");               
            } catch (XmlPullParserException e) {
              Throwable cause = (e.getCause() != null) ? e.getCause() : e;
              throw new MojoExecutionException(cause.getLocalizedMessage(), cause);
            } catch (FileNotFoundException e) {
              Throwable cause = (e.getCause() != null) ? e.getCause() : e;
              throw new MojoExecutionException(cause.getLocalizedMessage(), cause);
            }
         
        }
    }
View Full Code Here

                }
            }

            return set;
        } catch (DependencyResolutionRequiredException e) {
            throw new MojoExecutionException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

     */
    protected Set getProjectCompileClasspathElements(MavenProject project) throws MojoExecutionException {
        try {
            return new HashSet(project.getCompileClasspathElements());
        } catch (DependencyResolutionRequiredException e) {
            throw new MojoExecutionException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

   
            unArchiver.extract();
        }
        catch ( IOException e )
        {
            throw new MojoExecutionException( "Error unpacking file: " + file + "to: " + location, e );
        }
        catch ( ArchiverException e )
        {
            throw new MojoExecutionException( "Error unpacking file: " + file + "to: " + location, e );
        }
    }
View Full Code Here

                }
            }

            return set;
        } catch (DependencyResolutionRequiredException e) {
            throw new MojoExecutionException(e.getLocalizedMessage(), e);
        }
    }
View Full Code Here

            compiler.setVerbose(this.verbose);
            compiler.setVerify(this.verify);
            compiler.compile(classpaths, bindings);
        } catch (JiBXException e) {
            Throwable cause = (e.getRootCause() != null) ? e.getRootCause() : e;
            throw new MojoExecutionException(cause.getLocalizedMessage(), cause);
        }
    }
View Full Code Here

                    modelJar);
            }
        }
        catch (final Throwable throwable)
        {
            throw new MojoExecutionException("Error assembling model", throwable);
        }
    }
View Full Code Here

        }
        catch (Throwable throwable)
        {
            if (throwable instanceof IOException || throwable instanceof ArchiverException)
            {
                throw new MojoExecutionException("Error unpacking file: " + file + "to: " + location, throwable);
            }
        }
    }
View Full Code Here

        }
        catch (Throwable throwable)
        {
            if (throwable instanceof IOException || throwable instanceof ArchiverException)
            {
                throw new MojoExecutionException("Error unpacking file: " + file + "to: " + location, throwable);
            }
        }
    }
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.