001: package org.apache.maven.embedder;
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:
022: import org.codehaus.plexus.PlexusContainer;
023: import org.codehaus.plexus.classworlds.ClassWorld;
024:
025: import java.io.File;
026: import java.net.URL;
027: import java.util.List;
028: import java.util.Properties;
029:
030: /**
031: * Configuration of embedder, used when starting up.
032: *
033: * @author mkleint
034: * @author Jason van Zyl
035: */
036: public interface Configuration {
037: // ----------------------------------------------------------------------------
038: // Settings
039: // ----------------------------------------------------------------------------
040:
041: /** Set location of the userSettingsFile settings file to use for the embedder. */
042: Configuration setUserSettingsFile(File userSettingsFile);
043:
044: File getUserSettingsFile();
045:
046: /** Set location of the globalSettingsFiles settings file to use for the embedder. */
047: Configuration setGlobalSettingsFile(File globalSettingsFiles);
048:
049: File getGlobalSettingsFile();
050:
051: // ----------------------------------------------------------------------------
052: // Local Repository
053: // ----------------------------------------------------------------------------
054:
055: /**
056: * This overrides anything set in a settings file.
057: */
058: Configuration setLocalRepository(File localRepository);
059:
060: File getLocalRepository();
061:
062: // ----------------------------------------------------------------------------
063: // Logger
064: // ----------------------------------------------------------------------------
065:
066: Configuration setMavenEmbedderLogger(MavenEmbedderLogger logger);
067:
068: MavenEmbedderLogger getMavenEmbedderLogger();
069:
070: // ----------------------------------------------------------------------------
071: // ClassWorld/ClassLoader
072: // ----------------------------------------------------------------------------
073:
074: ClassWorld getClassWorld();
075:
076: Configuration setClassWorld(ClassWorld classWorld);
077:
078: Configuration setClassLoader(ClassLoader loader);
079:
080: PlexusContainer getParentContainer();
081:
082: Configuration setParentContainer(PlexusContainer parentContainer);
083:
084: // ----------------------------------------------------------------------------
085: // Profiles
086: // ----------------------------------------------------------------------------
087:
088: /** Add profile to activate. */
089: Configuration addActiveProfile(String profile);
090:
091: /** Add profile to inactivate. */
092: Configuration addInactiveProfile(String profile);
093:
094: /** Add a list of String instances with names of profiles to activate. */
095: Configuration addActiveProfiles(List profiles);
096:
097: /** Add a list of String instances with names of profiles to inactivate. */
098: Configuration addInactiveProfiles(List profiles);
099:
100: /** Set a customizer callback implemetation that will be given a chance to modify the plexus container on startup. */
101: Configuration setConfigurationCustomizer(
102: ContainerCustomizer customizer);
103:
104: /** set the system properties to be used during the lifecycle of the embedder. Excluding the time when executing the project, then the properties from MavenExecutionRequestare used. */
105: Configuration setSystemProperties(Properties properties);
106:
107: List getActiveProfiles();
108:
109: List getInactiveProfiles();
110:
111: // ----------------------------------------------------------------------------
112: // Container Customizer
113: // ----------------------------------------------------------------------------
114:
115: ContainerCustomizer getContainerCustomizer();
116:
117: // ----------------------------------------------------------------------------
118: // System Properties
119: // ----------------------------------------------------------------------------
120:
121: Properties getSystemProperties();
122:
123: // ----------------------------------------------------------------------------
124: // Extensions
125: // ----------------------------------------------------------------------------
126:
127: void addExtension(URL url);
128:
129: List getExtensions();
130: }
|