update to new container

git-svn-id: https://svn.apache.org/repos/asf/maven/components/trunk@163972 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Brett Leslie Porter 2005-04-19 09:00:48 +00:00
parent 32c12bd7c2
commit d377256c93
4 changed files with 30 additions and 28 deletions

View File

@ -16,7 +16,7 @@
<dependency>
<groupId>plexus</groupId>
<artifactId>plexus-container-artifact</artifactId>
<version>1.0-alpha-2</version>
<version>1.0-alpha-3-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.apache.maven</groupId>

View File

@ -24,6 +24,7 @@ import org.apache.maven.plugin.descriptor.PluginDescriptorBuilder;
import org.codehaus.plexus.component.discovery.AbstractComponentDiscoverer;
import org.codehaus.plexus.component.repository.ComponentDescriptor;
import org.codehaus.plexus.component.repository.ComponentSetDescriptor;
import org.codehaus.plexus.configuration.PlexusConfigurationException;
import java.io.Reader;
import java.util.ArrayList;
@ -51,7 +52,7 @@ public class MavenPluginDiscoverer
}
public ComponentSetDescriptor createComponentDescriptors( Reader componentDescriptorConfiguration, String source )
throws Exception
throws PlexusConfigurationException
{
PluginDescriptor pluginDescriptor;
@ -59,10 +60,10 @@ public class MavenPluginDiscoverer
{
pluginDescriptor = builder.build( componentDescriptorConfiguration );
}
catch ( Exception e )
catch ( PlexusConfigurationException e )
{
// If the plugin is not valid, we cannot continue as it may make the lifecycle ebhave differently than expected
throw new Exception( "Cannot process plugin descriptor: " + source, e );
throw new PlexusConfigurationException( "Cannot process plugin descriptor: " + source, e );
}
// ----------------------------------------------------------------------

View File

@ -45,6 +45,7 @@ import org.codehaus.plexus.PlexusConstants;
import org.codehaus.plexus.PlexusContainer;
import org.codehaus.plexus.component.repository.exception.ComponentLookupException;
import org.codehaus.plexus.context.Context;
import org.codehaus.plexus.context.ContextException;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@ -583,7 +584,7 @@ public class DefaultMavenProjectBuilder
}
public void contextualize( Context context )
throws Exception
throws ContextException
{
this.container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
}

View File

@ -16,16 +16,15 @@ package org.apache.maven.settings;
* limitations under the License.
*/
import java.io.File;
import java.io.FileReader;
import org.apache.maven.MavenConstants;
import org.apache.maven.settings.io.xpp3.SettingsXpp3Reader;
import org.codehaus.plexus.logging.AbstractLogEnabled;
import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
import org.codehaus.plexus.util.IOUtil;
import java.io.File;
import java.io.FileReader;
/**
* @author jdcasey
* @version $Id$
@ -36,7 +35,9 @@ public class DefaultMavenSettingsBuilder
{
public static final String userHome = System.getProperty( "user.home" );
/** @configuration */
/**
* @configuration
*/
private String settingsPath;
private File settingsFile;
@ -46,7 +47,6 @@ public class DefaultMavenSettingsBuilder
// ----------------------------------------------------------------------
public void initialize()
throws Exception
{
settingsFile = getSettingsFile();
@ -89,7 +89,8 @@ public class DefaultMavenSettingsBuilder
if ( settings.getActiveProfile() == null )
{
File mavenUserConfigurationDirectory = new File( userHome, MavenConstants.MAVEN_USER_CONFIGURATION_DIRECTORY );
File mavenUserConfigurationDirectory = new File( userHome,
MavenConstants.MAVEN_USER_CONFIGURATION_DIRECTORY );
if ( !mavenUserConfigurationDirectory.exists() )
{
if ( !mavenUserConfigurationDirectory.mkdirs() )
@ -98,8 +99,7 @@ public class DefaultMavenSettingsBuilder
}
}
String localRepository =
new File( mavenUserConfigurationDirectory, MavenConstants.MAVEN_REPOSITORY ).getAbsolutePath();
String localRepository = new File( mavenUserConfigurationDirectory, MavenConstants.MAVEN_REPOSITORY ).getAbsolutePath();
settings.initializeActiveProfile( localRepository );
}