Package org.moxie

Examples of org.moxie.MoxieException$MissingParentPomException


    } else if (hasClass("org.jacoco.ant.ReportTask")) {
      Jacoco.report(this);
    }
   
    if ((getProject().getProperty(getFailureProperty()) != null) && failOnError) {
      throw new MoxieException("{0} has failed unit tests! Build aborted!", build.getPom().getArtifactId());
    }
  }
View Full Code Here


      createArgumentsForResourceCollections(builder);

      builder.saveArgs();
    } catch (IOException ioe) {
      getProject().log("Error creating commands file.", Project.MSG_ERR);
      throw new MoxieException("Unable to create the commands file.", ioe);
    }

    // Execute GPL licensed code in separate virtual machine
    getJava().createArg().setValue("--commandsfile");
    getJava().createArg().setValue(builder.getCommandLineFile());
    AntUtil.transferCoberturaDataFileProperty(getJava());
    if (getJava().executeJava() != 0) {
      throw new MoxieException(
          "Error running reports. See messages above.");
    }

    builder.dispose();
  }
View Full Code Here

    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

    for (ZipDependencies deps : dependencies) {
      for (File jar : build.getSolver().getClasspath(deps.getScope(), deps.getTag())) {
        ZipFileSet fs = new ZipFileSet();
        fs.setProject(getProject());
        if (!StringUtils.isEmpty(deps.getPrefix())) {
          throw new MoxieException("Can not specify custom dependencies prefix for mx:onejar!");
        }
        fs.setPrefix("lib/");
        fs.setDir(jar.getParentFile());
        fs.setIncludes(jar.getName());
        addZipfileset(fs);
View Full Code Here

        FileUtils futils = FileUtils.getFileUtils();       
        configFile = futils.resolveFile(basedir, config);
      }
     
      if (!configFile.exists()) {
        throw new MoxieException(MessageFormat.format("Failed to find Moxie descriptor {0}", configFile));
      }
     
      // parse the config files and Moxie settings
      build = new Build(configFile, basedir);
     
      BuildConfig buildConfig = build.getConfig();
      buildConfig.setVerbose(isVerbose());
     
      // set any external properties into the project
      for (Map.Entry<String, String> entry : buildConfig.getExternalProperties().entrySet()) {
        getConsole().debug("setting external property {0} = {1}", entry.getKey(), entry.getValue());
        getProject().setProperty(entry.getKey(), entry.getValue());
      }
     
      build.getPom().setAntProperties(antProperties);     

      // add a reference to the full build object
      getProject().addReference(Key.build.referenceId(), build);     

      // output the build info
      build.describe();
     
      build.setup();
     
      if (isVerbose()) {
        getConsole().separator();
        getConsole().log(getProject().getProperty("ant.version"));
        getConsole().log("Moxie Build Toolkit version " + Toolkit.getVersion() + " compiled on " + Toolkit.getBuildDate());
      }

      Pom pom = build.getPom();
     
      // push all pom properties into project
      Map<String,String> properties = pom.getProperties();
      for (Map.Entry<String, String> entry : properties.entrySet()) {
        getProject().setProperty(entry.getKey(), entry.getValue());
      }

      if (isVerbose()) {
        getConsole().separator();
        getConsole().log("project properties");
      }
     
      setProjectProperty(Key.name, pom.name);
      setProjectProperty(Key.description, pom.description);
      setProjectProperty(Key.groupId, pom.groupId);
      setProjectProperty(Key.artifactId, pom.artifactId);
      setProjectProperty(Key.version, pom.version);
      setProjectProperty(Key.organization, pom.organization);
      setProjectProperty(Key.organizationUrl, pom.organizationUrl);
      setProjectProperty(Key.issuesUrl, pom.issuesUrl);
      setProjectProperty(Key.forumUrl, pom.forumUrl);
      setProjectProperty(Key.socialNetworkUrl, pom.socialNetworkUrl);
      setProjectProperty(Key.blogUrl, pom.blogUrl);
      setProjectProperty(Key.ciUrl, pom.ciUrl);
      setProjectProperty(Key.mavenUrl, pom.mavenUrl);
      setProjectProperty(Key.url, pom.url);
      if (pom.scm != null) {
        setProjectProperty(Key.scmUrl, pom.scm.url);
      }
      setProjectProperty(Key.mainclass, buildConfig.getProjectConfig().getMainclass());
      setProjectProperty(Key.releaseVersion, buildConfig.getPom().releaseVersion);
      setProjectProperty(Key.releaseDate, build.getReleaseDateString());
      setProjectProperty(Key.buildDate, build.getBuildDateString());
      setProjectProperty(Key.buildTimestamp, build.getBuildTimestamp());

      setReference(Key.buildDate, build.getBuildDate());
      setReference(Key.releaseDate, build.getReleaseDate());

      setProjectProperty(Key.outputDirectory, buildConfig.getOutputDirectory(null).toString());
      setProjectProperty(Key.compileOutputDirectory, buildConfig.getOutputDirectory(Scope.compile).toString());
      setProjectProperty(Key.testOutputDirectory, buildConfig.getOutputDirectory(Scope.test).toString());

      setProjectProperty(Key.targetDirectory, buildConfig.getTargetDirectory().toString());
      setProjectProperty(Key.reportTargetDirectory, buildConfig.getReportsTargetDirectory().toString());
      setProjectProperty(Key.javadocTargetDirectory, buildConfig.getJavadocTargetDirectory().toString());
     
      setProjectProperty(Key.siteSourceDirectory, buildConfig.getSiteSourceDirectory().toString());
      setProjectProperty(Key.siteTargetDirectory, buildConfig.getSiteTargetDirectory().toString());

      if (isVerbose()) {
        getConsole().separator();
        getConsole().log("project path properties");
      }
     
      setSourcepath(Key.compileSourcePath, buildConfig, Scope.compile);
      setSourcepath(Key.testSourcePath, buildConfig, Scope.test);
      setClasspath(Key.compileOutputPath, build, Scope.compile, false, false);
      setClasspath(Key.testOutputPath, build, Scope.test, true, false);

      setResourcepath(Key.compileResourcePath, buildConfig, Scope.compile);
      setResourcepath(Key.runtimeResourcePath, buildConfig, Scope.runtime);
      setResourcepath(Key.testResourcePath, buildConfig, Scope.test);

      setDependencypath(Key.compileDependencyPath, build, Scope.compile);
      setDependencypath(Key.runtimeDependencyPath, build, Scope.runtime);
      setDependencypath(Key.testDependencyPath, build, Scope.test);
     
      setClasspath(Key.compileClasspath, build, Scope.compile, false, true);
      setClasspath(Key.runtimeClasspath, build, Scope.runtime, true, true);
      setClasspath(Key.testClasspath, build, Scope.test, true, true);
      setClasspath(Key.buildClasspath, build, Scope.build, false, true);
     
      updateExecutionClasspath();     
    } catch (Exception e) {
      throw new MoxieException(e);
    }
  }
