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


Java Build.setOutputDirectory方法代碼示例

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


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

示例1: assertWhitespaceHandling

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private Build assertWhitespaceHandling( File whitespace ) throws IOException {
   // Save the real os.name
   String os = System.getProperty( "os.name" );
   System.setProperty( "os.name", "linux" );

   Build build = helper.mojo.project.getBuild();
   build.setOutputDirectory( mkdir( whitespace, build.getOutputDirectory() ) );
   build.setTestOutputDirectory( mkdir( whitespace, build.getTestOutputDirectory() ) );
   helper.mojo.project.setFile( new File( whitespace, "pom.xml" ) );

   assertEquals( "\n", helper.mojo.calcWikiFormatClasspath() );

   helper.classRealmAssertions();

   FileUtils.deleteQuietly( whitespace );

   // Restore the real os.name (to prevent side-effects on other tests)
   System.setProperty( "os.name", os );
   return build;
}
 
開發者ID:ZsZs,項目名稱:FitNesseLauncher,代碼行數:21,代碼來源:CalcWikiFormatClasspathTest.java

示例2: setUp

import org.apache.maven.model.Build; //導入方法依賴的package包/類
@Override
protected void setUp() throws Exception {
  super.setUp();
  MockitoAnnotations.initMocks(this);
  this.classPath = new ArrayList<>(FCollection.map(
      ClassPath.getClassPathElementsAsFiles(), fileToString()));
  when(this.project.getTestClasspathElements()).thenReturn(this.classPath);
  when(this.project.getPackaging()).thenReturn("jar");
  
  final Build build = new Build();
  build.setOutputDirectory("");
  
  when(this.project.getBuild()).thenReturn(build);
  
  when(this.plugins.findToolClasspathPlugins()).thenReturn(
      Collections.emptyList());
  when(this.plugins.findClientClasspathPlugins()).thenReturn(
      Collections.emptyList());
}
 
開發者ID:hcoles,項目名稱:pitest,代碼行數:20,代碼來源:BasePitMojoTest.java

示例3: givenMavenProject

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private MavenProject givenMavenProject(String projectId) {
    MavenProject mavenProject = new MavenProject();
    mavenProject.setGroupId("de.is24.junit");
    mavenProject.setArtifactId(projectId);
    mavenProject.setVersion("42");
    mavenProject.getProperties().setProperty("project.build.sourceEncoding", "UTF-8");
    ArtifactStub projectArtifact = new ArtifactStub();
    projectArtifact.setGroupId("de.is24.junit");
    projectArtifact.setArtifactId(projectId);
    projectArtifact.setVersion("42");
    mavenProject.setArtifact(projectArtifact);
    Build build = new Build();
    build.setOutputDirectory(tempFileRule.getTempFile().getParent());
    mavenProject.setBuild(build);
    return mavenProject;
}
 
開發者ID:ImmobilienScout24,項目名稱:deadcode4j,代碼行數:17,代碼來源:A_ModuleGenerator.java

示例4: ProjectStub

import org.apache.maven.model.Build; //導入方法依賴的package包/類
/**
 * Default constructor
 */
public ProjectStub() {
    MavenXpp3Reader pomReader = new MavenXpp3Reader();
    Model model;
    try {
        model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
        setModel(model);
    } catch (Exception e) {
        throw new RuntimeException(e);
    }

    setGroupId(model.getGroupId());
    setArtifactId(model.getArtifactId());
    setVersion(model.getVersion());
    setName(model.getName());
    setUrl(model.getUrl());
    setPackaging(model.getPackaging());

    Build build = new Build();
    build.setFinalName(model.getArtifactId());
    build.setDirectory(getBasedir() + "/target");
    build.setSourceDirectory(getBasedir() + "/src/main/java");
    build.setOutputDirectory(getBasedir() + "/target/classes");
    build.setTestSourceDirectory(getBasedir() + "/src/test/java");
    build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
    setBuild(build);

    List<String> compileSourceRoots = new ArrayList<String>();
    compileSourceRoots.add(getBasedir() + "/src/main/java");
    setCompileSourceRoots(compileSourceRoots);

    List<String> testCompileSourceRoots = new ArrayList<String>();
    testCompileSourceRoots.add(getBasedir() + "/src/test/java");
    setTestCompileSourceRoots(testCompileSourceRoots);
}
 
開發者ID:pmd,項目名稱:build-tools,代碼行數:38,代碼來源:ProjectStub.java

