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

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

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

Build.getTestSourceDirectory介绍

[英]Get this element specifies a directory containing the unit test source of the project. The generated build system will compile these directories when the project is being tested. The path given is relative to the project descriptor. The default value is src/test/java.
[中]Get此元素指定包含项目的单元测试源的目录。生成的构建系统将在测试项目时编译这些目录。给定的路径是相对于项目描述符的。默认值为src/test/java

代码示例

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

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

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

protected void mergeBuild_TestSourceDirectory( Build target, Build source, boolean sourceDominant,
                        Map<Object, Object> context )
{
  String src = source.getTestSourceDirectory();
  if ( src != null )
  {
    if ( sourceDominant || target.getTestSourceDirectory() == null )
    {
      target.setTestSourceDirectory( src );
      target.setLocation( "testSourceDirectory", source.getLocation( "testSourceDirectory" ) );
    }
  }
}

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

if ( !objectEquals( oBuild.getTestSourceDirectory(), build.getTestSourceDirectory() ) )

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

build.setTestSourceDirectory( alignToBaseDirectory( build.getTestSourceDirectory(), basedir ) );

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

build.setTestSourceDirectory( unalignFromBaseDirectory( build.getTestSourceDirectory(), 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: org.apache.maven/maven-project

project.addTestCompileSourceRoot( build.getTestSourceDirectory() );

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

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

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

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

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

project.addScriptSourceRoot( build.getScriptSourceDirectory() );
project.addCompileSourceRoot( build.getSourceDirectory() );
project.addTestCompileSourceRoot( build.getTestSourceDirectory() );

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

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

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

debugMessages ) );
dynamicBuild.setTestSourceDirectory( restoreString( dynamicBuild.getTestSourceDirectory(),
                            originalInterpolatedBuild.getTestSourceDirectory(),
                            changedBuild.getTestSourceDirectory(),
                            project,
                            config,

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

build.setTestSourceDirectory( alignToBaseDirectory( build.getTestSourceDirectory(), basedir ) );

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

build.setTestSourceDirectory( unalignFromBaseDirectory( build.getTestSourceDirectory(), basedir ) );

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

build.setTestSourceDirectory( alignToBaseDirectory( build.getTestSourceDirectory(), basedir ) );

代码示例来源:origin: INRIA/spoon

/**
 * Get the list of test directories of the project
 * @return the list of test directories
 */
public List<File> getTestDirectories() {
  List<File> output = new ArrayList<>();
  String sourcePath = null;
  Build build = model.getBuild();
  if (build != null) {
    sourcePath = build.getTestSourceDirectory();
  }
  if (sourcePath == null) {
    sourcePath = Paths.get(directory.getAbsolutePath(), "src", "test", "java").toString();
  }
  File source = new File(sourcePath);
  if (source.exists()) {
    output.add(source);
  }
  File generatedSource = Paths.get(directory.getAbsolutePath(), "target", "generated-test-sources").toFile();
  if (generatedSource.exists()) {
    output.add(generatedSource);
  }
  for (SpoonPom module : modules) {
    output.addAll(module.getTestDirectories());
  }
  return output;
}

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

out.write("            .scriptSourceDirectory(\"" + build.getScriptSourceDirectory() + "\")" + br);
if (build.getTestSourceDirectory() != null) {
  out.write("            .testSourceDirectory(\"" + build.getTestSourceDirectory() + "\")" + br);

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

if ( build.getTestSourceDirectory() != null )
  serializer.attribute( NAMESPACE, "testSourceDirectory", build.getTestSourceDirectory() );

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

b.getTestOutputDirectory() != null ||
  b.getSourceDirectory() != null ||
  b.getTestSourceDirectory() != null ) ) ||
build.getFinalName() != null ||
build.getResources().size() > 0 ||
if (b.getTestSourceDirectory() != null )
  p.println( "test_source_directory", b.getTestSourceDirectory() );

代码示例来源:origin: com.atlassian.maven.plugins/amps-maven-plugin

private File getJavaTestRoot(MavenProject project)
{
  return new File(project.getModel()
      .getBuild()
      .getTestSourceDirectory());
}

相关文章