View Javadoc

1   /*
2    * $Id$
3    */
4   
5   package org.apache.maven.model;
6   
7     //---------------------------------/
8    //- Imported classes and packages -/
9   //---------------------------------/
10  
11  import java.util.Date;
12  
13  /**
14   * This elements describes all that pertains to distribution for a
15   * project. It is
16   *         primarily used for deployment of artifacts and the site
17   * produced by the build.
18   * 
19   * @version $Revision$ $Date$
20   */
21  public class DistributionManagement implements java.io.Serializable {
22  
23  
24        //--------------------------/
25       //- Class/Member Variables -/
26      //--------------------------/
27  
28      /**
29       * Information needed to deploy the artifacts generated by the
30       * project to a
31       *             remote repository.
32       */
33      private DeploymentRepository repository;
34  
35      /**
36       * 
37       *             
38       *             Where to deploy snapshots of artifacts to. If
39       * not given, it defaults to the
40       *             <code>repository</code> element.
41       *             
42       *           
43       */
44      private DeploymentRepository snapshotRepository;
45  
46      /**
47       * Information needed for deploying the web site of the project.
48       */
49      private Site site;
50  
51      /**
52       * 
53       *             
54       *             The URL of the project's download page. If not
55       * given users will be
56       *             referred to the homepage given by
57       * <code>url</code>.
58       *             This is given to assist in locating artifacts
59       * that are not in the repository due to
60       *             licensing restrictions.
61       *             
62       *           
63       */
64      private String downloadUrl;
65  
66      /**
67       * Relocation information of the artifact if it has been moved
68       * to a new group ID
69       *             and/or artifact ID.
70       */
71      private Relocation relocation;
72  
73      /**
74       * 
75       *             
76       *             Gives the status of this artifact in the remote
77       * repository.
78       *             This must not be set in your local project, as
79       * it is updated by
80       *             tools placing it in the reposiory. Valid values
81       * are: <code>none</code> (default),
82       *             <code>converted</code> (repository manager
83       * converted this from an Maven 1 POM),
84       *             <code>partner</code>
85       *             (directly synced from a partner Maven 2
86       * repository), <code>deployed</code> (was deployed from a
87       * Maven 2
88       *             instance), <code>verified</code> (has been hand
89       * verified as correct and final).
90       *             
91       *           
92       */
93      private String status;
94  
95  
96        //-----------/
97       //- Methods -/
98      //-----------/
99  
100     /**
101      * Get 
102      *             
103      *             The URL of the project's download page. If not
104      * given users will be
105      *             referred to the homepage given by
106      * <code>url</code>.
107      *             This is given to assist in locating artifacts
108      * that are not in the repository due to
109      *             licensing restrictions.
110      *             
111      *           
112      * 
113      * @return String
114      */
115     public String getDownloadUrl()
116     {
117         return this.downloadUrl;
118     } //-- String getDownloadUrl() 
119 
120     /**
121      * Get relocation information of the artifact if it has been
122      * moved to a new group ID
123      *             and/or artifact ID.
124      * 
125      * @return Relocation
126      */
127     public Relocation getRelocation()
128     {
129         return this.relocation;
130     } //-- Relocation getRelocation() 
131 
132     /**
133      * Get information needed to deploy the artifacts generated by
134      * the project to a
135      *             remote repository.
136      * 
137      * @return DeploymentRepository
138      */
139     public DeploymentRepository getRepository()
140     {
141         return this.repository;
142     } //-- DeploymentRepository getRepository() 
143 
144     /**
145      * Get information needed for deploying the web site of the
146      * project.
147      * 
148      * @return Site
149      */
150     public Site getSite()
151     {
152         return this.site;
153     } //-- Site getSite() 
154 
155     /**
156      * Get 
157      *             
158      *             Where to deploy snapshots of artifacts to. If
159      * not given, it defaults to the
160      *             <code>repository</code> element.
161      *             
162      *           
163      * 
164      * @return DeploymentRepository
165      */
166     public DeploymentRepository getSnapshotRepository()
167     {
168         return this.snapshotRepository;
169     } //-- DeploymentRepository getSnapshotRepository() 
170 
171     /**
172      * Get 
173      *             
174      *             Gives the status of this artifact in the remote
175      * repository.
176      *             This must not be set in your local project, as
177      * it is updated by
178      *             tools placing it in the reposiory. Valid values
179      * are: <code>none</code> (default),
180      *             <code>converted</code> (repository manager
181      * converted this from an Maven 1 POM),
182      *             <code>partner</code>
183      *             (directly synced from a partner Maven 2
184      * repository), <code>deployed</code> (was deployed from a
185      * Maven 2
186      *             instance), <code>verified</code> (has been hand
187      * verified as correct and final).
188      *             
189      *           
190      * 
191      * @return String
192      */
193     public String getStatus()
194     {
195         return this.status;
196     } //-- String getStatus() 
197 
198     /**
199      * Set 
200      *             
201      *             The URL of the project's download page. If not
202      * given users will be
203      *             referred to the homepage given by
204      * <code>url</code>.
205      *             This is given to assist in locating artifacts
206      * that are not in the repository due to
207      *             licensing restrictions.
208      *             
209      *           
210      * 
211      * @param downloadUrl
212      */
213     public void setDownloadUrl( String downloadUrl )
214     {
215         this.downloadUrl = downloadUrl;
216     } //-- void setDownloadUrl( String ) 
217 
218     /**
219      * Set relocation information of the artifact if it has been
220      * moved to a new group ID
221      *             and/or artifact ID.
222      * 
223      * @param relocation
224      */
225     public void setRelocation( Relocation relocation )
226     {
227         this.relocation = relocation;
228     } //-- void setRelocation( Relocation ) 
229 
230     /**
231      * Set information needed to deploy the artifacts generated by
232      * the project to a
233      *             remote repository.
234      * 
235      * @param repository
236      */
237     public void setRepository( DeploymentRepository repository )
238     {
239         this.repository = repository;
240     } //-- void setRepository( DeploymentRepository ) 
241 
242     /**
243      * Set information needed for deploying the web site of the
244      * project.
245      * 
246      * @param site
247      */
248     public void setSite( Site site )
249     {
250         this.site = site;
251     } //-- void setSite( Site ) 
252 
253     /**
254      * Set 
255      *             
256      *             Where to deploy snapshots of artifacts to. If
257      * not given, it defaults to the
258      *             <code>repository</code> element.
259      *             
260      *           
261      * 
262      * @param snapshotRepository
263      */
264     public void setSnapshotRepository( DeploymentRepository snapshotRepository )
265     {
266         this.snapshotRepository = snapshotRepository;
267     } //-- void setSnapshotRepository( DeploymentRepository ) 
268 
269     /**
270      * Set 
271      *             
272      *             Gives the status of this artifact in the remote
273      * repository.
274      *             This must not be set in your local project, as
275      * it is updated by
276      *             tools placing it in the reposiory. Valid values
277      * are: <code>none</code> (default),
278      *             <code>converted</code> (repository manager
279      * converted this from an Maven 1 POM),
280      *             <code>partner</code>
281      *             (directly synced from a partner Maven 2
282      * repository), <code>deployed</code> (was deployed from a
283      * Maven 2
284      *             instance), <code>verified</code> (has been hand
285      * verified as correct and final).
286      *             
287      *           
288      * 
289      * @param status
290      */
291     public void setStatus( String status )
292     {
293         this.status = status;
294     } //-- void setStatus( String ) 
295 
296 
297     private String modelEncoding = "UTF-8";
298 
299     /**
300      * Set an encoding used for reading/writing the model.
301      *
302      * @param modelEncoding the encoding used when reading/writing the model.
303      */
304     public void setModelEncoding( String modelEncoding )
305     {
306         this.modelEncoding = modelEncoding;
307     }
308 
309     /**
310      * @return the current encoding used when reading/writing this model.
311      */
312     public String getModelEncoding()
313     {
314         return modelEncoding;
315     }
316 }