Coverage Report - org.apache.maven.shared.release.env.DefaultReleaseEnvironment
 
Classes in this File Line Coverage Branch Coverage Complexity
DefaultReleaseEnvironment
35%
7/20
0%
0/6
1,3
 
 1  
 package org.apache.maven.shared.release.env;
 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.settings.Settings;
 23  
 
 24  
 import java.io.File;
 25  
 
 26  798
 public class DefaultReleaseEnvironment
 27  
     implements ReleaseEnvironment
 28  
 {
 29  
 
 30  
     private File mavenHome;
 31  
 
 32  
     private File javaHome;
 33  
 
 34  
     private File localRepositoryDirectory;
 35  
 
 36  
     private Settings settings;
 37  
 
 38  798
     private String mavenExecutorId = DEFAULT_MAVEN_EXECUTOR_ID;
 39  
 
 40  
     public File getMavenHome()
 41  
     {
 42  10
         return mavenHome;
 43  
     }
 44  
 
 45  
     public Settings getSettings()
 46  
     {
 47  802
         return settings;
 48  
     }
 49  
 
 50  
     public ReleaseEnvironment setMavenHome( File mavenHome )
 51  
     {
 52  0
         this.mavenHome = mavenHome;
 53  0
         return this;
 54  
     }
 55  
 
 56  
     public ReleaseEnvironment setSettings( Settings settings )
 57  
     {
 58  16
         this.settings = settings;
 59  16
         return this;
 60  
     }
 61  
 
 62  
     public String getMavenExecutorId()
 63  
     {
 64  30
         return mavenExecutorId;
 65  
     }
 66  
 
 67  
     public ReleaseEnvironment setMavenExecutorId( String mavenExecutorId )
 68  
     {
 69  0
         this.mavenExecutorId = mavenExecutorId;
 70  0
         return this;
 71  
     }
 72  
 
 73  
     public File getJavaHome()
 74  
     {
 75  0
         return javaHome;
 76  
     }
 77  
 
 78  
     public ReleaseEnvironment setJavaHome( File javaHome )
 79  
     {
 80  0
         this.javaHome = javaHome;
 81  0
         return this;
 82  
     }
 83  
 
 84  
     public File getLocalRepositoryDirectory()
 85  
     {
 86  0
         File localRepo = localRepositoryDirectory;
 87  
 
 88  0
         if ( localRepo == null && settings != null && settings.getLocalRepository() != null )
 89  
         {
 90  0
             localRepo = new File( settings.getLocalRepository() ).getAbsoluteFile();
 91  
         }
 92  
 
 93  0
         return localRepo;
 94  
     }
 95  
 
 96  
     public ReleaseEnvironment setLocalRepositoryDirectory( File localRepositoryDirectory )
 97  
     {
 98  0
         this.localRepositoryDirectory = localRepositoryDirectory;
 99  0
         return this;
 100  
     }
 101  
 
 102  
 }