org.apache.maven.model.Build.getDirectory()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(7.9k)|赞(0)|评价(0)|浏览(164)

本文整理了Java中org.apache.maven.model.Build.getDirectory()方法的一些代码示例,展示了Build.getDirectory()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Build.getDirectory()方法的具体详情如下:
包路径:org.apache.maven.model.Build
类名称:Build
方法名:getDirectory

Build.getDirectory介绍

暂无

代码示例

代码示例来源:origin: apache/usergrid

/** @return Returns the full path of created runner.jar file */
public File getRunnerFile() {
  return new File( project.getBuild().getDirectory(), finalName + ".jar" );
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private String completeCalculatedFileName(String file) throws MojoExecutionException {
  return project.getBuild().getDirectory() + "/" + file.replace("/","-");
}

代码示例来源:origin: net.flexmojos.oss/flexmojos-maven-plugin

protected File getOriginalSwfFile()
{
  File bkpOriginalFile =
    new File( build.getDirectory(), build.getFinalName() + "-" + originalClassifierName + ".swf" );
  return bkpOriginalFile;
}

代码示例来源:origin: fabric8io/docker-maven-plugin

protected File getBuildTimestampFile() {
  return new File(project.getBuild().getDirectory(), DOCKER_BUILD_TIMESTAMP);
}

代码示例来源:origin: shrinkwrap/resolver

public File getTargetDirectory() {
  if (getModel().getBuild() == null) {
    return null;
  }
  return new File(getModel().getBuild().getDirectory());
}

代码示例来源:origin: apache/usergrid

public String getProjectOutputJarPath() {
  return Utils.forceSlashOnDir( project.getBuild().getDirectory() ) + project.getBuild().getFinalName() +
      "." + project.getPackaging();
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private File getAndEnsureOutputDirectory() {
  File outputDir = new File(new File(project.getBuild().getDirectory()), DOCKER_EXTRA_DIR);
  if (!outputDir.exists()) {
    outputDir.mkdirs();
  }
  return outputDir;
}

代码示例来源:origin: apache/usergrid

public String getProjectTestOutputJarPath() {
  return Utils.forceSlashOnDir( project.getBuild().getDirectory() ) + project.getBuild().getFinalName() +
      "-tests.jar";
}

代码示例来源:origin: simpligility/android-maven-plugin

public ScreenshotServiceWrapper( DeviceCallback delegate, MavenProject project, Log log )
{
  this.delegate = delegate;
  this.log = log;
  screenshotParentDir = new File( project.getBuild().getDirectory(), "screenshots" );
  create( screenshotParentDir );
}

代码示例来源:origin: org.apache.maven/maven-project

Build build = project.getBuild();
if ( !objectEquals( oBuild.getDirectory(), build.getDirectory() ) )

代码示例来源:origin: simpligility/android-maven-plugin

public UnpackedLibHelper( ArtifactResolverHelper artifactResolverHelper, MavenProject project, Logger log,
             File unpackedLibsFolder )
{
  this.artifactResolverHelper = artifactResolverHelper;
  if ( unpackedLibsFolder != null )
  {
    // if absolute then use it.
    // if relative then make it relative to the basedir of the project.
    this.unpackedLibsDirectory = unpackedLibsFolder.isAbsolute()
        ? unpackedLibsFolder
        : new File( project.getBasedir(), unpackedLibsFolder.getPath() );
  }
  else
  {
    // If not specified then default to target/unpacked-libs
    final File targetFolder = new File( project.getBuild().getDirectory() );
    this.unpackedLibsDirectory = new File( targetFolder, "unpacked-libs" );
  }
  this.log = log;
}

代码示例来源:origin: org.apache.maven/maven-project

throws ModelInterpolationException
Build changedBuild = project.getBuild();
Build dynamicBuild = project.getDynamicBuild();
Build originalInterpolatedBuild = project.getOriginalInterpolatedBuild();
                            debugMessages ) );
