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 groupId;
6869/**70 * The version of the artifact to depend on. If this refers to a project version then the repository implementation71 * may choose the most appropriate artifact version to use.72 */73private String version;
7475publicvoid setClassifier( String classifier )
76 {
77this.classifier = classifier;
78 }
7980public String getClassifier()
81 {
82return classifier;
83 }
8485publicvoid setOptional( boolean optional )
86 {
87this.optional = optional;
88 }
8990publicboolean isOptional()
91 {
92return optional;
93 }
9495publicvoid setScope( String scope )
96 {
97this.scope = scope;
98 }
99100public String getScope()
101 {
102return scope;
103 }
104105publicvoid setSystemPath( String systemPath )
106 {
107this.systemPath = systemPath;
108 }
109110public String getSystemPath()
111 {
112return systemPath;
113 }
114115publicvoid setType( String type )
116 {
117this.type = type;
118 }
119120public String getType()
121 {
122return type;
123 }
124125publicvoid setArtifactId( String artifactId )
126 {
127this.artifactId = artifactId;
128 }
129130publicvoid setGroupId( String groupId )
131 {
132this.groupId = groupId;
133 }
134135publicvoid setVersion( String version )
136 {
137this.version = version;
138 }
139140public String getVersion()
141 {
142return version;
143 }
144145public String getArtifactId()
146 {
147return artifactId;
148 }
149150public String getGroupId()
151 {
152return groupId;
153 }
154155 @Override
156public String toString()
157 {
158final 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( '}' );
169return sb.toString();
170 }
171 }