/* * Copyright 2011 William Bernardet * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.googlecode.japi.checker.maven.plugin; import org.apache.maven.artifact.Artifact; import com.googlecode.japi.checker.Utils; public class ArtifactItem { /** * Group Id of Artifact * * @parameter * @required */ private String groupId; /** * Name of Artifact * * @parameter * @required */ private String artifactId; /** * Version of Artifact * * @parameter */ private String version = null; /** * Type of Artifact (War,Jar,etc) * * @parameter * @required */ private String type = "jar"; private Artifact artifact; public ArtifactItem() { // default constructor } public ArtifactItem( Artifact artifact ) { this.setArtifact( artifact ); this.setArtifactId( artifact.getArtifactId() ); this.setGroupId( artifact.getGroupId() ); this.setType( artifact.getType() ); this.setVersion( artifact.getVersion() ); } /** * @return Returns the artifactId. */ public String getArtifactId() { return artifactId; } /** * @param artifactId * The artifactId to set. */ public void setArtifactId( String artifact ) { this.artifactId = Utils.fixEmpty( artifact ); } /** * @return Returns the groupId. */ public String getGroupId() { return groupId; } /** * @param groupId * The groupId to set. */ public void setGroupId( String groupId ) { this.groupId = Utils.fixEmpty( groupId ); } /** * @return Returns the type. */ public String getType() { return type; } /** * @param type * The type to set. */ public void setType( String type ) { this.type = Utils.fixEmpty( type ); } /** * @return Returns the version. */ public String getVersion() { return version; } /** * @param version * The version to set. */ public void setVersion( String version ) { this.version = Utils.fixEmpty( version ); } /** * @return Returns the artifact. */ public Artifact getArtifact() { return this.artifact; } /** * @param artifact * The artifact to set. */ public void setArtifact( Artifact artifact ) { this.artifact = artifact; } }