View Javadoc

1   package org.apache.maven.artifact.deployer;
2   
3   /* ====================================================================
4    *   Licensed to the Apache Software Foundation (ASF) under one or more
5    *   contributor license agreements.  See the NOTICE file distributed with
6    *   this work for additional information regarding copyright ownership.
7    *   The ASF licenses this file to You under the Apache License, Version 2.0
8    *   (the "License"); you may not use this file except in compliance with
9    *   the License.  You may obtain a copy of the License at
10   *
11   *       http://www.apache.org/licenses/LICENSE-2.0
12   *
13   *   Unless required by applicable law or agreed to in writing, software
14   *   distributed under the License is distributed on an "AS IS" BASIS,
15   *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   *   See the License for the specific language governing permissions and
17   *   limitations under the License.
18   * ====================================================================
19   */
20  
21  import org.apache.maven.MavenException;
22  import org.apache.maven.project.Project;
23  import org.apache.maven.repository.ArtifactTypeHandler;
24  
25  /**
26   * 
27   * The Bean which is used in Jelly Scripts 
28   * and serves as a proxy to Artifact Deployer API
29   * 
30   * Note that all paths in repository are computed 
31   * and source file name is igonred.
32   * 
33   * Other remark: To deploy an artifact means much 
34   * more then to copy single file. In every case
35   * also MD5 file created and copied  to remote repository.
36   * In case of snapshots the process in even more complex. 
37   * 
38   * @author <a href="mailto:michal.maczka@dimatics.com">Michal Maczka</a> 
39   * @version $Id: ArtifactDeployer.java 532339 2007-04-25 12:28:56Z ltheussl $
40   */
41  public interface ArtifactDeployer
42  {
43      /**
44       * Deploy given artifact to remote repository.
45       * 
46       * @param artifact Artifact filename
47       * @param type  The type of the artifact 
48       *     (like <code>war</code>, <code>jar</code>)
49       * @param project The project which is a producer of the artifact
50       * @param handler the type handler for the artifact
51       *          
52       * @throws MavenException 
53       */
54      void deploy( String artifact, String type, Project project, ArtifactTypeHandler handler )
55          throws MavenException;
56  
57      /**
58       * Deploy given artifact as a snapshot to remote repository.
59       * @param artifact
60       * @param type The type of the artifact 
61       *     (like <code>war</code>, <code>jar</code>)
62       * @param project The project which is a producer of the artifact
63       * @param handler the type handler for the artifact
64       *
65       * @throws MavenException
66       */
67      void deploySnapshot( String artifact, String type, Project project, ArtifactTypeHandler handler )
68          throws MavenException;
69  
70      /**
71       * Install given artifact in local repository.
72       * @param artifact file name of the artifact
73       * @param type The type of the artifact 
74       *     (like <code>war</code>, <code>jar</code>)
75       * @param project The project which is a producer of the artifact
76       * @param handler the type handler for the artifact
77       * @throws MavenException
78       */
79      void install( String artifact, String type, Project project, ArtifactTypeHandler handler )
80          throws MavenException;
81  
82      /**
83       * Install given artifact as snapshot in local repository.
84       * @param artifact
85       * @param type The type of the artifact 
86       *     (like <code>war</code>, <code>jar</code>)
87       * @param project The project which is a producer of the artifact
88       * @param handler the type handler for the artifact
89       * @throws MavenException
90       */
91      void installSnapshot( String artifact, String type, Project project, ArtifactTypeHandler handler )
92          throws MavenException;
93  }