Package org.moxie

Examples of org.moxie.MoxieException


    if (mainclass == null) {
      ClassSpec cs = new ClassSpec(getProject());
      mainclass = cs;     
      return cs;
    }
    throw new MoxieException("Can only specify one main class");
  }
View Full Code Here


    if (launcher == null) {
      LauncherSpec cs = new LauncherSpec(getProject());
      launcher = cs;     
      return cs;
    }
    throw new MoxieException("Can only specify one launcher class");
  }
View Full Code Here

    }
    try {
      addConfiguredManifest(manifest);
    } catch (ManifestException e1) {
      console.error(e1, "Failed to configure manifest!");
      throw new MoxieException(e1);
    }
   
    if (fatjar) {
      // FatJar generation (merging reference dependencies)
      Object o = getProject().getReference(Key.runtimeClasspath.referenceId());
View Full Code Here

        cache = getBuild().getSolver().getMoxieCache();
      } else {
        // get repository by identifier
        Repository repository = getBuild().getConfig().getRepository(repositoryId);
        if (repository == null) {
          throw new MoxieException("Failed to find repositoryId: {0}", repositoryId);
        }
        if (isSnapshot && !repository.allowSnapshots()) {
          if (allowSnapshots) {
            getConsole().warn("Repository \"{0}\" prohibits snapshots! Overridden by \"allowSnapshots\" attribute!", repository.toString());
          } else {
            throw new MoxieException("Repository \"{0}\" prohibits installation or deployment of snapshots!",
              repository.toString(), repository.getRepositoryUrl());
          }
        }
        String url = repository.getRepositoryUrl();
        if (url.startsWith("file:/")) {         
          try {
            URI uri = new URI(url);
            baseDir = new File(uri);
            cache = new MavenCache(baseDir);           
          } catch (URISyntaxException e) {
            throw new MoxieException("Failed to parse " + url, e);
          }
        } else {
          throw new MoxieException("Invalid url \"{0}\"! Moxie does not support installing or deploying artifacts to remote repositories!", url);
        }
      }     
    } else {
      // return MavenCache for specified directory
      cache = new MavenCache(baseDir);
View Full Code Here

  }

  @Override
  public void execute() throws BuildException {
    if (StringUtils.isEmpty(srcfile)) {
      throw new MoxieException("srcfile attribute is unspecified!");
    }
    if (StringUtils.isEmpty(field)) {
      throw new MoxieException("field attribute is unspecified!");
    }
    if (StringUtils.isEmpty(property)) {
      throw new MoxieException("property attribute is unspecified!");
    }
    File f = new File(srcfile);
    String content = FileUtils.readContent(f, "\n");
    String[] lines = content.split("\n");
    Pattern p = Pattern.compile(field + "\\s*=\\s*\"?(.*?)(\"?\\s*;)");
 
View Full Code Here

     *
     * <p>Not required.</p>
     */
    public void addThen(Sequential t) {
        if (thenTasks != null) {
            throw new MoxieException("You must not nest more than one <then> into <if>");
        }
        thenTasks = t;
    }
View Full Code Here

     *
     * <p>Not required.</p>
     */
    public void addElse(Sequential e) {
        if (elseTasks != null) {
            throw new MoxieException("You must not nest more than one <else> into <if>");
        }
        elseTasks = e;
    }
View Full Code Here

        elseTasks = e;
    }

    public void execute() throws BuildException {
        if (countConditions() > 1) {
            throw new MoxieException("You must not nest more than one condition into <if>");
        }
        if (countConditions() < 1) {
            throw new MoxieException("You must nest a condition into <if>");
        }
        Condition c = (Condition) getConditions().nextElement();
        if (c.eval()) {
            if (thenTasks != null) {
                thenTasks.execute();
View Full Code Here

        public void addThen(Sequential t)
        {
            if (thenTasks != null)
            {
                throw new MoxieException("You must not nest more than one <then> into <elseif>");
            }
            thenTasks = t;
        }
View Full Code Here

        public boolean eval()
            throws MoxieException
        {
            if (countConditions() > 1) {
                throw new MoxieException("You must not nest more than one condition into <elseif>");
            }
            if (countConditions() < 1) {
                throw new MoxieException("You must nest a condition into <elseif>");
            }
            Condition c = (Condition) getConditions().nextElement();

            return c.eval();
        }
View Full Code Here

TOP

Related Classes of org.moxie.MoxieException

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.