Examples of BuildException


Examples of org.apache.tools.ant.BuildException

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

Examples of org.apache.tools.ant.BuildException

          }
          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

Examples of org.apache.tools.ant.BuildException

            {
                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

Examples of org.apache.tools.ant.BuildException

        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

Examples of org.apache.tools.ant.BuildException

        initializeContextClassLoader();
        try
        {
            if (this.configurationUri == null)
            {
                throw new BuildException("Configuration is not a valid URI --> '" + this.configurationUri + "'");
            }

            // Create the configuration file from URI
            final Configuration configuration = Configuration.getInstance(this.configurationUri);

            // Create and start the server
            final AndroMDAServer andromdaServer = AndroMDAServer.newInstance();
            if (andromdaServer != null)
            {
                andromdaServer.start(configuration);
            }
        }
        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

Examples of org.apache.tools.ant.BuildException

        initializeContextClassLoader();
        try
        {
            if (this.configurationUri == null)
            {
                throw new BuildException("Configuration is not a valid URI --> '" + this.configurationUri + "'");
            }

            // Create the configuration file
            final Configuration configuration = Configuration.getInstance(this.configurationUri);

            final AndroMDAServer andromdaServer = AndroMDAServer.newInstance();
            if (andromdaServer != null)
            {
                andromdaServer.stop(configuration);
            }
        }
        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

Examples of org.apache.tools.ant.BuildException

 
  @Override
  public void execute() throws BuildException {
   
    if (name==null){
      throw new BuildException("name not specified.");
    }
    if (output==null){
      throw new BuildException("output directory is not specified.");
    }
   
    File fConfFile=null;
   
    if (indexDir!=null){
      File tempF=new File(indexDir,"bobo.spring");
      if (tempF.exists() && tempF.isFile()){
        fConfFile=tempF;
      }
    }
   
    if (fConfFile==null && fieldConf!=null){
      File tempF=new File(fieldConf);
      if (tempF.exists() && tempF.isFile()){
        fConfFile=tempF;
      }
    }
   
    if (fConfFile==null){
      throw new BuildException("Please provide field.xml location by either setting the indexDir or the fieldConf property.");
    }
   
   
    List<FacetHandler<?>> fConf=null;
   
    Thread.currentThread().setContextClassLoader(this.getClass().getClassLoader());
    ApplicationContext appCtx=null;
    try{
      appCtx=new FileSystemXmlApplicationContext("file:"+fConfFile.getAbsolutePath());
      fConf =  (List<FacetHandler<?>>)appCtx.getBean("handlers");
    }
    catch(Exception e){
      throw new BuildException(e.getMessage(),e);
    }
   
    File baseDir=getProject().getBaseDir();
   
    ArrayList<File> copyList=new ArrayList<File>(10);
    copyList.add(new File(new File(baseDir,"webapp"),"bobobase.js"));
    copyList.add(new File(new File(baseDir,"webapp"),"browse.js"));
    copyList.add(new File(new File(baseDir,"webapp"),"style.css"));
    copyList.add(new File(new File(baseDir,"webapp"),"json.js"));
    copyList.add(new File(new File(baseDir,"webapp"),"widgets.js"));
    copyList.add(new File(new File(baseDir,"webapp"),"remote.js"));
   
    File outputDir=new File(new File(baseDir,output),name);
    outputDir.mkdirs();
    try{
      Iterator<File> iter=copyList.iterator();
      while(iter.hasNext()){
        copyFile(iter.next(),outputDir);
      }
    }
    catch(IOException e){
      throw new BuildException(e.getMessage(),e);
    }
   
    try {
      //writeWebXML(outputDir, indexDir);
      writeApplicationJS(outputDir, fConf);
      writeHTML(outputDir, fConf);
    } catch (IOException e) {
      throw new BuildException(e.getMessage(),e);
    }
  }
View Full Code Here

Examples of org.apache.tools.ant.BuildException

            {
                parser.parse(configuration);
            }
            catch (ParseException ex)
            {
                throw new BuildException(ex.getMessage());
            }
            finally
            {
                parser.close();
            }
        }
        catch (IOException ex)
        {
            throw new BuildException(ex.getMessage());
        }
    }
View Full Code Here

Examples of org.apache.tools.ant.BuildException

    /**
     * @deprecated Use the nested outjar element instead.
     */
    public void setOutjar(String parameters)
    {
        throw new BuildException("Use the <outjar> nested element instead of the 'outjar' attribute");
    }
View Full Code Here

Examples of org.apache.tools.ant.BuildException

    public void setTarget(String target)
    {
        configuration.targetClassVersion = ClassUtil.internalClassVersion(target);
        if (configuration.targetClassVersion == 0)
        {
            throw new BuildException("Unsupported target '"+target+"'");
        }
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.