Package org.apache.maven.project

Examples of org.apache.maven.project.MavenProject


    public Model getModel() {
        return mavenProject.getModel();
    }

    public DefaultMavenPom setModel(Model model) {
        this.mavenProject = new MavenProject(model);
        return this;
    }
View Full Code Here


              // TODO: let the scope handler deal with this
              if ( Artifact.SCOPE_COMPILE.equals( a.getScope() ) || Artifact.SCOPE_PROVIDED.equals( a.getScope() ) ||
                  Artifact.SCOPE_SYSTEM.equals( a.getScope() ) )
              {
                  String refId = getProjectReferenceId( a.getGroupId(), a.getArtifactId() );
                  MavenProject project = (MavenProject) this.project.getProjectReferences().get( refId );
                  if ( project != null )
                  {
                      list.add( project.getBuild().getOutputDirectory() );
                  }
                  else
                  {
                      File file = a.getFile();
                      if ( file == null )
View Full Code Here

        Set basedirSet = new HashSet();
        basedirSet.add(getProjectBasedir(project));

        Collection projectReferences = project.getProjectReferences().values();
        for (Iterator iter = projectReferences.iterator(); iter.hasNext();) {
            MavenProject projectReference = (MavenProject) iter.next();
            String projectId = projectReference.getGroupId() + ":" + projectReference.getArtifactId();

            if ((this.modules == null) || this.modules.contains(projectId)) {
                basedirSet.add(getProjectBasedir(projectReference));
            }
        }
View Full Code Here

        Set classpathElements = new HashSet();
        classpathElements.addAll(getProjectCompileClasspathElements(project));

        Collection projectReferences = project.getProjectReferences().values();
        for (Iterator iter = projectReferences.iterator(); iter.hasNext();) {
            MavenProject projectReference = (MavenProject) iter.next();
            classpathElements.addAll(getProjectCompileClasspathElements(projectReference));
        }

        return classpathElements;
    }
View Full Code Here

        final Dependency dependency,
        final String scope)
    {
        Artifact artifact = null;
        final ArtifactRepository localRepository = this.localRepository;
        final MavenProject project = this.project;
        if (project != null && localRepository != null)
        {
            if (dependency != null)
            {
                artifact =
View Full Code Here

    private MavenProject getRootProject()
        throws MojoExecutionException
    {
        if (this.rootProject == null)
        {
            MavenProject root = null;
            for (root = this.project.getParent(); root.getParent() != null; root = root.getParent())
            {
                ;
            }
            if (root == null)
            {
View Full Code Here

                            this.getLog().info("Reactor build order:");
                        }
                        for (final Iterator iterator = reactorManager.getSortedProjects().iterator();
                            iterator.hasNext();)
                        {
                            final MavenProject project = (MavenProject)iterator.next();
                            this.getLog().info("  " + project.getName());
                        }
                        final MavenSession projectSession =
                            new MavenSession(
                                this.session.getContainer(),
                                this.session.getSettings(),
                                this.session.getLocalRepository(),
                                this.session.getEventDispatcher(),
                                reactorManager,
                                goals,
                                this.baseDirectory.toString(),
                                this.session.getExecutionProperties(),
                                this.session.getStartTime());

                        projectSession.setUsingPOMsFromFilesystem(true);
                        this.lifecycleExecutor.execute(
                            projectSession,
                            reactorManager,
                            projectSession.getEventDispatcher());
                    }
                    else
                    {
                        for (final Iterator iterator = this.session.getGoals().iterator(); iterator.hasNext();)
                        {
                            final String goal = (String)iterator.next();
                            final ReactorManager reactorManager = new ReactorManager(projects);
                            if (projects.size() > 1)
                            {
                                this.getLog().info("Reactor build order:");
                            }
                            for (final Iterator projectIterator = reactorManager.getSortedProjects().iterator();
                                projectIterator.hasNext();)
                            {
                                final MavenProject project = (MavenProject)projectIterator.next();
                                this.getLog().info("  " + project.getName());
                            }

                            final MavenSession projectSession =
                                new MavenSession(
                                    this.session.getContainer(),
View Full Code Here

                final File pom = (File)iterator.next();

                // - first attempt to get the existing project from the session
                try
                {
                    final MavenProject project = ProjectUtils.getProject(
                            this.projectBuilder,
                            this.session,
                            pom,
                            this.getLog());
                    if (project != null)
                    {
                        if (this.getLog().isDebugEnabled())
                        {
                            getLog().debug("Adding project " + project.getId());
                        }
                        projects.add(project);
                    }
                    else
                    {
View Full Code Here

        final File pom,
        final Log logger)
        throws ProjectBuildingException
    {
        // - first attempt to get a project from the cache
        MavenProject project = (MavenProject)projectCache.get(pom);
        if (project == null)
        {
            // - next attempt to get the existing project from the session
            project = getProjectFromSession(
                    session,
View Full Code Here

     */
    private static MavenProject getProjectFromSession(
        final MavenSession session,
        final File pom)
    {
        MavenProject foundProject = null;
        for (final Iterator projectIterator = session.getSortedProjects().iterator(); projectIterator.hasNext();)
        {
            final MavenProject project = (MavenProject)projectIterator.next();
            final File projectPom = new File(
                    project.getBasedir(),
                    POM_FILE);
            if (projectPom.equals(pom))
            {
                foundProject = project;
            }
View Full Code Here

TOP

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

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.