Coverage Report - org.apache.maven.execution.DefaultMavenExecutionRequest
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultMavenExecutionRequest
0 %
0/52
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.monitor.event.EventMonitor;
 25  
 import org.apache.maven.profiles.ProfileManager;
 26  
 import org.apache.maven.project.DefaultProjectBuilderConfiguration;
 27  
 import org.apache.maven.project.ProjectBuilderConfiguration;
 28  
 import org.apache.maven.settings.Settings;
 29  
 
 30  
 import java.util.Date;
 31  
 import java.util.List;
 32  
 import java.util.Properties;
 33  
 
 34  
 /**
 35  
  * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
 36  
  * @version $Id: DefaultMavenExecutionRequest.java 687388 2008-08-20 17:19:21Z dfabulich $
 37  
  */
 38  
 public class DefaultMavenExecutionRequest
 39  
     implements MavenExecutionRequest
 40  
 {
 41  
     /**
 42  
      * @todo [BP] is this required? This hands off to MavenSession, but could be passed through the handler.handle function (+ createSession).
 43  
      */
 44  
     private final ArtifactRepository localRepository;
 45  
 
 46  
     private final List goals;
 47  
 
 48  
     protected MavenSession session;
 49  
 
 50  
     private final EventDispatcher eventDispatcher;
 51  
 
 52  
     private final Settings settings;
 53  
 
 54  
     private final String baseDirectory;
 55  
 
 56  0
     private boolean recursive = true;
 57  
 
 58  
     private boolean reactorActive;
 59  
 
 60  
     private String pomFilename;
 61  
 
 62  
     private String failureBehavior;
 63  
 
 64  
     private final ProfileManager globalProfileManager;
 65  
 
 66  
     private final Properties executionProperties;
 67  
 
 68  
     private final Properties userProperties;
 69  
 
 70  
     private final Date startTime;
 71  
 
 72  
     private final boolean showErrors;
 73  
     
 74  
     private String makeBehavior;
 75  
     
 76  
     private String resumeFrom;
 77  
     
 78  
     private List selectedProjects;
 79  
 
 80  
     public DefaultMavenExecutionRequest( ArtifactRepository localRepository, Settings settings,
 81  
                                          EventDispatcher eventDispatcher, List goals, String baseDirectory,
 82  
                                          ProfileManager globalProfileManager, Properties executionProperties,
 83  
                                          Properties userProperties,
 84  
                                          boolean showErrors )
 85  0
     {
 86  0
         this.localRepository = localRepository;
 87  
 
 88  0
         this.settings = settings;
 89  
 
 90  0
         this.goals = goals;
 91  
 
 92  0
         this.eventDispatcher = eventDispatcher;
 93  
 
 94  0
         this.baseDirectory = baseDirectory;
 95  
 
 96  0
         this.globalProfileManager = globalProfileManager;
 97  
 
 98  0
         this.executionProperties = executionProperties;
 99  
 
 100  0
         this.userProperties = userProperties;
 101  
 
 102  0
         startTime = new Date();
 103  
 
 104  0
         this.showErrors = showErrors;
 105  0
     }
 106  
 
 107  
     public Settings getSettings()
 108  
     {
 109  0
         return settings;
 110  
     }
 111  
 
 112  
     public String getBaseDirectory()
 113  
     {
 114  0
         return baseDirectory;
 115  
     }
 116  
 
 117  
     public boolean isRecursive()
 118  
     {
 119  0
         return recursive;
 120  
     }
 121  
 
 122  
     public void setRecursive( boolean recursive )
 123  
     {
 124  0
         this.recursive = false;
 125  0
     }
 126  
 
 127  
     public ArtifactRepository getLocalRepository()
 128  
     {
 129  0
         return localRepository;
 130  
     }
 131  
 
 132  
     public List getGoals()
 133  
     {
 134  0
         return goals;
 135  
     }
 136  
 
 137  
     public Properties getExecutionProperties()
 138  
     {
 139  0
         return executionProperties;
 140  
     }
 141  
 
 142  
     // ----------------------------------------------------------------------
 143  
     // Putting the session here but it can probably be folded right in here.
 144  
     // ----------------------------------------------------------------------
 145  
 
 146  
     public MavenSession getSession()
 147  
     {
 148  0
         return session;
 149  
     }
 150  
 
 151  
     public void setSession( MavenSession session )
 152  
     {
 153  0
         session = session;
 154  0
     }
 155  
 
 156  
     public void addEventMonitor( EventMonitor monitor )
 157  
     {
 158  0
         eventDispatcher.addEventMonitor( monitor );
 159  0
     }
 160  
 
 161  
     public EventDispatcher getEventDispatcher()
 162  
     {
 163  0
         return eventDispatcher;
 164  
     }
 165  
 
 166  
     public void setReactorActive( boolean reactorActive )
 167  
     {
 168  0
         this.reactorActive = reactorActive;
 169  0
     }
 170  
 
 171  
     public boolean isReactorActive()
 172  
     {
 173  0
         return reactorActive;
 174  
     }
 175  
 
 176  
     public void setPomFile( String pomFilename )
 177  
     {
 178  0
         this.pomFilename = pomFilename;
 179  0
     }
 180  
 
 181  
     public String getPomFile()
 182  
     {
 183  0
         return pomFilename;
 184  
     }
 185  
 
 186  
     public void setFailureBehavior( String failureBehavior )
 187  
     {
 188  0
         this.failureBehavior = failureBehavior;
 189  0
     }
 190  
 
 191  
     public String getFailureBehavior()
 192  
     {
 193  0
         return failureBehavior;
 194  
     }
 195  
 
 196  
     public ProfileManager getGlobalProfileManager()
 197  
     {
 198  0
         return globalProfileManager;
 199  
     }
 200  
 
 201  
     public Date getStartTime()
 202  
     {
 203  0
         return startTime;
 204  
     }
 205  
 
 206  
     public boolean isShowErrors()
 207  
     {
 208  0
         return showErrors;
 209  
     }
 210  
 
 211  
     public Properties getUserProperties()
 212  
     {
 213  0
         return userProperties;
 214  
     }
 215  
 
 216  
     public ProjectBuilderConfiguration getProjectBuilderConfiguration()
 217  
     {
 218  0
         ProjectBuilderConfiguration config = new DefaultProjectBuilderConfiguration();
 219  0
         config.setLocalRepository( getLocalRepository() )
 220  
               .setGlobalProfileManager( getGlobalProfileManager() )
 221  
               .setExecutionProperties( getExecutionProperties() )
 222  
               .setUserProperties( getUserProperties() )
 223  
               .setBuildStartTime( startTime );
 224  
 
 225  0
         return config;
 226  
     }
 227  
     
 228  
     public String getMakeBehavior()
 229  
     {
 230  0
         return makeBehavior;
 231  
     }
 232  
 
 233  
     public void setMakeBehavior( String makeBehavior )
 234  
     {
 235  0
         this.makeBehavior = makeBehavior;
 236  0
     }
 237  
 
 238  
     public String getResumeFrom()
 239  
     {
 240  0
         return resumeFrom;
 241  
     }
 242  
 
 243  
     public void setResumeFrom( String resumeFrom )
 244  
     {
 245  0
         this.resumeFrom = resumeFrom;
 246  0
     }
 247  
 
 248  
     public List getSelectedProjects()
 249  
     {
 250  0
         return selectedProjects;
 251  
     }
 252  
 
 253  
     public void setSelectedProjects( List selectedProjects )
 254  
     {
 255  0
         this.selectedProjects = selectedProjects;
 256  0
     }
 257  
 
 258  
 }