1 package org.apache.archiva.metadata.model;
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
12 * http://www.apache.org/licenses/LICENSE-2.0
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
22 import javax.xml.bind.annotation.XmlRootElement;
25 * Information about a dependency that this project has on another project or artifact.
27 * @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 @XmlRootElement( name = "dependency" )
30 public class Dependency
33 * The Maven classifier of the dependency.
35 private String classifier;
38 * Whether the dependency is optional or required.
40 private boolean optional;
43 * The Maven scope of the dependency - <tt>compile</tt> (default), <tt>runtime</tt>, etc.
48 * The system path of the file of the dependency artifact to use.
50 private String systemPath;
53 * The Maven type of the dependency.
58 * The Maven artifact ID of the dependency.
60 private String artifactId;
63 * The Maven group ID of the dependency.
65 private String groupId;
68 * The version of the artifact to depend on. If this refers to a project version then the repository implementation
69 * may choose the most appropriate artifact version to use.
71 private String version;
73 public void setClassifier( String classifier )
75 this.classifier = classifier;
78 public String getClassifier()
83 public void setOptional( boolean optional )
85 this.optional = optional;
88 public boolean isOptional()
93 public void setScope( String scope )
98 public String getScope()
103 public void setSystemPath( String systemPath )
105 this.systemPath = systemPath;
108 public String getSystemPath()
113 public void setType( String type )
118 public String getType()
123 public void setArtifactId( String artifactId )
125 this.artifactId = artifactId;
128 public void setGroupId( String groupId )
130 this.groupId = groupId;
133 public void setVersion( String version )
135 this.version = version;
138 public String getVersion()
143 public String getArtifactId()
148 public String getGroupId()
154 public String toString()
156 final StringBuilder sb = new StringBuilder();
157 sb.append( "Dependency" );
158 sb.append( "{classifier='" ).append( classifier ).append( '\'' );
159 sb.append( ", optional=" ).append( optional );
160 sb.append( ", scope='" ).append( scope ).append( '\'' );
161 sb.append( ", systemPath='" ).append( systemPath ).append( '\'' );
162 sb.append( ", type='" ).append( type ).append( '\'' );
163 sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
164 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
165 sb.append( ", version='" ).append( version ).append( '\'' );
167 return sb.toString();