Package org.apache.maven.plugin.war.overlay

Examples of org.apache.maven.plugin.war.overlay.DefaultOverlay


    public void testOneZipWithTargetPathOverlay()
        throws Exception
    {
        File webAppDirectory = configureMojo( "one-zip-overlay-targetPath" );

        Overlay overlay = new DefaultOverlay( buildZipArtifact() );
        overlay.setSkip( false );
        overlay.setType( "zip" );
        overlay.setTargetPath( "overridePath" );
        mojo.addOverlay( overlay );

        mojo.execute();

        File foo = new File( webAppDirectory.getPath() + File.separatorChar + "overridePath", "foo.txt" );
View Full Code Here


    public void testOneZipWithForceSkip()
        throws Exception
    {
        File webAppDirectory = configureMojo( "one-zip-overlay-skip" );
        Overlay overlay = new DefaultOverlay( buildZipArtifact() );
        overlay.setSkip( true );
        overlay.setType( "zip" );
        mojo.addOverlay( overlay );

        mojo.execute();
        assertZipContentNotHere( webAppDirectory );
View Full Code Here

            setUpMojo( testId, new ArtifactStub[] { overlay1, overlay2, overlay3 }, new String[] {
                "org/sample/company/test.jsp", "jsp/b.jsp" } );

        // Add the tags
        final List<Overlay> overlays = new ArrayList<Overlay>();
        overlays.add( new DefaultOverlay( overlay1 ) );
        overlays.add( new DefaultOverlay( overlay2 ) );
        overlays.add( new DefaultOverlay( overlay3 ) );
        mojo.setOverlays( overlays );

        // current project ignored. Should be on top of the list
        assertScenariOne( testId, webAppDirectory );
    }
View Full Code Here

        // Add the default project explicitely
        overlays.add( mojo.getCurrentProjectOverlay() );

        // Other overlays
        overlays.add( new DefaultOverlay( overlay1 ) );
        overlays.add( new DefaultOverlay( overlay2 ) );
        overlays.add( new DefaultOverlay( overlay3 ) );
        mojo.setOverlays( overlays );

        // current project ignored. Should be on top of the list
        assertScenariOne( testId, webAppDirectory );
    }
View Full Code Here

        final File webAppDirectory =
            setUpMojo( testId, new ArtifactStub[] { overlay1, overlay2, overlay3 }, new String[] {
                "org/sample/company/test.jsp", "jsp/b.jsp" } );

        Overlay over1 = new DefaultOverlay( overlay3 );
        over1.setExcludes( "**/a.*,**/c.*,**/*.xml" );

        Overlay over2 = new DefaultOverlay( overlay1 );
        over2.setIncludes( "jsp/d/*" );
        over2.setExcludes( "jsp/d/a.jsp" );

        Overlay over3 = new DefaultOverlay( overlay3 );
        over3.setIncludes( "**/*.jsp" );

        Overlay over4 = new DefaultOverlay( overlay2 );

        mojo.setOverlays( new LinkedList<Overlay>() );
        mojo.addOverlay( over1 );
        mojo.addOverlay( over2 );
        mojo.addOverlay( over3 );
View Full Code Here

        final File webAppDirectory =
            setUpMojo( testId, new ArtifactStub[] { overlay1, overlay2, overlay3 }, new String[] {
                "org/sample/company/test.jsp", "jsp/b.jsp" } );

        Overlay over1 = new DefaultOverlay( overlay3 );
        over1.setExcludes( "**/a.*,**/c.*,**/*.xml,jsp/b.jsp" );

        Overlay over2 = new DefaultOverlay( overlay1 );
        over2.setIncludes( "jsp/d/*" );
        over2.setExcludes( "jsp/d/a.jsp" );

        Overlay over3 = new DefaultOverlay( overlay3 );
        over3.setIncludes( "**/*.jsp" );
        over3.setExcludes( "jsp/b.jsp" );

        Overlay over4 = new DefaultOverlay( overlay2 );

        mojo.setOverlays( new LinkedList<Overlay>() );
        mojo.addOverlay( over1 );
        mojo.addOverlay( over2 );
        mojo.addOverlay( over3 );
View Full Code Here

            // Use the cache
            setVariableValueToObject( mojo, "useCache", Boolean.TRUE );
            setVariableValueToObject( mojo, "cacheFile", new File( mojo.getWorkDirectory(), "cache.xml" ) );

            final LinkedList<Overlay> overlays = new LinkedList<Overlay>();
            overlays.add( new DefaultOverlay( overlay ) );
            overlays.add( new DefaultOverlay( overlay2 ) );
            mojo.setOverlays( overlays );

            mojo.execute();

            // Now change the overlay order and make sure the right file is overwritten
            final LinkedList<Overlay> updatedOverlays = new LinkedList<Overlay>();
            updatedOverlays.add( new DefaultOverlay( overlay2 ) );
            updatedOverlays.add( new DefaultOverlay( overlay ) );
            mojo.setOverlays( updatedOverlays );

            mojo.execute();

            assertedFiles.addAll( assertDefaultContent( webAppDirectory ) );
View Full Code Here

            // Use the cache
            setVariableValueToObject( mojo, "useCache", Boolean.TRUE );
            setVariableValueToObject( mojo, "cacheFile", new File( mojo.getWorkDirectory(), "cache.xml" ) );

            final LinkedList<Overlay> overlays = new LinkedList<Overlay>();
            overlays.add( new DefaultOverlay( overlay ) );
            overlays.add( new DefaultOverlay( overlay2 ) );
            mojo.setOverlays( overlays );

            mojo.execute();

            // Now remove overlay one the right file is overwritten
            final LinkedList<Overlay> updatedOverlays = new LinkedList<Overlay>();
            updatedOverlays.add( new DefaultOverlay( overlay2 ) );
            mojo.setOverlays( updatedOverlays );

            // Remove overlay one as a dep
            mojo.getProject().getArtifacts().remove( overlay );
View Full Code Here

    public void testOneZipWithNoSkip()
        throws Exception
    {
        File webAppDirectory = configureMojo( "one-zip" );

        Overlay overlay = new DefaultOverlay( buildZipArtifact() );
        // overlay.setSkip( false );
        overlay.setType( "zip" );
        mojo.addOverlay( overlay );
        mojo.execute();

        File foo = new File( webAppDirectory, "foo.txt" );
        assertTrue( "foo.txt not exists", foo.exists() );
View Full Code Here

    public void testOneZipWithTargetPathOverlay()
        throws Exception
    {
        File webAppDirectory = configureMojo( "one-zip-overlay-targetPath" );

        Overlay overlay = new DefaultOverlay( buildZipArtifact() );
        overlay.setSkip( false );
        overlay.setType( "zip" );
        overlay.setTargetPath( "overridePath" );
        mojo.addOverlay( overlay );

        mojo.execute();

        File foo = new File( webAppDirectory.getPath() + File.separatorChar + "overridePath", "foo.txt" );
View Full Code Here

TOP

Related Classes of org.apache.maven.plugin.war.overlay.DefaultOverlay

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.