Coverage Report - org.apache.maven.execution.MavenSession
 
Classes in this File Line Coverage Branch Coverage Complexity
MavenSession
0%
0/32
N/A
1
 
 1  
 package org.apache.maven.execution;
 2  
 
 3  
 /*
 4  
  * Licensed to the Apache Software Foundation (ASF) under one
 5  
  * or more contributor license agreements.  See the NOTICE file
 6  
  * distributed with this work for additional information
 7  
  * regarding copyright ownership.  The ASF licenses this file
 8  
  * to you under the Apache License, Version 2.0 (the
 9  
  * "License"); you may not use this file except in compliance
 10  
  * with the License.  You may obtain a copy of the License at
 11  
  *
 12  
  *  http://www.apache.org/licenses/LICENSE-2.0
 13  
  *
 14  
  * Unless required by applicable law or agreed to in writing,
 15  
  * software distributed under the License is distributed on an
 16  
  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 17  
  * KIND, either express or implied.  See the License for the
 18  
  * specific language governing permissions and limitations
 19  
  * under the License.
 20  
  */
 21  
 
 22  
 import org.apache.maven.artifact.repository.ArtifactRepository;
 23  
 import org.apache.maven.monitor.event.EventDispatcher;
 24  
 import org.apache.maven.plugin.descriptor.PluginDescriptor;
 25  
 import org.apache.maven.project.MavenProject;
 26  
 import org.apache.maven.settings.Settings;
 27  
 import org.codehaus.plexus.PlexusContainer;
 28  
 import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
 29  
 
 30  
 import java.util.Date;
 31  
 import java.util.List;
 32  
 import java.util.Map;
 33  
 import java.util.Properties;
 34  
 
 35  
 /**
 36  
  * @author <a href="mailto:jason@maven.org">Jason van Zyl </a>
 37  
  * @version $Id: MavenSession.java 688884 2008-08-25 21:11:19Z jdcasey $
 38  
  */
 39  
 public class MavenSession
 40  
 {
 41  
     private PlexusContainer container;
 42  
 
 43  
     private ArtifactRepository localRepository;
 44  
 
 45  
     private List goals;
 46  
 
 47  
     private EventDispatcher eventDispatcher;
 48  
 
 49  
     // TODO: make this the central one, get rid of build settings...
 50  
     private final Settings settings;
 51  
 
 52  
     private ReactorManager reactorManager;
 53  
 
 54  
     private final String executionRootDir;
 55  
 
 56  0
     private boolean usingPOMsFromFilesystem = true;
 57  
 
 58  
     private final Properties executionProperties;
 59  
 
 60  
     private final Date startTime;
 61  
     
 62  
     private MavenProject currentProject;
 63  
 
 64  
     public MavenSession( PlexusContainer container, Settings settings, ArtifactRepository localRepository,
 65  
                          EventDispatcher eventDispatcher, ReactorManager reactorManager, List goals,
 66  
                          String executionRootDir, Properties executionProperties, Date startTime )
 67  0
     {
 68  0
         this.container = container;
 69  
 
 70  0
         this.settings = settings;
 71  
 
 72  0
         this.localRepository = localRepository;
 73  
 
 74  0
         this.eventDispatcher = eventDispatcher;
 75  
 
 76  0
         this.reactorManager = reactorManager;
 77  
 
 78  0
         this.goals = goals;
 79  
 
 80  0
         this.executionRootDir = executionRootDir;
 81  
 
 82  0
         this.executionProperties = executionProperties;
 83  
 
 84  0
         this.startTime = startTime;
 85  0
     }
 86  
 
 87  
     public Map getPluginContext( PluginDescriptor pluginDescriptor, MavenProject project )
 88  
     {
 89  0
         return reactorManager.getPluginContext( pluginDescriptor, project );
 90  
     }
 91  
 
 92  
     public PlexusContainer getContainer()
 93  
     {
 94  0
         return container;
 95  
     }
 96  
 
 97  
     public ArtifactRepository getLocalRepository()
 98  
     {
 99  0
         return localRepository;
 100  
     }
 101  
 
 102  
     public List getGoals()
 103  
     {
 104  0
         return goals;
 105  
     }
 106  
 
 107  
     public Properties getExecutionProperties()
 108  
     {
 109  0
         return executionProperties;
 110  
     }
 111  
 
 112  
     // ----------------------------------------------------------------------
 113  
     //
 114  
     // ----------------------------------------------------------------------
 115  
 
 116  
     public Object lookup( String role )
 117  
         throws ComponentLookupException
 118  
     {
 119  0
         return container.lookup( role );
 120  
     }
 121  
 
 122  
     public Object lookup( String role, String roleHint )
 123  
         throws ComponentLookupException
 124  
     {
 125  0
         return container.lookup( role, roleHint );
 126  
     }
 127  
 
 128  
     public List lookupList( String role )
 129  
         throws ComponentLookupException
 130  
     {
 131  0
         return container.lookupList( role );
 132  
     }
 133  
 
 134  
     public Map lookupMap( String role )
 135  
         throws ComponentLookupException
 136  
     {
 137  0
         return container.lookupMap( role );
 138  
     }
 139  
 
 140  
     public EventDispatcher getEventDispatcher()
 141  
     {
 142  0
         return eventDispatcher;
 143  
     }
 144  
 
 145  
     public Settings getSettings()
 146  
     {
 147  0
         return settings;
 148  
     }
 149  
 
 150  
     public List getSortedProjects()
 151  
     {
 152  0
         return reactorManager.getSortedProjects();
 153  
     }
 154  
 
 155  
     public String getExecutionRootDirectory()
 156  
     {
 157  0
         return executionRootDir;
 158  
     }
 159  
 
 160  
     public void setUsingPOMsFromFilesystem( boolean usingPOMsFromFilesystem )
 161  
     {
 162  0
         this.usingPOMsFromFilesystem = usingPOMsFromFilesystem;
 163  0
     }
 164  
 
 165  
     public boolean isUsingPOMsFromFilesystem()
 166  
     {
 167  0
         return usingPOMsFromFilesystem;
 168  
     }
 169  
 
 170  
     public Date getStartTime()
 171  
     {
 172  0
         return startTime;
 173  
     }
 174  
     
 175  
     public void setCurrentProject( MavenProject currentProject )
 176  
     {
 177  0
         this.currentProject = currentProject;
 178  0
     }
 179  
 
 180  
     /**
 181  
      * Return the current project for use in a mojo execution.
 182  
      */
 183  
     public MavenProject getCurrentProject()
 184  
     {
 185  0
         return currentProject;
 186  
     }
 187  
     
 188  
 }