File D:\maven-qcr-plugin-testsunitaires\qcr4java\jenkins-master\target\site\qc\maven-plugin\src\main\java\hudson\maven\MavenEmbedderRequest.java.html

1 /**
2 *
3 */
4 package hudson.maven;
5
6 /*
7 * Licensed to the Apache Software Foundation (ASF) under one
8 * or more contributor license agreements. See the NOTICE file
9 * distributed with this work for additional information
10 * regarding copyright ownership. The ASF licenses this file
11 * to you under the Apache License, Version 2.0 (the
12 * "License"); you may not use this file except in compliance
13 * with the License. You may obtain a copy of the License at
14 *
15 * http://www.apache.org/licenses/LICENSE-2.0
16 *
17 * Unless required by applicable law or agreed to in writing,
18 * software distributed under the License is distributed on an
19 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
20 * KIND, either express or implied. See the License for the
21 * specific language governing permissions and limitations
22 * under the License.
23 */
24
25 import hudson.model.TaskListener;
26
27 import java.io.File;
28 import java.util.Properties;
29
30 import org.apache.maven.model.building.ModelBuildingRequest;
31 import org.sonatype.aether.repository.WorkspaceReader;
32 import org.sonatype.aether.transfer.TransferListener;
33
34 /**
35 * @author Olivier Lamy
36 */
37 public class MavenEmbedderRequest
38 {
39 private TaskListener listener;
40
41 private File mavenHome;
42
43 private String profiles;
44
45 private Properties systemProperties;
46
47 private String privateRepository;
48
49 private File alternateSettings;
50
51 private TransferListener transferListener;
52
53 /**
54 * @since 1.393
55 */
56 private ClassLoader classLoader;
57
58 /**
59 * will processPlugins during project reading
60 * @since 1.393
61 */
62 private boolean processPlugins;
63
64 /**
65 * will resolve dependencies during project reading
66 * @since 1.393
67 */
68 private boolean resolveDependencies;
69
70 /**
71 * level of validation when reading pom (ie model building request)
72 * default value : {@link ModelBuildingRequest#VALIDATION_LEVEL_MAVEN_2_0} etc...
73 * @since 1.393
74 */
75 private int validationLevel = ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0;
76
77 /**
78 * @since 1.393
79 */
80 private WorkspaceReader workspaceReader;
81
82 /**
83 * @since 1.426
84 */
85 private File globalSettings;
86
87 /**
88 * @since 1.461
89 */
90 private boolean updateSnapshots;
91
92 /**
93 * @param listener
94 * This is where the log messages from Maven will be recorded.
95 * @param mavenHome
96 * Directory of the Maven installation. We read {@code conf/settings.xml}
97 * from here. Can be null.
98 * @param profiles
99 * Profiles to activate/deactivate. Can be null.
100 * @param systemProperties
101 * The system properties that the embedded Maven sees. See {@link MavenEmbedder#setSystemProperties(Properties)}.
102 * @param privateRepository
103 * Optional private repository to use as the local repository.
104 * @param alternateSettings
105 * Optional alternate settings.xml file.
106 */
107 public MavenEmbedderRequest( TaskListener listener, File mavenHome, String profiles, Properties systemProperties,
108 String privateRepository, File alternateSettings ) {
109 this.listener = listener;
110 this.mavenHome = mavenHome;
111 this.profiles = profiles;
112 this.systemProperties = systemProperties;
113 this.privateRepository = privateRepository;
114 this.alternateSettings = alternateSettings;
115 }
116
117 public TaskListener getListener() {
118 return listener;
119 }
120
121 public MavenEmbedderRequest setListener( TaskListener listener ) {
122 this.listener = listener;
123 return this;
124 }
125
126 public File getMavenHome() {
127 return mavenHome;
128 }
129
130 public MavenEmbedderRequest setMavenHome( File mavenHome ) {
131 this.mavenHome = mavenHome;
132 return this;
133 }
134
135 public String getProfiles() {
136 return profiles;
137 }
138
139 public MavenEmbedderRequest setProfiles( String profiles ) {
140 this.profiles = profiles;
141 return this;
142 }
143
144 public Properties getSystemProperties() {
145 return systemProperties;
146 }
147
148 public MavenEmbedderRequest setSystemProperties( Properties systemProperties ) {
149 this.systemProperties = systemProperties;
150 return this;
151 }
152
153 public String getPrivateRepository() {
154 return privateRepository;
155 }
156
157 public MavenEmbedderRequest setPrivateRepository( String privateRepository ) {
158 this.privateRepository = privateRepository;
159 return this;
160 }
161
162 public File getAlternateSettings() {
163 return alternateSettings;
164 }
165
166 public MavenEmbedderRequest setAlternateSettings( File alternateSettings ) {
167 this.alternateSettings = alternateSettings;
168 return this;
169 }
170
171 public TransferListener getTransferListener() {
172 return transferListener;
173 }
174
175 public MavenEmbedderRequest setTransferListener( TransferListener transferListener ) {
176 this.transferListener = transferListener;
177 return this;
178 }
179
180 public ClassLoader getClassLoader() {
181 return classLoader;
182 }
183
184 public MavenEmbedderRequest setClassLoader( ClassLoader classLoader ) {
185 this.classLoader = classLoader;
186 return this;
187 }
188
189 public boolean isProcessPlugins() {
190 return processPlugins;
191 }
192
193 public MavenEmbedderRequest setProcessPlugins( boolean processPlugins ) {
194 this.processPlugins = processPlugins;
195 return this;
196 }
197
198 public boolean isResolveDependencies() {
199 return resolveDependencies;
200 }
201
202 public MavenEmbedderRequest setResolveDependencies( boolean resolveDependencies ) {
203 this.resolveDependencies = resolveDependencies;
204 return this;
205 }
206
207 public int getValidationLevel() {
208 return validationLevel;
209 }
210
211 public MavenEmbedderRequest setValidationLevel( int validationLevel ) {
212 this.validationLevel = validationLevel;
213 return this;
214 }
215
216 public WorkspaceReader getWorkspaceReader() {
217 return workspaceReader;
218 }
219
220 public void setWorkspaceReader( WorkspaceReader workspaceReader ) {
221 this.workspaceReader = workspaceReader;
222 }
223
224 public File getGlobalSettings() {
225 return globalSettings;
226 }
227
228 public MavenEmbedderRequest setGlobalSettings( File globalSettings ) {
229 this.globalSettings = globalSettings;
230 return this;
231 }
232
233 public MavenEmbedderRequest setUpdateSnapshots(boolean updateSnapshots) {
234 this.updateSnapshots = updateSnapshots;
235 return this;
236 }
237
238 public boolean isUpdateSnapshots() {
239 return updateSnapshots;
240 }
241 }
242