dynamicBuild.setDirectory( restoreString( dynamicBuild.getDirectory(),
                       originalInterpolatedBuild.getDirectory(),
                       changedBuild.getDirectory(),
                       project,
                       config,

代码示例来源:origin: jeremylong/DependencyCheck

/**
 * Returns the correct output directory depending on if a site is being
 * executed or not.
 *
 * @param current the Maven project to get the output directory from
 * @return the directory to write the report(s)
 */
protected File getCorrectOutputDirectory(MavenProject current) {
  final Object obj = current.getContextValue(getOutputDirectoryContextKey());
  if (obj != null && obj instanceof File) {
    return (File) obj;
  }
  File target = new File(current.getBuild().getDirectory());
  if (target.getParentFile() != null && "target".equals(target.getParentFile().getName())) {
    target = target.getParentFile();
  }
  return target;
}

代码示例来源:origin: geotools/geotools

/**
 * Copies the {@code .jar} files to the collect directory.
 *
 * @throws MojoExecutionException if the plugin execution failed.
 */
public void execute() throws MojoExecutionException {
  /*
   * Gets the parent "target" directory.
   */
  MavenProject parent = project;
  while (parent.hasParent()) {
    parent = parent.getParent();
  }
  collectDirectory = parent.getBuild().getDirectory();
  /*
   * Now collects the JARs.
   */
  try {
    collect();
  } catch (IOException e) {
    throw new MojoExecutionException("Error collecting the JAR file.", e);
  }
}

代码示例来源:origin: fabric8io/docker-maven-plugin

private File ensureThatArtifactFileIsSet(MavenProject project) {
  Artifact artifact = project.getArtifact();
  if (artifact == null) {
    return null;
  }
  File oldFile = artifact.getFile();
  if (oldFile != null) {
    return oldFile;
  }
  Build build = project.getBuild();
  if (build == null) {
    return null;
  }
  String finalName = build.getFinalName();
  String target = build.getDirectory();
  if (finalName == null || target == null) {
    return null;
  }
  File artifactFile = new File(target, finalName + "." + project.getPackaging());
  if (artifactFile.exists() && artifactFile.isFile()) {
    setArtifactFile(project, artifactFile);
  }
  return null;
}

代码示例来源:origin: org.apache.npanday/dotnet-executable

public String getSourceDirectoryName()
{
  return ( config.isTestCompile() ) ? project.getBuild().getDirectory() + File.separator + "build-test-sources"
    : project.getBuild().getDirectory() + File.separator + "build-sources";
}

代码示例来源:origin: vipshop/Saturn

@SuppressWarnings({ "unchecked" })
@Override
public void execute() throws MojoExecutionException, MojoFailureException {
  if (!CommonUtils.initSaturnHome())
    throw new MojoExecutionException("The ${user.home}/.saturn/caches is not exists");
  Log log = getLog();
  MavenProject project = (MavenProject) getPluginContext().get("project");
  String version = getSaturnVersion(project);
  log.info("Packing the saturn job into a zip file: version:" + version);
  List<File> runtimeLibFiles = new ArrayList<File>();
  List<Artifact> runtimeArtifacts = project.getRuntimeArtifacts();
  for (Artifact artifact : runtimeArtifacts) {
    runtimeLibFiles.add(artifact.getFile());
  }
  runtimeLibFiles.add(new File(project.getBuild().getDirectory(),
      project.getBuild().getFinalName() + "." + project.getPackaging()));
  File zipFile = new File(project.getBuild().getDirectory(),
      project.getArtifactId() + "-" + project.getVersion() + "-" + "app.zip");
  try {
    CommonUtils.zip(runtimeLibFiles, null, zipFile);
  } catch (Exception e) {
    e.printStackTrace();
    throw new MojoExecutionException("zip " + zipFile + " failed", e);
  }
  projectHelper.attachArtifact(project, "zip", "executor", zipFile);
}

代码示例来源:origin: SonarSource/sonar-scanner-maven

private static void removeTarget(MavenProject pom, Collection<String> relativeOrAbsolutePaths) {
 final Path baseDir = pom.getBasedir().toPath().toAbsolutePath().normalize();
 final Path target = Paths.get(pom.getBuild().getDirectory()).toAbsolutePath().normalize();
 final Path targetRelativePath = baseDir.relativize(target);
 relativeOrAbsolutePaths.removeIf(pathStr -> {
  Path path = Paths.get(pathStr).toAbsolutePath().normalize();
  Path relativePath = baseDir.relativize(path);
  return relativePath.startsWith(targetRelativePath);
 });
}

代码示例来源:origin: vipshop/Saturn

File saturnAppLibDir = new File(
    project.getBuild().getDirectory() + System.getProperty("file.separator") + "saturn-run");
if (!saturnAppLibDir.exists()) {
  saturnAppLibDir.mkdirs();
  List<String> runtimeArtifacts = project.getRuntimeClasspathElements();
  for (String path : runtimeArtifacts) {
    File tmp = new File(path);
    copy(tmp, saturnAppLibDir);
  throw new MojoExecutionException("unzip saturn-executor.zip failed", e);
File saturnExecutorDir = new File(saturnHomeCaches, "saturn-executor-" + saturnVersion);

代码示例来源:origin: org.hudsonci.plugins/analysis-core

/**
 * Returns the path to the target folder.
 *
 * @param pom the maven pom
 * @return the path to the target folder
 */
protected FilePath getTargetPath(final MavenProject pom) {
  return new FilePath((VirtualChannel)null, pom.getBuild().getDirectory());
}

相关文章