Package org.apache.maven.model

Examples of org.apache.maven.model.Build


    {
        final MavenProject project = createProject( groupId, artifactId, version, properties );

        if ( projectFinalName != null )
        {
            final Build build = new Build();
            build.setFinalName( projectFinalName );

            project.getModel().setBuild( build );
        }

        final MavenProject moduleProject = project;
View Full Code Here


    {
        final MavenProject project = createProject( groupId, artifactId, version, properties );

        if ( projectFinalName != null )
        {
            final Build build = new Build();
            build.setFinalName( projectFinalName );

            project.getModel().setBuild( build );
        }

        final MavenProject artifactProject = project;
View Full Code Here

    }

    public void testShouldInterpolateMultiDotProjectExpression()
        throws ExpressionEvaluationException
    {
        final Build build = new Build();
        build.setFinalName( "final-name" );

        final Model model = new Model();
        model.setBuild( build );

        configSourceStub.setProject( new MavenProject( model ) );
View Full Code Here

        setVariableValueToObject( mojo, "addDefaultLicenseMatchers", Boolean.TRUE );
        setVariableValueToObject( mojo, "useDefaultExcludes", Boolean.TRUE );
        setVariableValueToObject( mojo, "useMavenDefaultExcludes", Boolean.TRUE );
        setVariableValueToObject( mojo, "useEclipseDefaultExcludes", Boolean.TRUE );
        setVariableValueToObject( mojo, "addLicenseHeaders", "false" );
        final Build build = new Build();
        build.setDirectory( buildDirectory.getPath() );
        final MavenProjectStub project = new MavenProjectStub(){
            public Build getBuild()
            {
                return build;
            }
View Full Code Here

   
    // Save the real user.dir
    String dir = System.getProperty("user.dir");
    whitespace.mkdir();
    System.setProperty("user.dir", whitespace.getCanonicalPath());
      Build build = assertWhitespaceHandling(whitespace);
     
    String warning1 = "[WARNING] THERE IS WHITESPACE IN CLASSPATH ELEMENT [%s]%n";
    String warning2 = "Attempting relative path workaround%n";
    assertEquals(format(warning1 + warning2 + warning1 + warning2,
        build.getTestOutputDirectory(), build.getOutputDirectory()),
        helper.logStream.toString());
     
    // Restore the real user.dir (to prevent side-effects on other tests)
    System.setProperty("user.dir", dir);
  }
View Full Code Here

  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();
View Full Code Here

    mojo.resultsDir = new File(System.getProperty("java.io.tmpdir"), "unit_test_results");
    mojo.reportsDir = new File(System.getProperty("java.io.tmpdir"), "unit_test_reports");
    mojo.summaryFile = new File(mojo.resultsDir, "failsafe-summary.xml");
    mojo.project = new MavenProject();
    mojo.project.setFile(new File(getClass().getResource("pom.xml").getPath()));
    mojo.project.setBuild(new Build());
    mojo.project.getBuild().setTestOutputDirectory("test_out");
   
    logStream = new ByteArrayOutputStream();
    mojo.setLog(new DefaultLog(new PrintStreamLogger(
      Logger.LEVEL_INFO, "test", new PrintStream(logStream))));
View Full Code Here

       
        this.plugin = new Plugin();
    this.plugin.setGroupId(this.pluginArtifact.getGroupId());
    this.plugin.setArtifactId(this.pluginArtifact.getArtifactId());
   
        Build build = new Build();
        build.addPlugin(this.plugin);
       
    this.mojo = new TestFitNesseMojo();
    this.mojo.project = new MavenProject();
    this.mojo.resolver = this.artifactResolver;
    this.mojo.fitNesseHelper = mock(FitNesseHelper.class);
View Full Code Here

   @Override
   public void setFinalName(final String finalName)
   {
      MavenFacet mavenFacet = getOrigin().getFacet(MavenFacet.class);
      Model pom = mavenFacet.getPOM();
      Build build = pom.getBuild();
      if (build == null)
      {
         build = new Build();
         pom.setBuild(build);
      }
      pom.getBuild().setFinalName(finalName);
      mavenFacet.setPOM(pom);
   }
View Full Code Here

    public void testShouldInterpolateSourceDirectoryReferencedFromResourceDirectoryCorrectly()
        throws Exception
    {
        Model model = new Model();

        Build build = new Build();
        build.setSourceDirectory( "correct" );

        Resource res = new Resource();
        res.setDirectory( "${project.build.sourceDirectory}" );

        build.addResource( res );

        Resource res2 = new Resource();
        res2.setDirectory( "${pom.build.sourceDirectory}" );

        build.addResource( res2 );

        Resource res3 = new Resource();
        res3.setDirectory( "${build.sourceDirectory}" );

        build.addResource( res3 );

        model.setBuild( build );

        ModelInterpolator interpolator = createInterpolator();
       
        Model out = interpolator.interpolate( model, context );
       
        List outResources = out.getBuild().getResources();
        Iterator resIt = outResources.iterator();

        assertEquals( build.getSourceDirectory(), ( (Resource) resIt.next() ).getDirectory() );
        assertEquals( build.getSourceDirectory(), ( (Resource) resIt.next() ).getDirectory() );
        assertEquals( build.getSourceDirectory(), ( (Resource) resIt.next() ).getDirectory() );
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.model.Build

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.