001package org.apache.maven.project;
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 java.io.File;
023import java.util.List;
024
025/**
026 * Convenience interface for plugins to add or replace artifacts and resources on projects.
027 */
028public interface MavenProjectHelper
029{
030    String ROLE = MavenProjectHelper.class.getName();
031
032    /**
033     * See {@link #attachArtifact(MavenProject, String, String, java.io.File)}, but with type set to null.
034     * @param project project reference.
035     * @param artifactFile artifact file.
036     * @param artifactClassifier artifact classifier.
037     */
038    void attachArtifact( MavenProject project, File artifactFile, String artifactClassifier );
039
040    /**
041     * * See {@link #attachArtifact(MavenProject, String, String, java.io.File)}, but with classifier set to null.
042     * @param project project reference.
043     * @param artifactType artifact type.
044     * @param artifactFile arrifact file.
045     */
046    void attachArtifact( MavenProject project, String artifactType, File artifactFile );
047
048    /**
049     * Add or replace an artifact to the current project.
050     * @param project the project reference.
051     * @param artifactType the type (e.g. jar) or null.
052     * @param artifactClassifier the classifier or null.
053     * @param artifactFile the file for the artifact.
054     */
055    void attachArtifact( MavenProject project, String artifactType, String artifactClassifier, File artifactFile );
056
057    /**
058     * Add a resource directory to the project.
059     * @param project project reference.
060     * @param resourceDirectory directory.
061     * @param includes include patterns.
062     * @param excludes exclude patterns.
063     */
064    void addResource( MavenProject project, String resourceDirectory, List<String> includes, List<String> excludes );
065
066    /**
067     * Add a test resource directory to the project.
068     * @param project project reference.
069     * @param resourceDirectory directory.
070     * @param includes include patterns.
071     * @param excludes exclude patterns.
072     */
073    void addTestResource( MavenProject project, String resourceDirectory, List<String> includes, List<String> excludes );
074
075}