Package org.apache.maven.project

Examples of org.apache.maven.project.Project


        String projectString = project.getProjectAsString();
        Expression e = JellyUtils.decomposeExpression( projectString, context );
        String newProjectString = e.evaluateAsString( context );
        // We can use a Reader and not an URL/path here to read
        // the POM because this is a memory model without XML entities.
        project = new Project( new StringReader( newProjectString ) );
        return project;
    }
View Full Code Here


    }

    List readMavenXml( Project project, GoalToJellyScriptHousingMapper mapper )
        throws MavenException
    {
        Project p = project;
        List projectHousings = new ArrayList();

        // Project's Jelly script
        while ( p != null )
        {
            if ( p.hasMavenXml() )
            {
                File mavenXml = p.getMavenXml();

                JellyScriptHousing jellyScriptHousing = createJellyScriptHousing( project, mavenXml );
                jellyScriptHousing.parse( mapper );
                projectHousings.add( jellyScriptHousing );
            }
            p = p.getParent();
        }
        return projectHousings;
    }
View Full Code Here

    }

    private MavenJellyContext initialiseHousingPluginContext( JellyScriptHousing housing, MavenJellyContext baseContext )
        throws Exception
    {
        Project project = housing.getProject();

        // TODO: I think this should merge into pluginContext, but that seems to break existing jelly as it depends on
        // that kind of warped scoping. Fix this in 1.1
        MavenUtils.integrateMapInContext( housing.getPluginProperties(), baseContext );

        /*
         // Instead, we must go through each property and merge from previous plugin contexts, or the original property
         // first integrate new ones
         MavenUtils.integrateMapInContext( project.getContext().getVariables(), baseContext );
         // now integrate properties that have a new value
         Properties p = new Properties();
         for ( Iterator i = housing.getPluginProperties().keySet().iterator(); i.hasNext(); )
         {
         String key = (String) i.next();
         Object value = project.getContext().getVariable( key );
         if ( value != null )
         {
         baseContext.setVariable( key, value );
         }
         else
         {
         p.setProperty( key, (String) housing.getPluginProperties().get( key ) );
         }
         }
         MavenUtils.integrateMapInContext( p, baseContext );
         // but leave alone anything in there that is not a plugin property, and already exists in baseContext
         */
        // TODO necessary to create a new one every time?
        MavenJellyContext pluginContext = new MavenJellyContext( baseContext );
        project.pushContext( pluginContext );
        pluginContext.setInherit( true );
        pluginContext.setVariable( "context", pluginContext );
        pluginContext.setVariable( "plugin", project );
        pluginContext.setVariable( "plugin.dir", housing.getPluginDirectory() );
        pluginContext.setVariable( "plugin.resources", new File( housing.getPluginDirectory(), "plugin-resources" ) );
View Full Code Here

        throws MavenException, UnknownPluginException
    {
        JellyScriptHousing housing = (JellyScriptHousing) artifactIdToHousingMap.get( id );
        if ( housing != null )
        {
            Project project = housing.getProject();
            if ( baseContext.equals( project.getContext().getParent() ) )
            {
                LOGGER.debug( "Plugin context for " + id + " already initialised for this base context" );
                return project.getContext();
            }
            else
            {
                LOGGER.debug( "Plugin context for " + id
                    + " not initialised for this base context: initialising inside getPluginContext" );
View Full Code Here

     * A unit test for JUnit
     */
    public void testTouchstone()
        throws Exception
    {
        Project p = MavenUtils.getProject( new File( basedir, "project.xml" ) );
       
        // A value that is specified in project.properties is interpolated into the
        // project.xml file so that when we access the connection value we get the
        // specified anonymous login name in the connection.
        assertEquals( "scm:cvs:pserver:testuser@cvs.apache.org:/home/cvspublic:jakarta-turbine-maven",
                      p.getRepository().getConnection() )
       
        assertEquals( "touchstone-group", p.getGroupId() );
    }
View Full Code Here

     * A unit test for JUnit
     */
    public void testTouchstone()
        throws Exception
    {
        Project p = MavenUtils.getProject( new File( basedir, "project.xml" ) );
       
        // A value that is specified in project.properties is interpolated into the
        // project.xml file so that when we access the connection value we get the
        // specified anonymous login name in the connection.
        assertEquals( "scm:cvs:pserver:testuser@cvs.apache.org:/home/cvspublic:jakarta-turbine-maven",
                      p.getRepository().getConnection() )
       
        assertEquals( "touchstone-group", p.getGroupId() );
    }
View Full Code Here

                // Munge the paths
                File jarFile = new File(dependency.getJar());
                artifact.setPath(jarFile.getAbsolutePath());
                dependency.setJar(jarFile.getName());
                // Add artifact and dependency to project
                Project project = getMavenContext().getProject();
                project.addDependency(dependency);
                project.getArtifacts().add(artifact);
            } else {
                Project project = getMavenContext().getProject();
                project.addDependency(dependency);
                project.buildArtifactList();
            }
        } catch (Exception e) {
            throw new JellyTagException(e);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.maven.project.Project

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.