Coverage Report - org.apache.maven.plugin.MojoExecution
 
Classes in this File Line Coverage Branch Coverage Complexity
MojoExecution
0 %
0/32
N/A
1
 
 1  
 package org.apache.maven.plugin;
 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.plugin.descriptor.MojoDescriptor;
 23  
 import org.codehaus.plexus.util.xml.Xpp3Dom;
 24  
 
 25  
 import java.util.ArrayList;
 26  
 import java.util.List;
 27  
 
 28  
 /**
 29  
  * Describes a single mojo invocation.
 30  
  *
 31  
  * @author <a href="mailto:brett@apache.org">Brett Porter</a>
 32  
  * @version $Id: MojoExecution.java 788791 2009-06-26 17:55:26Z jdcasey $
 33  
  */
 34  
 public class MojoExecution
 35  
 {
 36  
     public static final String DEFAULT_EXEC_ID_PREFIX = "default-";
 37  
 
 38  
     public static final String CLI_EXECUTION_ID = DEFAULT_EXEC_ID_PREFIX + "cli";
 39  
 
 40  
     // Execution ID needs to default to "default" to allow configuration of that execution alongside
 41  
     // other executions.
 42  
     private final String executionId;
 43  
 
 44  
     private final MojoDescriptor mojoDescriptor;
 45  
 
 46  
     private Xpp3Dom configuration;
 47  
 
 48  0
     private List forkedExecutions = new ArrayList();
 49  
 
 50  
     private List reports;
 51  
 
 52  
     public MojoExecution( MojoDescriptor mojoDescriptor )
 53  0
     {
 54  0
         this.mojoDescriptor = mojoDescriptor;
 55  0
         this.configuration = null;
 56  0
         this.executionId = DEFAULT_EXEC_ID_PREFIX + mojoDescriptor.getGoal();
 57  0
     }
 58  
 
 59  
     public MojoExecution( MojoDescriptor mojoDescriptor, String executionId )
 60  0
     {
 61  0
         this.mojoDescriptor = mojoDescriptor;
 62  0
         this.executionId = executionId;
 63  0
         this.configuration = null;
 64  0
     }
 65  
 
 66  
     public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration )
 67  0
     {
 68  0
         this.mojoDescriptor = mojoDescriptor;
 69  0
         this.configuration = configuration;
 70  0
         this.executionId = DEFAULT_EXEC_ID_PREFIX + mojoDescriptor.getGoal();
 71  0
     }
 72  
 
 73  
     public MojoExecution( MojoDescriptor mojoDescriptor, Xpp3Dom configuration, String executionId )
 74  0
     {
 75  0
         this.mojoDescriptor = mojoDescriptor;
 76  0
         this.configuration = configuration;
 77  0
         this.executionId = executionId;
 78  0
     }
 79  
 
 80  
     public String getExecutionId()
 81  
     {
 82  0
         return executionId;
 83  
     }
 84  
 
 85  
     public MojoDescriptor getMojoDescriptor()
 86  
     {
 87  0
         return mojoDescriptor;
 88  
     }
 89  
 
 90  
     public Xpp3Dom getConfiguration()
 91  
     {
 92  0
         return configuration;
 93  
     }
 94  
 
 95  
     public void addMojoExecution( MojoExecution execution )
 96  
     {
 97  0
         forkedExecutions.add( execution );
 98  0
     }
 99  
 
 100  
     public void setReports( List reports )
 101  
     {
 102  0
         this.reports = reports;
 103  0
     }
 104  
 
 105  
     public List getReports()
 106  
     {
 107  0
         return reports;
 108  
     }
 109  
 
 110  
     public List getForkedExecutions()
 111  
     {
 112  0
         return forkedExecutions;
 113  
     }
 114  
 
 115  
     public void setConfiguration( Xpp3Dom configuration )
 116  
     {
 117  0
         this.configuration = configuration;
 118  0
     }
 119  
 }