Package org.apache.tools.ant

Examples of org.apache.tools.ant.BuildException


  protected void checkParameters() throws BuildException
  {
    if (src == null || src.size() == 0)
    {
      throw
        new BuildException(
          "The srcdir attribute must be set.",
          getLocation()
          );
    }
   
    if (destdir != null && !destdir.isDirectory())
    {
      throw
        new BuildException(
          "The destination directory \""
            + destdir
            + "\" does not exist "
            + "or is not a directory.",
          getLocation()
View Full Code Here


        }
      }
   
      if(isError)
      {
        throw new BuildException("Errors were encountered when updating report designs.");
      }
    }
  }
View Full Code Here

  protected void checkParameters() throws BuildException
  {
    if (src == null || src.size() == 0)
    {
      throw
        new BuildException(
          "The srcdir attribute must be set.",
          getLocation()
          );
    }
   
    if (destdir != null && !destdir.isDirectory())
    {
      throw
        new BuildException(
          "The destination directory \""
            + destdir
            + "\" does not exist "
            + "or is not a directory.",
          getLocation()
          );
    }

    if (tempdir != null && !tempdir.isDirectory())
    {
      throw
        new BuildException(
          "The temporary directory \""
            + tempdir
            + "\" does not exist "
            + "or is not a directory.",
          getLocation()
View Full Code Here

        }
      }
   
      if(isError)
      {
        throw new BuildException("Errors were encountered when compiling report designs.");
      }
    }
  }
View Full Code Here

            processor.process(getTaskName(), w);
            w.flush();
        } catch (Exception e)
        {
            e.printStackTrace();
            throw new BuildException(e);
        } finally
        {
            _rootSource.removePageSource(ps);
        }
    }
View Full Code Here

        }

        if( !valid )
        {
            final String message = "Not all components validated.";
            throw new BuildException( message );
        }
    }
View Full Code Here

    void validateParameters()
    {
        if( null == m_classpath )
        {
            final String message = "User did not specify classpath";
            throw new BuildException( message );
        }
    }
View Full Code Here

          }
          else if (this.xmlBlasterScript != null && this.xmlBlasterScript.trim().length() > 0) {
             this.reader = new StringReader(this.xmlBlasterScript);
          }
          else {
             throw new BuildException("Please provide a script");
          }
         
          if (this.responseFile == null)
             this.responseStream = System.out;
          else {
             this.responseStream = new FileOutputStream(this.responseFile);
             closeResponseStream = true;
          }
         
          if (this.updateFile == null)
             this.updateStream = this.responseStream;
          else {
             this.updateStream = new FileOutputStream(this.updateFile);
             closeUpdateStream = true;
          }
          this.interpreter = new XmlScriptClient(this.glob, this.glob.getXmlBlasterAccess(), this.updateStream, this.responseStream, null);

          if (this.prepareForPublish) {
             this.interpreter.registerMsgUnitCb(new I_MsgUnitCb() {
                public boolean intercept(MsgUnit msgUnit) {
                   msgUnit.getQosData().clearRoutes();
                   return true;
                }
             });
          }

          if (verbose > 0System.out.println("scriptFile=" + this.scriptFile + " propertyFile=" + this.propertyFile + " loggingFile=" + this.loggingFile);
          if (verbose > 2System.out.println(this.glob.getProperty().toXml());
         
          this.interpreter.parse(this.reader);
       }
       catch (XmlBlasterException e) {
          log("Scripting to xmlBlaster failed " + getLocation() + ": " + e.getMessage());
          throw new BuildException(e.getMessage());
       }
       catch (Throwable e) {
          log("Scripting to xmlBlaster failed " + getLocation() + ": " + e.toString());
          e.printStackTrace();
          throw new BuildException(e.toString());
       }
       finally {
          if (closeResponseStream) {
             try {
               this.responseStream.close();
View Full Code Here

            {
                throwable = cause;
            }
            if (throwable instanceof FileNotFoundException)
            {
                throw new BuildException("No configuration could be loaded from --> '" + configurationUri + "'");
            }
            else if (throwable instanceof MalformedURLException)
            {
                throw new BuildException("Configuration is not a valid URI --> '" + configurationUri + "'");
            }
            throw new BuildException(throwable);
        }
        finally
        {
            // Set the context class loader back ot its system class loaders
            // so that any processes running after won't be trying to use
View Full Code Here

        initializeContextClassLoader();
        try
        {
            if (this.configurationUri == null)
            {
                throw new BuildException("Configuration is not a valid URI --> '" + this.configurationUri + "'");
            }
            final AndroMDA andromda = AndroMDA.newInstance();
            if (andromda != null)
            {
                andromda.run(
                    this.replaceProperties(ResourceUtils.getContents(configurationUri)));
                andromda.shutdown();
            }
        }
        catch (Throwable throwable)
        {
            final Throwable cause = ExceptionUtils.getCause(throwable);
            if (cause != null)
            {
                throwable = cause;
            }
            if (throwable instanceof FileNotFoundException)
            {
                throw new BuildException("No configuration could be loaded from --> '" + configurationUri + "'");
            }
            throw new BuildException(throwable);
        }
        finally
        {
            // Set the context class loader back ot its system class loaders
            // so that any processes running after won't be trying to use
View Full Code Here

TOP

Related Classes of org.apache.tools.ant.BuildException

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.