1 package org.apache.maven.shared.artifact.filter.resolve.transform; 2 3 /* 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 11 * 12 * http://www.apache.org/licenses/LICENSE-2.0 13 * 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 19 * under the License. 20 */ 21 22 import org.apache.maven.artifact.Artifact; 23 import org.apache.maven.model.Dependency; 24 import org.apache.maven.shared.artifact.filter.resolve.Node; 25 26 /** 27 * 28 * @author Robert Scholte 29 * @since 3.0 30 */ 31 class ArtifactIncludeNode implements Node 32 { 33 private final Artifact artifact; 34 35 ArtifactIncludeNode( Artifact artifact ) 36 { 37 this.artifact = artifact; 38 } 39 40 /** 41 * {@inheritDoc} 42 * 43 * Note: an artifact doesn't contain exclusion information, so it won't be available here. 44 * When required switch to filtering based on Aether. 45 * @see EclipseAetherNode 46 */ 47 @Override 48 public Dependency getDependency() 49 { 50 Dependency mavenDependency = new Dependency(); 51 mavenDependency.setGroupId( artifact.getGroupId() ); 52 mavenDependency.setArtifactId( artifact.getArtifactId() ); 53 mavenDependency.setVersion( artifact.getVersion() ); 54 mavenDependency.setClassifier( artifact.getClassifier() ); 55 mavenDependency.setType( artifact.getType() ); 56 mavenDependency.setScope( artifact.getScope() ); 57 mavenDependency.setOptional( artifact.isOptional() ); 58 // no setExcludes possible 59 60 return mavenDependency; 61 } 62 63 64 }