Package org.apache.maven.plugin.testing.stubs

Examples of org.apache.maven.plugin.testing.stubs.MavenProjectStub.addCompileSourceRoot()


        project.setVersion( "1.1.0.0" );
        Resource r = new Resource();
        r.setDirectory( new File( "src/test/resources" ).getAbsoluteFile().getCanonicalPath() );
        r.setIncludes( Arrays.asList( "**/*.*" ) );
        project.addResource( r );
        project.addCompileSourceRoot( new File( "src/test/resources" ).getAbsoluteFile().getCanonicalPath() );

        ManifestPlugin plugin = new ManifestPlugin();
        plugin.setBuildDirectory( "target/tmp/basedir/target" );
        plugin.setOutputDirectory( new File( "target/tmp/basedir/target/classes" ) );

View Full Code Here


    }

    @Test
    public void test_load_header_from_project_classpath() throws Exception {
        MavenProjectStub project = new MavenProjectStub();
        project.addCompileSourceRoot("src/test/resources/check/cp");
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header-in-cp.txt";
        check.project = project;
        check.failIfMissing = false;
View Full Code Here

    }

    @Test
    public void test_load_header_from_project_classpath() throws Exception {
        MavenProjectStub project = new MavenProjectStub();
        project.addCompileSourceRoot("src/test/resources/check/cp");
        LicenseCheckMojo check = new LicenseCheckMojo();
        check.basedir = new File("src/test/resources/check");
        check.header = "header-in-cp.txt";
        check.project = project;
        check.failIfMissing = false;
View Full Code Here

        ArtifactResolver vm = (ArtifactResolver) lookupMojo( getGoal(), new File( testRoot, "pom.xml" ) );

        MavenProject project = new MavenProjectStub();
        //addCompileSourceRoot will generate singletonList if null, which doesn't support a second add.
        setVariableValueToObject( project, "compileSourceRoots", new ArrayList<String>() );
        project.addCompileSourceRoot( new File( testRoot, "src/main/java" ).getAbsolutePath() );

        //required field of mojo
        setVariableValueToObject( vm, "project", project );

        return vm;
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.