1 package org.apache.maven.project; 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 java.io.File; 23 import java.util.List; 24 25 /** 26 * Convenience interface for plugins to add or replace artifacts and resources on projects. 27 */ 28 public interface MavenProjectHelper 29 { 30 String ROLE = MavenProjectHelper.class.getName(); 31 32 /** 33 * See {@link #attachArtifact(MavenProject, String, String, java.io.File)}, but with type set to null. 34 * @param project project reference. 35 * @param artifactFile artifact file. 36 * @param artifactClassifier artifact classifier. 37 */ 38 void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier ); 39 40 /** 41 * * See {@link #attachArtifact(MavenProject, String, String, java.io.File)}, but with classifier set to null. 42 * @param project project reference. 43 * @param artifactType artifact type. 44 * @param artifactFile arrifact file. 45 */ 46 void attachArtifact( MavenProject project, String artifactType, File artifactFile ); 47 48 /** 49 * Add or replace an artifact to the current project. 50 * @param project the project reference. 51 * @param artifactType the type (e.g. jar) or null. 52 * @param artifactClassifier the classifier or null. 53 * @param artifactFile the file for the artifact. 54 */ 55 void attachArtifact( MavenProject project, String artifactType, String artifactClassifier, File artifactFile ); 56 57 /** 58 * Add a resource directory to the project. 59 * @param project project reference. 60 * @param resourceDirectory directory. 61 * @param includes include patterns. 62 * @param excludes exclude patterns. 63 */ 64 void addResource( MavenProject project, String resourceDirectory, List<String> includes, List<String> excludes ); 65 66 /** 67 * Add a test resource directory to the project. 68 * @param project project reference. 69 * @param resourceDirectory directory. 70 * @param includes include patterns. 71 * @param excludes exclude patterns. 72 */ 73 void addTestResource( MavenProject project, String resourceDirectory, List<String> includes, List<String> excludes ); 74 75 }