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 groupId;
68  
69      /**
70       * The version of the artifact to depend on. If this refers to a project version then the repository implementation
71       * may choose the most appropriate artifact version to use.
72       */
73      private String version;
74  
75      public void setClassifier( String classifier )
76      {
77          this.classifier = classifier;
78      }
79  
80      public String getClassifier()
81      {
82          return classifier;
83      }
84  
85      public void setOptional( boolean optional )
86      {
87          this.optional = optional;
88      }
89  
90      public boolean isOptional()
91      {
92          return optional;
93      }
94  
95      public void setScope( String scope )
96      {
97          this.scope = scope;
98      }
99  
100     public String getScope()
101     {
102         return scope;
103     }
104 
105     public void setSystemPath( String systemPath )
106     {
107         this.systemPath = systemPath;
108     }
109 
110     public String getSystemPath()
111     {
112         return systemPath;
113     }
114 
115     public void setType( String type )
116     {
117         this.type = type;
118     }
119 
120     public String getType()
121     {
122         return type;
123     }
124 
125     public void setArtifactId( String artifactId )
126     {
127         this.artifactId = artifactId;
128     }
129 
130     public void setGroupId( String groupId )
131     {
132         this.groupId = groupId;
133     }
134 
135     public void setVersion( String version )
136     {
137         this.version = version;
138     }
139 
140     public String getVersion()
141     {
142         return version;
143     }
144 
145     public String getArtifactId()
146     {
147         return artifactId;
148     }
149 
150     public String getGroupId()
151     {
152         return groupId;
153     }
154 
155     @Override
156     public String toString()
157     {
158         final StringBuilder sb = new StringBuilder();
159         sb.append( "Dependency" );
160         sb.append( "{classifier='" ).append( classifier ).append( '\'' );
161         sb.append( ", optional=" ).append( optional );
162         sb.append( ", scope='" ).append( scope ).append( '\'' );
163         sb.append( ", systemPath='" ).append( systemPath ).append( '\'' );
164         sb.append( ", type='" ).append( type ).append( '\'' );
165         sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
166         sb.append( ", groupId='" ).append( groupId ).append( '\'' );
167         sb.append( ", version='" ).append( version ).append( '\'' );
168         sb.append( '}' );
169         return sb.toString();
170     }
171 }