View Full Code Here

  }

  @Override
  public void execute() throws BuildException {
    if (deps == null || deps.size() == 0) {
      throw new MoxieException("Must specify dependencies!");
    }

    if (scope == null) {
      scope = Scope.defaultScope;
    }

    if (destinationDirectory == null) {
      throw new MoxieException("Destination directory must be set!");
    }

    Build build = getBuild();
    titleClass();

    List<Dependency> dependencies = new ArrayList<Dependency>();
    for (ScopedDependency dep : deps) {
      dependencies.add(dep.dependency);     
    }

    List<File> artifacts = build.getSolver().solve(scope,
        dependencies.toArray(new Dependency[dependencies.size()]));

    if (artifacts.size() > 0) {
      getConsole().log(1, "copying {0} artifacts => {1}", artifacts.size(), destinationDirectory);
      try {
        FileUtils.copy(destinationDirectory, artifacts.toArray(new File[artifacts.size()]));
      } catch (Exception e) {
        throw new MoxieException(e);
      }
    }
  }
View Full Code Here

          subCompile.setProject(project);
          subCompile.setShowtitle(false);
          subCompile.perform();
        } catch (Exception e) {
          console.error(e);
          throw new MoxieException(e);
        }
      }
    }

    if (isShowTitle()) {
View Full Code Here

    if (gitDir == null || !gitDir.exists()) {
      // try parent folder
      gitDir = FileKey.resolve(folder.getParentFile(), FS.DETECTED);
    }
    if (gitDir == null || !gitDir.exists()) {
      throw new MoxieException("Can not find .git folder for " + folder);
    }

    String hashid = "";
    try {
      Repository repository = new FileRepository(gitDir);
      ObjectId objectId = repository
          .resolve(org.eclipse.jgit.lib.Constants.HEAD);
      hashid = objectId.getName().toString();
      repository.close();
    } catch (IOException io) {
      io.printStackTrace();
      throw new MoxieException("IOException accessing "
          + gitDir.getAbsolutePath(), io);
    }
    return hashid;
  }
View Full Code Here

    try {
      if (redirectedOutput) {
        redirector.complete();
      }
    } catch (IOException e) {
      throw new MoxieException(e);
    }
   
    // create javadoc jar
    Zip jar = new Zip();
    jar.setProject(getProject());
View Full Code Here

        {
          /*
           * Once --basedir has been used, it cannot be undone without changes to the
           * Main methods.   So, any dirsets have to come before filesets.
           */
          throw new MoxieException("Dirsets have to come before filesets");
        }
        AbstractFileSet fileSet = (AbstractFileSet) collection;
        createArgumentsForFilenames( builder, getDirectoryScanner(fileSet).getIncludedDirectories());
      }
    }
View Full Code Here

TOP

Related Classes of org.moxie.MoxieException$MissingParentPomException

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.