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

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

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

Build.getTestOutputDirectory介绍

[英]Get the directory where compiled test classes are placed. The default value is target/test-classes.
[中]获取放置已编译测试类的目录。默认值为target/test-classes

代码示例

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

public String getTestOutputDirectory()
{
  return build.getTestOutputDirectory();
}

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

protected void mergeBuild_TestOutputDirectory( Build target, Build source, boolean sourceDominant,
                        Map<Object, Object> context )
{
  String src = source.getTestOutputDirectory();
  if ( src != null )
  {
    if ( sourceDominant || target.getTestOutputDirectory() == null )
    {
      target.setTestOutputDirectory( src );
      target.setLocation( "testOutputDirectory", source.getLocation( "testOutputDirectory" ) );
    }
  }
}

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

public List getTestClasspathElements()
  throws DependencyResolutionRequiredException
{
  List list = new ArrayList( getArtifacts().size() + 1 );
  list.add( getBuild().getTestOutputDirectory() );
  list.add( getBuild().getOutputDirectory() );
  
  for ( Iterator i = getArtifacts().iterator(); i.hasNext(); )
  {
    Artifact a = (Artifact) i.next();
    if ( a.getArtifactHandler().isAddedToClasspath() )
    {
      // TODO: let the scope handler deal with this
      // NOTE: [jc] scope == 'test' is the widest possible scope, so we don't really need to perform
      // this check...
      // if ( Artifact.SCOPE_TEST.equals( a.getScope() ) || Artifact.SCOPE_COMPILE.equals( a.getScope() ) ||
      //     Artifact.SCOPE_RUNTIME.equals( a.getScope() ) )
      // {
      // }
      File file = a.getFile();
      if ( file == null )
      {
        throw new DependencyResolutionRequiredException( a );
      }
      list.add( file.getPath() );
    }
  }
  return list;
}

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

public List<String> getTestClasspathElements()
  throws DependencyResolutionRequiredException
{
  List<String> list = new ArrayList<>( getArtifacts().size() + 2 );
  String d = getBuild().getTestOutputDirectory();
  if ( d != null )
  {
    list.add( d );
  }
  d = getBuild().getOutputDirectory();
  if ( d != null )
  {
    list.add( d );
  }
  for ( Artifact a : getArtifacts() )
  {
    if ( a.getArtifactHandler().isAddedToClasspath() )
    {
      addArtifactPath( a, list );
    }
  }
  return list;
}

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

return new File( project.getBuild().getTestOutputDirectory() );

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

build.setTestOutputDirectory( alignToBaseDirectory( build.getTestOutputDirectory(), basedir ) );

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

build.setTestOutputDirectory( unalignFromBaseDirectory( build.getTestOutputDirectory(), basedir ) );

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

public static Build cloneBuild( Build src )
{
  if ( src == null )
  {
    return null;
  }
  Build result = new Build();
  
  cloneBuildBaseFields( src, result );
  
  result.setExtensions( cloneList( src.getExtensions(), EXTENSION_CLONER ) );
  result.setOutputDirectory( src.getOutputDirectory() );
  
  result.setScriptSourceDirectory( src.getScriptSourceDirectory() );
  result.setSourceDirectory( src.getSourceDirectory() );
  result.setTestOutputDirectory( src.getTestOutputDirectory() );
  result.setTestSourceDirectory( src.getTestSourceDirectory() );
  
  return result;
}

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

if ( build.getTestOutputDirectory() != null )
  serializer.startTag( NAMESPACE, "testOutputDirectory" ).text( build.getTestOutputDirectory() ).endTag( NAMESPACE, "testOutputDirectory" );

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

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

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

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

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

debugMessages ) );
dynamicBuild.setTestOutputDirectory( restoreString( dynamicBuild.getTestOutputDirectory(),
                            originalInterpolatedBuild.getTestOutputDirectory(),
                            changedBuild.getTestOutputDirectory(),
                            project,
                            config,

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

build.setTestOutputDirectory( alignToBaseDirectory( build.getTestOutputDirectory(), basedir ) );

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

build.setTestOutputDirectory( unalignFromBaseDirectory( build.getTestOutputDirectory(), basedir ) );

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

build.setTestOutputDirectory( alignToBaseDirectory( build.getTestOutputDirectory(), basedir ) );

代码示例来源:origin: hcoles/pitest

private void defaultTargetTestsIfNoValueSet() {
 if (this.getTargetTests() == null || this.getTargetTests().isEmpty()) {
  File tests = new File(this.getProject().getBuild()
  .getTestOutputDirectory());
  this.targetTests = new ArrayList<>(MojoToReportOptionsConverter
    .findOccupiedPackagesIn(tests));
 }
}

代码示例来源:origin: hcoles/pitest

@SuppressWarnings("unchecked")
 private List<File> getCompiledDirs(final MavenProject project)
   throws Exception {
  final List<String> sourceRoots = new ArrayList<>();
  for (final Object artifactObj : FCollection
    .filter(project.getPluginArtifactMap().values(), new DependencyFilter(
      new PluginServices(this.getClass().getClassLoader())))) {

   final Artifact artifact = (Artifact) artifactObj;
   sourceRoots.add(artifact.getFile().getAbsolutePath());
  }
  return convertToRootDirs(project.getTestClasspathElements(),
    Arrays.asList(project.getBuild().getOutputDirectory(),
      project.getBuild().getTestOutputDirectory()),
    sourceRoots);
 }
}

代码示例来源:origin: takari/polyglot-maven

out.write("            .outputDirectory(\"" + build.getOutputDirectory() + "\")" + br);
if (build.getTestOutputDirectory() != null) {
  out.write("            .testOutputDirectory(\"" + build.getTestOutputDirectory() + "\")" + br);

代码示例来源:origin: javalite/activejdbc

instrument(project.getBuild().getTestOutputDirectory());

代码示例来源:origin: takari/polyglot-maven

( b != null && (
  b.getOutputDirectory() != null ||
  b.getTestOutputDirectory() != null ||
  b.getSourceDirectory() != null ||
  b.getTestSourceDirectory() != null ) ) ||
if (b.getTestOutputDirectory() != null )
  p.println( "test_output_directory", b.getTestOutputDirectory() );

相关文章