當前位置: 首頁>>代碼示例>>Java>>正文


Java Build.getOutputDirectory方法代碼示例

本文整理匯總了Java中org.apache.maven.model.Build.getOutputDirectory方法的典型用法代碼示例。如果您正苦於以下問題:Java Build.getOutputDirectory方法的具體用法?Java Build.getOutputDirectory怎麽用?Java Build.getOutputDirectory使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.apache.maven.model.Build的用法示例。


在下文中一共展示了Build.getOutputDirectory方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: getCoSFile

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private static File getCoSFile(MavenProject mp, boolean test) {
    if (mp == null) {
        return null;
    }
    Build build = mp.getBuild();
    if (build == null) {
        return null;
    }
    String path = test ? build.getTestOutputDirectory() : build.getOutputDirectory();
    if (path == null) {
        return null;
    }
    File fl = new File(path);
    fl = FileUtil.normalizeFile(fl);
    return  new File(fl, NB_COS);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:17,代碼來源:CosChecker.java

示例2: getTargetDirectory

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private DirectoryResource getTargetDirectory(Project project)
{
   MavenFacet mavenFacet = project.getFacet(MavenFacet.class);
   Build build = mavenFacet.getModel().getBuild();
   String targetFolderName;
   if (build != null && build.getOutputDirectory() != null)
   {
      targetFolderName = mavenFacet.resolveProperties(build.getOutputDirectory());
   }
   else
   {
      targetFolderName = "target" + File.separator + "classes";
   }
   DirectoryResource projectRoot = project.getRoot().reify(DirectoryResource.class);
   return projectRoot.getChildDirectory(targetFolderName);
}
 
開發者ID:forge,項目名稱:wildfly-swarm-addon,代碼行數:17,代碼來源:DetectFractionsCommand.java

示例3: execute

import org.apache.maven.model.Build; //導入方法依賴的package包/類
public void execute() throws MojoExecutionException, MojoFailureException
{
  DomainMojoHelper.setLog(getLog());
  Build build = project.getBuild();
  String outputDir = build.getOutputDirectory();
  System.setProperty("current-project-name", project.getName());
  Properties prop = project.getProperties();
  String domainSerializeType = prop.getProperty("AutoSerializeType");
  if (StringUtils.isEmpty(domainSerializeType))
  {
    domainSerializeType = Type.DS.name();
    DomainMojoHelper.log().info("AutoSerializeType -> default value " + domainSerializeType + "." );
  }
  else{
    DomainMojoHelper.log().info("AutoSerializeType -> " + domainSerializeType +"." );
  }
  
  System.setProperty("current-project-path", project.getBuild().getOutputDirectory());
  DomainMojoHelper.setLoader(Thread.currentThread().getContextClassLoader());
  DomainMojoExecutor executor = new DomainMojoExecutor(domainSerializeType);
  boolean success = executor.execute(outputDir,project.getName());
  if (!success)
  {
    File f = new File(build.getOutputDirectory());
    f.deleteOnExit();
    throw new MojoExecutionException("Domain class instrument failure.");
  }
  project.getProperties();
}
 
開發者ID:iisi-nj,項目名稱:GemFireLite,代碼行數:30,代碼來源:DomainAnnotationMojo.java

示例4: getTargetClassesDirectory

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private File getTargetClassesDirectory() {
  final Build build = project.getBuild();
  if (build != null) {
    final String classesOutputDirectory = build.getOutputDirectory();
    if (StringUtils.isNotEmpty(classesOutputDirectory)) {
      final File targetClasses = new File(classesOutputDirectory);
      if (targetClasses.isDirectory() && (targetClasses.list().length > 0)) {
        logger.debug("Found valid target/classes directory '" + targetClasses.getAbsolutePath() + "'.");
        return targetClasses;
      }
    }
  }
  logger.debug("No target/classes directory found.");
  return null;
}
 
開發者ID:ImmobilienScout24,項目名稱:illegal-transitive-dependency-check,代碼行數:16,代碼來源:IllegalTransitiveDependencyCheck.java

示例5: mergeBuild_OutputDirectory

import org.apache.maven.model.Build; //導入方法依賴的package包/類
protected void mergeBuild_OutputDirectory( Build target, Build source, boolean sourceDominant,
                                           Map<Object, Object> context )
{
    String src = source.getOutputDirectory();
    if ( src != null )
    {
        if ( sourceDominant || target.getOutputDirectory() == null )
        {
            target.setOutputDirectory( src );
            target.setLocation( "outputDirectory", source.getLocation( "outputDirectory" ) );
        }
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:14,代碼來源:ModelMerger.java

示例6: assembleBuildInheritance

import org.apache.maven.model.Build; //導入方法依賴的package包/類
@SuppressWarnings( "unchecked" )
public void assembleBuildInheritance( Build childBuild, Build parentBuild, boolean handleAsInheritance )
{
    // The build has been set but we want to step in here and fill in
    // values that have not been set by the child.

    if ( childBuild.getSourceDirectory() == null )
    {
        childBuild.setSourceDirectory( parentBuild.getSourceDirectory() );
    }

    if ( childBuild.getScriptSourceDirectory() == null )
    {
        childBuild.setScriptSourceDirectory( parentBuild.getScriptSourceDirectory() );
    }

    if ( childBuild.getTestSourceDirectory() == null )
    {
        childBuild.setTestSourceDirectory( parentBuild.getTestSourceDirectory() );
    }

    if ( childBuild.getOutputDirectory() == null )
    {
        childBuild.setOutputDirectory( parentBuild.getOutputDirectory() );
    }

    if ( childBuild.getTestOutputDirectory() == null )
    {
        childBuild.setTestOutputDirectory( parentBuild.getTestOutputDirectory() );
    }

    // Extensions are accumulated
    mergeExtensionLists( childBuild, parentBuild );

    if ( childBuild.getDirectory() == null )
    {
        childBuild.setDirectory( parentBuild.getDirectory() );
    }

    if ( childBuild.getDefaultGoal() == null )
    {
        childBuild.setDefaultGoal( parentBuild.getDefaultGoal() );
    }

    if ( childBuild.getFinalName() == null )
    {
        childBuild.setFinalName( parentBuild.getFinalName() );
    }

    ModelUtils.mergeFilterLists( childBuild.getFilters(), parentBuild.getFilters() );

    List<Resource> resources = childBuild.getResources();
    if ( ( resources == null ) || resources.isEmpty() )
    {
        childBuild.setResources( parentBuild.getResources() );
    }

    resources = childBuild.getTestResources();
    if ( ( resources == null ) || resources.isEmpty() )
    {
        childBuild.setTestResources( parentBuild.getTestResources() );
    }

    // Plugins are aggregated if Plugin.inherit != false
    ModelUtils.mergePluginLists( childBuild, parentBuild, handleAsInheritance );

    // Plugin management :: aggregate
    PluginManagement dominantPM = childBuild.getPluginManagement();
    PluginManagement recessivePM = parentBuild.getPluginManagement();

    if ( ( dominantPM == null ) && ( recessivePM != null ) )
    {
        // FIXME: Filter out the inherited == false stuff!
        childBuild.setPluginManagement( recessivePM );
    }
    else
    {
        ModelUtils.mergePluginLists( childBuild.getPluginManagement(), parentBuild.getPluginManagement(), false );
    }
}
 
開發者ID:gems-uff,項目名稱:oceano,代碼行數:81,代碼來源:DefaultModelInheritanceAssembler.java

示例7: initOutputFileMapping

import org.apache.maven.model.Build; //導入方法依賴的package包/類
List<FileMapping> initOutputFileMapping()
{
  if (propertyOutputFileMapping == null)
  {
    propertyOutputFileMapping = new ArrayList<FileMapping>(10);
    final Build build = project.getBuild();
    final String classesDir = build.getOutputDirectory();
    final File jarFile = new File(classesDir, "META-INF/" + fileName);
    final File targetDir = new File(build.getDirectory());
    final String finalName = build.getFinalName();
    final File deploymentUnitFile =
        new File(targetDir, finalName + "/META-INF/" + fileName);

    propertyOutputFileMapping.add(new FileMapping("pom", new File(targetDir,
        fileName))); // NOPMD
    propertyOutputFileMapping.add(new FileMapping("war", deploymentUnitFile));
    propertyOutputFileMapping.add(new FileMapping("ear", deploymentUnitFile));
    propertyOutputFileMapping.add(new FileMapping("sar", deploymentUnitFile));
    propertyOutputFileMapping.add(new FileMapping("rar", deploymentUnitFile));
    propertyOutputFileMapping.add(new FileMapping("par", deploymentUnitFile));
    propertyOutputFileMapping.add(new FileMapping("jar", jarFile));
    propertyOutputFileMapping.add(new FileMapping("bundle", jarFile));
    propertyOutputFileMapping.add(new FileMapping("ejb", jarFile));
    propertyOutputFileMapping.add(new FileMapping("maven-plugin", jarFile));
    propertyOutputFileMapping.add(new FileMapping("atlassian-plugin", jarFile));
    propertyOutputFileMapping
        .add(new FileMapping("maven-archetype", jarFile));
    propertyOutputFileMapping.add(new FileMapping("eclipse-plugin", new File(
        targetDir, fileName)));
    propertyOutputFileMapping.add(new FileMapping("eclipse-feature",
        new File(targetDir, fileName)));
    propertyOutputFileMapping.add(new FileMapping("eclipse-repository",
        new File(targetDir, fileName)));
    propertyOutputFileMapping.add(new FileMapping("eclipse-update-site",
        new File(targetDir, fileName)));
    propertyOutputFileMapping.add(new FileMapping("targetplatform", new File(
        targetDir, fileName)));
    return propertyOutputFileMapping;
  }

  return propertyOutputFileMapping;
}
 
開發者ID:release-engineering,項目名稱:buildmetadata-maven-plugin,代碼行數:43,代碼來源:PropertyOutputFileMapper.java


注:本文中的org.apache.maven.model.Build.getOutputDirectory方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。