This project has retired. For details please refer to its Attic page.
Dependency xref
View Javadoc
1   package org.apache.archiva.metadata.model;
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 javax.xml.bind.annotation.XmlRootElement;
23  import java.io.Serializable;
24  
25  /**
26   * Information about a dependency that this project has on another project or artifact.
27   *
28   * TODO will be reviewing what is appropriate for the base here - rest should be in a maven dependency facet - avoid details on it externally
29   */
30  @XmlRootElement(name = "dependency")
31  public class Dependency
32      implements Serializable
33  {
34      /**
35       * The Maven classifier of the dependency.
36       */
37      private String classifier;
38  
39      /**
40       * Whether the dependency is optional or required.
41       */
42      private boolean optional;
43  
44      /**
45       * The Maven scope of the dependency - <tt>compile</tt> (default), <tt>runtime</tt>, etc.
46       */
47      private String scope;
48  
49      /**
50       * The system path of the file of the dependency artifact to use.
51       */
52      private String systemPath;
53  
54      /**
55       * The Maven type of the dependency.
56       */
57      private String type;
58  
59      /**
60       * The Maven artifact ID of the dependency.
61       */
62      private String artifactId;
63  
64      /**
65       * The Maven group ID of the dependency.
66       */
67      private String namespace;
68  
69      /**
70       * The project id
71       */
72      private String projectId;
73  
74      /**
75       * The version of the artifact to depend on. If this refers to a project version then the repository implementation
76       * may choose the most appropriate artifact version to use.
77       */
78      private String version;
79  
80      public void setClassifier( String classifier )
81      {
82          this.classifier = classifier;
83      }
84  
85      public String getClassifier()
86      {
87          return classifier;
88      }
89  
90      public void setOptional( boolean optional )
91      {
92          this.optional = optional;
93      }
94  
95      public boolean isOptional()
96      {
97          return optional;
98      }
99  
100     public void setScope( String scope )
101     {
102         this.scope = scope;
103     }
104 
105     public String getScope()
106     {
107         return scope;
108     }
109 
110     public void setSystemPath( String systemPath )
111     {
112         this.systemPath = systemPath;
113     }
114 
115     public String getSystemPath()
116     {
117         return systemPath;
118     }
119 
120     public void setType( String type )
121     {
122         this.type = type;
123     }
124 
125     public String getType()
126     {
127         return type;
128     }
129 
130     public void setArtifactId( String artifactId )
131     {
132         this.artifactId = artifactId;
133     }
134 
135     public void setNamespace(String groupId )
136     {
137         this.namespace = groupId;
138     }
139 
140     public void setVersion( String version )
141     {
142         this.version = version;
143     }
144 
145     public String getVersion()
146     {
147         return version;
148     }
149 
150     public String getArtifactId()
151     {
152         return artifactId;
153     }
154 
155     public String getNamespace()
156     {
157         return namespace;
158     }
159 
160     public String getProjectId() {
161         return projectId;
162     }
163 
164     public void setProjectId(String projectId) {
165         this.projectId = projectId;
166     }
167 
168     @Override
169     public String toString()
170     {
171         final StringBuilder sb = new StringBuilder();
172         sb.append( "Dependency" );
173         sb.append( "{classifier='" ).append( classifier ).append( '\'' );
174         sb.append( ", optional=" ).append( optional );
175         sb.append( ", scope='" ).append( scope ).append( '\'' );
176         sb.append( ", systemPath='" ).append( systemPath ).append( '\'' );
177         sb.append( ", type='" ).append( type ).append( '\'' );
178         sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
179         sb.append( ", namespace='" ).append(namespace).append( '\'' );
180         sb.append( ", version='" ).append( version ).append( '\'' );
181         sb.append( '}' );
182         return sb.toString();
183     }
184 }