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 org.apache.maven.settings.Settings;
23  
24  import java.io.File;
25  
26  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      private String mavenExecutorId = DEFAULT_MAVEN_EXECUTOR_ID;
39  
40      public File getMavenHome()
41      {
42          return mavenHome;
43      }
44  
45      public Settings getSettings()
46      {
47          return settings;
48      }
49  
50      public ReleaseEnvironment setMavenHome( File mavenHome )
51      {
52          this.mavenHome = mavenHome;
53          return this;
54      }
55  
56      public ReleaseEnvironment setSettings( Settings settings )
57      {
58          this.settings = settings;
59          return this;
60      }
61  
62      public String getMavenExecutorId()
63      {
64          return mavenExecutorId;
65      }
66  
67      public ReleaseEnvironment setMavenExecutorId( String mavenExecutorId )
68      {
69          this.mavenExecutorId = mavenExecutorId;
70          return this;
71      }
72  
73      public File getJavaHome()
74      {
75          return javaHome;
76      }
77  
78      public ReleaseEnvironment setJavaHome( File javaHome )
79      {
80          this.javaHome = javaHome;
81          return this;
82      }
83  
84      public File getLocalRepositoryDirectory()
85      {
86          File localRepo = localRepositoryDirectory;
87  
88          if ( localRepo == null && settings != null && settings.getLocalRepository() != null )
89          {
90              localRepo = new File( settings.getLocalRepository() ).getAbsoluteFile();
91          }
92  
93          return localRepo;
94      }
95  
96      public ReleaseEnvironment setLocalRepositoryDirectory( File localRepositoryDirectory )
97      {
98          this.localRepositoryDirectory = localRepositoryDirectory;
99          return this;
100     }
101 
102 }