Examples of MavenJellyContext


Examples of org.apache.maven.jelly.MavenJellyContext

    {
        assertNotNull( pluginManager );
        pluginManager.initialize();
        pluginManager.setupBaseContext( project );

        MavenJellyContext context = pluginManager.getPluginContext( "maven-jar-plugin" );
        assertNotNull( "check context exists", context );

        assertEquals( "check plugin.resources", fakeHome + FS + "plugins" + FS + "jar" + FS + "plugin-resources",
                      ( (File) context.getVariable( "plugin.resources" ) ).getAbsolutePath() );
        assertEquals( "check plugin property",
                      fakeHome + FS + "plugins" + FS + "jar" + FS + "plugin-resources/foo.bar", context
                          .getVariable( "maven.jar.foo" ) );
    }
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

            userBuildProperties,
            projectBuildProperties,
            projectProperties,
            driverProperties } );

        MavenJellyContext context = new MavenJellyContext();
        context.setVariable( "basedir", basedir );
        MavenUtils.integrateMapInContext( result, context );

        // Values that should be taken from systemProperties.
        assertEquals( "/projects/maven", (String) context.getVariable( "maven.foo" ) );

        // Values that should be taken from userBuildProperties.
        assertEquals( "/opt/maven/repository", (String) context.getVariable( "maven.repo.local" ) );
        assertEquals( "false", (String) context.getVariable( "maven.repo.remote.enabled" ) );
        assertEquals( "jvanzyl", (String) context.getVariable( "maven.username" ) );

        // Values take from projectBuildProperties.
        assertEquals( "maven", (String) context.getVariable( "maven.final.name" ) );

        // Values take from projectProperties.
        assertEquals( mavenRepoRemote, (String) context.getVariable( "maven.repo.remote" ) );

        // Values taken from driver properties.
        assertEquals( basedir + "/target", (String) context.getVariable( "maven.build.dir" ) );
        assertEquals( basedir + "/src", (String) context.getVariable( "maven.build.src" ) );
        assertEquals( basedir + "/target/classes", (String) context.getVariable( "maven.build.dest" ) );

        System.setProperty( "basedir", oldBasedir );
    }
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

        if (lvm == null)
        {
            lvm = new LinkValidatorManager();
            lvm.setExclude(exclude);
            lvm.addLinkValidator(new FileLinkValidator());
            MavenJellyContext ctx;
            if (getProject() == null) {
                //System.out.println("No project set.");
                ctx = new MavenJellyContext();
            } else {
                //System.out.println("Project set:" + getProject());
                ctx = ((Project) getProject()).getContext();
            }
               
            lvm.addLinkValidator(new HTTPLinkValidator(ctx.getProxyHost(), ctx.getProxyPort(), ctx.getProxyUserName(), ctx.getProxyPassword()));
            lvm.addLinkValidator(new MailtoLinkValidator());
            lvm.loadCache(cache);
        }
        return lvm;
    }
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

        checkAttribute( plugin, "plugin" );
        checkAttribute( property, "property" );
        Project project = getMavenContext().getProject();
        try
        {
            MavenJellyContext context = project.getPluginContext( plugin );
            if ( context != null )
            {
                Object value = context.getVariable( property );
                getContext().setVariable( var, value );
            }
            else
            {
                LOGGER.error( "context for plugin '" + plugin + "' in project '" + project + "' is null" );
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

        checkAttribute( plugin, "plugin" );
        checkAttribute( property, "property" );
        Project project = getMavenContext().getProject();
        try
        {
            MavenJellyContext context = project.getPluginContext( plugin );
            if ( context != null )
            {
                Object value = context.getVariable( property );
                getContext().setVariable( var, value );
            }
            else
            {
                LOGGER.error( "context for plugin '" + plugin + "' in project '" + project + "' is null" );
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

        checkAttribute( plugin, "plugin" );
        checkAttribute( property, "property" );
        Project project = getMavenContext().getProject();
        try
        {
            MavenJellyContext context = project.getPluginContext( plugin );
            if ( context != null )
            {
                context.setVariable( property, value );
            }
            else
            {
                LOGGER.error( "context for plugin '" + plugin + "' in project '" + project + "' is null" );
            }
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

    }

    void runBodyTag( Session session )
        throws JellyTagException
    {
        MavenJellyContext context = (MavenJellyContext) getContext();

        getBody().run( context, context.getXMLOutput() );
    }
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

        }

        public void performAction( Session session )
            throws Exception
        {
            MavenJellyContext oldContext = (MavenJellyContext) getContext();

            //GoalToJellyScriptHousingMapper mapper = ( GoalToJellyScriptHousingMapper ) session.getAttribute(
            //PluginManager.GOAL_MAPPER );
            //JellyScriptHousing housing = mapper.getPluginHousing( getName() );
            MavenJellyContext context = housing.getProject().getContext();

            setContext( context );

            runBodyTag( session );
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

        try
        {
            // Lazy goal loading
            Session session = createSession();
            MavenJellyContext baseContext = (MavenJellyContext) session.getAttribute( PluginManager.BASE_CONTEXT );
            GoalToJellyScriptHousingMapper mapper = (GoalToJellyScriptHousingMapper) session
                .getAttribute( PluginManager.GOAL_MAPPER );
            PluginManager pluginManager = (PluginManager) session.getAttribute( PluginManager.PLUGIN_MANAGER );

            Set pluginSet;
View Full Code Here

Examples of org.apache.maven.jelly.MavenJellyContext

     * @throws JellyTagException If an error occurs while executing the tag.
     */
    public void invokeBody( XMLOutput output )
        throws JellyTagException
    {
        MavenJellyContext baseContext = (MavenJellyContext) createSession().getAttribute( PluginManager.BASE_CONTEXT );

        getBody().run( baseContext, output );
    }
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.