1package org.apache.archiva.metadata.model;
23/*4 * Licensed to the Apache Software Foundation (ASF) under one5 * or more contributor license agreements. See the NOTICE file6 * distributed with this work for additional information7 * regarding copyright ownership. The ASF licenses this file8 * to you under the Apache License, Version 2.0 (the9 * "License"); you may not use this file except in compliance10 * with the License. You may obtain a copy of the License at11 *12 * http://www.apache.org/licenses/LICENSE-2.013 *14 * Unless required by applicable law or agreed to in writing,15 * software distributed under the License is distributed on an16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY17 * KIND, either express or implied. See the License for the18 * specific language governing permissions and limitations19 * under the License.20 */2122import javax.xml.bind.annotation.XmlRootElement;
23import java.io.Serializable;
2425/**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 externally29 */30 @XmlRootElement(name = "dependency")
31publicclassDependency32implements Serializable
33 {
34/**35 * The Maven classifier of the dependency.36 */37private String classifier;
3839/**40 * Whether the dependency is optional or required.41 */42privateboolean optional;
4344/**45 * The Maven scope of the dependency - <tt>compile</tt> (default), <tt>runtime</tt>, etc.46 */47private String scope;
4849/**50 * The system path of the file of the dependency artifact to use.51 */52private String systemPath;
5354/**55 * The Maven type of the dependency.56 */57private String type;
5859/**60 * The Maven artifact ID of the dependency.61 */62private String artifactId;
6364/**65 * The Maven group ID of the dependency.66 */67private String namespace;
6869/**70 * The project id71 */72private String projectId;
7374/**75 * The version of the artifact to depend on. If this refers to a project version then the repository implementation76 * may choose the most appropriate artifact version to use.77 */78private String version;
7980publicvoid setClassifier( String classifier )
81 {
82this.classifier = classifier;
83 }
8485public String getClassifier()
86 {
87return classifier;
88 }
8990publicvoid setOptional( boolean optional )
91 {
92this.optional = optional;
93 }
9495publicboolean isOptional()
96 {
97return optional;
98 }
99100publicvoid setScope( String scope )
101 {
102this.scope = scope;
103 }
104105public String getScope()
106 {
107return scope;
108 }
109110publicvoid setSystemPath( String systemPath )
111 {
112this.systemPath = systemPath;
113 }
114115public String getSystemPath()
116 {
117return systemPath;
118 }
119120publicvoid setType( String type )
121 {
122this.type = type;
123 }
124125public String getType()
126 {
127return type;
128 }
129130publicvoid setArtifactId( String artifactId )
131 {
132this.artifactId = artifactId;
133 }
134135publicvoid setNamespace(String groupId )
136 {
137this.namespace = groupId;
138 }
139140publicvoid setVersion( String version )
141 {
142this.version = version;
143 }
144145public String getVersion()
146 {
147return version;
148 }
149150public String getArtifactId()
151 {
152return artifactId;
153 }
154155public String getNamespace()
156 {
157return namespace;
158 }
159160public String getProjectId() {
161return projectId;
162 }
163164publicvoid setProjectId(String projectId) {
165this.projectId = projectId;
166 }
167168 @Override
169public String toString()
170 {
171final 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( '}' );
182return sb.toString();
183 }
184 }