001package org.apache.archiva.metadata.model; 002 003/* 004 * Licensed to the Apache Software Foundation (ASF) under one 005 * or more contributor license agreements. See the NOTICE file 006 * distributed with this work for additional information 007 * regarding copyright ownership. The ASF licenses this file 008 * to you under the Apache License, Version 2.0 (the 009 * "License"); you may not use this file except in compliance 010 * with the License. You may obtain a copy of the License at 011 * 012 * http://www.apache.org/licenses/LICENSE-2.0 013 * 014 * Unless required by applicable law or agreed to in writing, 015 * software distributed under the License is distributed on an 016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 017 * KIND, either express or implied. See the License for the 018 * specific language governing permissions and limitations 019 * under the License. 020 */ 021 022import javax.xml.bind.annotation.XmlRootElement; 023import java.io.Serializable; 024 025/** 026 * Information about a dependency that this project has on another project or artifact. 027 * 028 * TODO will be reviewing what is appropriate for the base here - rest should be in a maven dependency facet - avoid details on it externally 029 */ 030@XmlRootElement(name = "dependency") 031public class Dependency 032 implements Serializable 033{ 034 /** 035 * The Maven classifier of the dependency. 036 */ 037 private String classifier; 038 039 /** 040 * Whether the dependency is optional or required. 041 */ 042 private boolean optional; 043 044 /** 045 * The Maven scope of the dependency - <tt>compile</tt> (default), <tt>runtime</tt>, etc. 046 */ 047 private String scope; 048 049 /** 050 * The system path of the file of the dependency artifact to use. 051 */ 052 private String systemPath; 053 054 /** 055 * The Maven type of the dependency. 056 */ 057 private String type; 058 059 /** 060 * The Maven artifact ID of the dependency. 061 */ 062 private String artifactId; 063 064 /** 065 * The Maven group ID of the dependency. 066 */ 067 private String namespace; 068 069 /** 070 * The project id 071 */ 072 private String projectId; 073 074 /** 075 * The version of the artifact to depend on. If this refers to a project version then the repository implementation 076 * may choose the most appropriate artifact version to use. 077 */ 078 private String version; 079 080 public void setClassifier( String classifier ) 081 { 082 this.classifier = classifier; 083 } 084 085 public String getClassifier() 086 { 087 return classifier; 088 } 089 090 public void setOptional( boolean optional ) 091 { 092 this.optional = optional; 093 } 094 095 public boolean isOptional() 096 { 097 return optional; 098 } 099 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}