示例5: setupBuild

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private void setupBuild(Model model) {
  Build build = new Build();

  build.setFinalName(model.getArtifactId());
  build.setDirectory(getBasedir() + "/target");
  build.setSourceDirectory(getBasedir() + "/src/main/java");
  build.setOutputDirectory(getBasedir() + "/target/classes");
  build.setTestSourceDirectory(getBasedir() + "/src/test/java");
  build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
  build.setPlugins(model.getBuild().getPlugins());

  setBuild(build);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:14,代碼來源:ProjectStub.java

示例6: TypeScriptDTOGeneratorMojoProjectStub

import org.apache.maven.model.Build; //導入方法依賴的package包/類
/** Default constructor */
public TypeScriptDTOGeneratorMojoProjectStub() {
  MavenXpp3Reader pomReader = new MavenXpp3Reader();
  Model model;
  try {
    model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
    setModel(model);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }

  setGroupId(model.getGroupId());
  setArtifactId(model.getArtifactId());
  setVersion(model.getVersion());
  setName(model.getName());
  setUrl(model.getUrl());
  setPackaging(model.getPackaging());

  Build build = new Build();
  build.setFinalName(model.getArtifactId());
  build.setDirectory(getBasedir() + "/target");
  build.setSourceDirectory(getBasedir() + "/src/main/java");
  build.setOutputDirectory(getBasedir() + "/target/classes");
  build.setTestSourceDirectory(getBasedir() + "/src/test/java");
  build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
  setBuild(build);

  List compileSourceRoots = new ArrayList();
  compileSourceRoots.add(getBasedir() + "/src/main/java");
  setCompileSourceRoots(compileSourceRoots);

  List testCompileSourceRoots = new ArrayList();
  testCompileSourceRoots.add(getBasedir() + "/src/test/java");
  setTestCompileSourceRoots(testCompileSourceRoots);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:36,代碼來源:TypeScriptDTOGeneratorMojoProjectStub.java

示例7: DynaModuleListGeneratorMojoProjectStub

import org.apache.maven.model.Build; //導入方法依賴的package包/類
/** Default constructor */
public DynaModuleListGeneratorMojoProjectStub() {
  MavenXpp3Reader pomReader = new MavenXpp3Reader();
  Model model;
  try {
    model = pomReader.read(ReaderFactory.newXmlReader(new File(getBasedir(), "pom.xml")));
    setModel(model);
  } catch (Exception e) {
    throw new RuntimeException(e);
  }

  setGroupId(model.getGroupId());
  setArtifactId(model.getArtifactId());
  setVersion(model.getVersion());
  setName(model.getName());
  setUrl(model.getUrl());
  setPackaging(model.getPackaging());
  setDependencies(model.getDependencies());

  Build build = new Build();
  build.setFinalName(model.getArtifactId());
  build.setDirectory(getBasedir() + "/target");
  build.setSourceDirectory(getBasedir() + "/src/main/java");
  build.setOutputDirectory(getBasedir() + "/target/classes");
  build.setTestSourceDirectory(getBasedir() + "/src/test/java");
  build.setTestOutputDirectory(getBasedir() + "/target/test-classes");
  setBuild(build);

  List compileSourceRoots = new ArrayList();
  compileSourceRoots.add(getBasedir() + "/src/main/java");
  setCompileSourceRoots(compileSourceRoots);

  List testCompileSourceRoots = new ArrayList();
  testCompileSourceRoots.add(getBasedir() + "/src/test/java");
  setTestCompileSourceRoots(testCompileSourceRoots);
}
 
開發者ID:eclipse,項目名稱:che,代碼行數:37,代碼來源:DynaModuleListGeneratorMojoProjectStub.java

示例8: initiate

import org.apache.maven.model.Build; //導入方法依賴的package包/類
private void initiate()
{
    MavenXpp3Reader pomReader = new MavenXpp3Reader();
    Model model;
    try
    {
        model = pomReader.read( ReaderFactory.newXmlReader( new File( getBasedir(), "pom.xml" ) ) );
        setModel( model );
    }
    catch ( Exception e )
    {
        throw new RuntimeException( e );
    }

    setGroupId( model.getGroupId() );
    setArtifactId( model.getArtifactId() );
    setVersion( model.getVersion() );
    setName( model.getName() );
    setUrl( model.getUrl() );
    setPackaging( model.getPackaging() );

    Build build = new Build();
    build.setFinalName( model.getArtifactId() );
    build.setDirectory( getBasedir() + "/target" );
    build.setSourceDirectory( getBasedir() + "/src/main/java" );
    build.setOutputDirectory( getBasedir() + "/target/classes" );
    build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
    build.setTestOutputDirectory( getBasedir() + "/target/test-classes" );
    setBuild( build );

    List<String> compileSourceRoots = new ArrayList<String>();
    compileSourceRoots.add( getBasedir() + "/src/main/java" );
    setCompileSourceRoots( compileSourceRoots );

    List<String> testCompileSourceRoots = new ArrayList<String>();
    testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
    setTestCompileSourceRoots( testCompileSourceRoots );
}
 
開發者ID:mojohaus,項目名稱:templating-maven-plugin,代碼行數:39,代碼來源:MavenProjectStub.java

示例9: prepareArtifactTargetClassesDirectory

import org.apache.maven.model.Build; //導入方法依賴的package包/類
static void prepareArtifactTargetClassesDirectory(MavenProject project, Class<?> clazz) {
  final ClassFileReference classFileReference = makeClassFileSet(clazz).iterator().next();
  final Build build = new Build();
  project.setBuild(build);
  build.setDirectory(classFileReference.getClassFile().getParentFile().getAbsolutePath());
  build.setOutputDirectory(classFileReference.getClassFile().getParentFile().getAbsolutePath());
}
 
開發者ID:ImmobilienScout24,項目名稱:illegal-transitive-dependency-check,代碼行數:8,代碼來源:ClassFileReference.java

示例10: CreateSpdxMavenProjectStub

import org.apache.maven.model.Build; //導入方法依賴的package包/類
public CreateSpdxMavenProjectStub() {
    MavenXpp3Reader pomReader = new MavenXpp3Reader();
    Model model;
    try
    {
        model = pomReader.read( ReaderFactory.newXmlReader( new File( getBasedir(), "pom.xml" ) ) );
        setModel( model );
    }
    catch ( Exception e )
    {
        throw new RuntimeException( e );
    }

    setGroupId( model.getGroupId() );
    setArtifactId( model.getArtifactId() );
    setVersion( model.getVersion() );
    setName( model.getName() );
    setUrl( model.getUrl() );
    setPackaging( model.getPackaging() );

    Build build = new Build();
    build.setFinalName( model.getArtifactId() );
    build.setDirectory( getBasedir() + "/target" );
    build.setSourceDirectory( getBasedir() + "/src/main/java" );
    build.setOutputDirectory( getBasedir() + "/target/classes" );
    build.setTestSourceDirectory( getBasedir() + "/src/test/java" );
    build.setTestOutputDirectory( getBasedir() + "/target/test-classes" );
    setBuild( build );

    List<String> compileSourceRoots = new ArrayList<String>();
    compileSourceRoots.add( getBasedir() + "/src/main/java" );
    setCompileSourceRoots( compileSourceRoots );

    List<String> testCompileSourceRoots = new ArrayList<String>();
    testCompileSourceRoots.add( getBasedir() + "/src/test/java" );
    setTestCompileSourceRoots( testCompileSourceRoots );
}
 
開發者ID:spdx,項目名稱:spdx-maven-plugin,代碼行數:38,代碼來源:CreateSpdxMavenProjectStub.java

示例11: testRunsAMutationReportWhenMutationCoverageGoalTrigered

import org.apache.maven.model.Build; //導入方法依賴的package包/類
public void testRunsAMutationReportWhenMutationCoverageGoalTrigered()
    throws Exception {
  this.testee = createPITMojo(createPomWithConfiguration(""));
  final Build build = new Build();
  build.setOutputDirectory("foo");
  this.testee.getProject().setBuild(build);
  this.testee.execute();
  verify(this.executionStrategy).execute(any(File.class),
      any(ReportOptions.class), any(PluginServices.class), anyMap());
}
 
開發者ID:hcoles,項目名稱:pitest,代碼行數:11,代碼來源:PitMojoTest.java

示例12: setUp

import org.apache.maven.model.Build; //導入方法依賴的package包/類
@Override
public void setUp() throws Exception {
  super.setUp();
  Plugin surefire = new Plugin();
  surefire.setGroupId("org.apache.maven.plugins");
  surefire.setArtifactId("maven-surefire-plugin");
  this.surefireConverter = Mockito.mock(SurefireConfigConverter.class);
  List<Plugin> mavenPlugins = Collections.singletonList(surefire);
  when(this.project.getBuildPlugins()).thenReturn(mavenPlugins);
  Build build = new Build();
  build.setOutputDirectory("");
  when(this.project.getBuild()).thenReturn(build);
}
 
開發者ID:hcoles,項目名稱:pitest,代碼行數:14,代碼來源:MojoToReportOptionsConverterTest.java

示例13: 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

示例14: setMojoProject

import org.apache.maven.model.Build; //導入方法依賴的package包/類
protected void setMojoProject(
  Mojo   mojo,
  String name) throws MojoExecutionException
{
  Model model = new Model();
  Build build = new Build();
  build.setOutputDirectory("target/test-build-output");
  model.setBuild(build);
  setMojoField(mojo, name, new MavenProject(model));
}
 
開發者ID:alessandroleite,項目名稱:maven-jdev-plugin,代碼行數:11,代碼來源:AbstractMojoTestCase.java

示例15: createProject

import org.apache.maven.model.Build; //導入方法依賴的package包/類
/**
 * Creates the maven project.
 *
 * @return the created project.
 * @throws IOException never.
 */
protected MavenProject createProject() throws IOException
{
  final BuildMetaDataProjectStub project = new BuildMetaDataProjectStub();
  final Model model = createModel();
  project.setFile(testPomFile);
  project.setBasedir(targetDir.getParentFile());
  project.setModel(model);
  project.setGroupId(model.getGroupId());
  project.setArtifactId(model.getArtifactId());
  final Build build = new Build();
  build.setDirectory(targetDir.getAbsolutePath());
  build.setOutputDirectory(new File(targetDir, "classes").getAbsolutePath());
  model.setBuild(build);

  Writer writer = null;
  try
  {
    writer = new BufferedWriter(new FileWriter(testPomFile));
    project.writeModel(writer);
  }
  finally
  {
    IOUtil.close(writer);
  }
  return project;
}
 
開發者ID:release-engineering,項目名稱:buildmetadata-maven-plugin,代碼行數:33,代碼來源:BuildMetaDataMojoTest.java


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