View Javadoc
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 java.io.File;
23  import java.util.Locale;
24  
25  import org.apache.maven.settings.Settings;
26  
27  /**
28   * 
29   */
30  public class DefaultReleaseEnvironment
31      implements ReleaseEnvironment
32  {
33  
34      private File mavenHome;
35  
36      private File javaHome;
37  
38      private File localRepositoryDirectory;
39  
40      private Settings settings;
41  
42      private String mavenExecutorId = DEFAULT_MAVEN_EXECUTOR_ID;
43      
44      private Locale locale = Locale.ENGLISH;
45  
46      public File getMavenHome()
47      {
48          return mavenHome;
49      }
50  
51      public Settings getSettings()
52      {
53          return settings;
54      }
55  
56      public ReleaseEnvironment setMavenHome( File mavenHome )
57      {
58          this.mavenHome = mavenHome;
59          return this;
60      }
61  
62      public ReleaseEnvironment setSettings( Settings settings )
63      {
64          this.settings = settings;
65          return this;
66      }
67  
68      public String getMavenExecutorId()
69      {
70          return mavenExecutorId;
71      }
72  
73      public ReleaseEnvironment setMavenExecutorId( String mavenExecutorId )
74      {
75          this.mavenExecutorId = mavenExecutorId;
76          return this;
77      }
78  
79      public File getJavaHome()
80      {
81          return javaHome;
82      }
83  
84      public ReleaseEnvironment setJavaHome( File javaHome )
85      {
86          this.javaHome = javaHome;
87          return this;
88      }
89  
90      public File getLocalRepositoryDirectory()
91      {
92          File localRepo = localRepositoryDirectory;
93  
94          if ( localRepo == null && settings != null && settings.getLocalRepository() != null )
95          {
96              localRepo = new File( settings.getLocalRepository() ).getAbsoluteFile();
97          }
98  
99          return localRepo;
100     }
101 
102     public ReleaseEnvironment setLocalRepositoryDirectory( File localRepositoryDirectory )
103     {
104         this.localRepositoryDirectory = localRepositoryDirectory;
105         return this;
106     }
107 
108     public Locale getLocale()
109     {
110         return locale;
111     }
112     
113     public ReleaseEnvironment setLocale( Locale locale )
114     {
115         this.locale = locale;
116         return this;
117     }
118 }