You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jv...@apache.org on 2004/04/04 19:23:44 UTC
cvs commit: maven-components/maven-core/src/main/resources/org/apache/maven plexus.xml
jvanzyl 2004/04/04 10:23:44
Modified: maven-core project.xml
maven-core/src/main/java/org/apache/maven DefaultMaven.java
Maven.java MavenConstants.java
maven-core/src/main/java/org/apache/maven/plugin/manager
DefaultPluginManagerManager.java PluginManager.java
PluginManagerManager.java
maven-core/src/main/java/org/apache/maven/plugin/plexus
PlexusPluginManager.java
maven-core/src/main/resources/org/apache/maven plexus.xml
Added: maven-core/src/main/java/org/apache/maven
GoalNotFoundException.java
MavenCommandLineFrontEnd.java
MavenHomeNotDefinedException.java
Removed: maven-core/src/main/java/org/apache/maven MavenBooter.java
UnknownGoalException.java
maven-core/src/main/java/org/apache/maven/cli
CLIManager.java
maven-core/src/main/java/org/apache/maven/werkz Action.java
AttainGoalListener.java Callback.java
CyclicGoalChainException.java DefaultAction.java
Goal.java NoActionDefinitionException.java
NoSuchGoalException.java PostGoal.java PreGoal.java
Session.java UnattainableGoalException.java
WerkzException.java WerkzProject.java
Log:
Revision Changes Path
1.3 +20 -0 maven-components/maven-core/project.xml
Index: project.xml
===================================================================
RCS file: /home/cvs/maven-components/maven-core/project.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- project.xml 22 Mar 2004 18:05:39 -0000 1.2
+++ project.xml 4 Apr 2004 17:23:43 -0000 1.3
@@ -89,6 +89,12 @@
<version>2.5.1</version>
</dependency>
+ <dependency>
+ <groupId>maven</groupId>
+ <artifactId>wagon-api</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ </dependency>
+
<!-- This will eventually be removed -->
<dependency>
<groupId>plexus</groupId>
@@ -100,6 +106,20 @@
<groupId>surefire</groupId>
<artifactId>surefire-booter</artifactId>
<version>1.0</version>
+ </dependency>
+
+ <!-- Wagon -->
+
+ <dependency>
+ <groupId>maven</groupId>
+ <artifactId>wagon-api</artifactId>
+ <version>0.9-SNAPSHOT</version>
+ </dependency>
+
+ <dependency>
+ <groupId>maven</groupId>
+ <artifactId>wagon-http</artifactId>
+ <version>0.9-SNAPSHOT</version>
</dependency>
</dependencies>
1.13 +42 -14 maven-components/maven-core/src/main/java/org/apache/maven/DefaultMaven.java
Index: DefaultMaven.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/DefaultMaven.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- DefaultMaven.java 2 Apr 2004 18:44:55 -0000 1.12
+++ DefaultMaven.java 4 Apr 2004 17:23:44 -0000 1.13
@@ -17,27 +17,30 @@
*/
import org.apache.maven.plugin.PluginExecutionResponse;
-import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.descriptor.GoalDescriptor;
+import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.manager.PluginManagerManager;
import org.apache.maven.project.MavenProject;
import org.apache.maven.project.MavenProjectBuilder;
+import org.apache.maven.project.ProjectBuildingException;
import org.codehaus.plexus.i18n.I18N;
-import org.codehaus.plexus.util.DirectoryScanner;
-import org.codehaus.plexus.util.StringUtils;
import java.io.File;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
import java.util.List;
-import java.util.Set;
import java.util.Map;
public class DefaultMaven
implements Maven
{
// ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
+ private String mavenHome;
+
+ private String mavenLocalHome;
+
+ // ----------------------------------------------------------------------
// Components
// ----------------------------------------------------------------------
@@ -52,20 +55,25 @@
// ----------------------------------------------------------------------
public void attainGoal( String goal )
- throws Exception
+ throws GoalNotFoundException
{
- attainGoal( (MavenProject)null, goal );
+ attainGoal( (MavenProject) null, goal );
}
public void attainGoal( File projectFile, String goal )
- throws Exception
+ throws ProjectBuildingException,GoalNotFoundException
{
- attainGoal( getProject( projectFile) , goal );
+ attainGoal( getProject( projectFile ), goal );
}
public void attainGoal( MavenProject project, String goal )
- throws Exception
+ throws GoalNotFoundException
{
+ if ( !getGoalDescriptors().containsKey( goal ) )
+ {
+ throw new GoalNotFoundException( goal );
+ }
+
PluginExecutionResponse response = pluginMM.attainGoal( project, goal );
if ( response.exceptionOccurred() )
@@ -107,13 +115,13 @@
// ----------------------------------------------------------------------
public MavenProject getProject( File project )
- throws Exception
+ throws ProjectBuildingException
{
return projectBuilder.build( project );
}
public MavenProject getProject( File project, boolean useParent )
- throws Exception
+ throws ProjectBuildingException
{
return projectBuilder.build( project, useParent );
}
@@ -127,4 +135,24 @@
{
return projectBuilder.getSortedProjects( projects );
}
+
+ // ----------------------------------------------------------------------
+ // Maven home
+ // ----------------------------------------------------------------------
+
+ public void setMavenHome( String mavenHome )
+ {
+ this.mavenHome = mavenHome;
+ }
+
+ public String getMavenHome()
+ {
+ if ( mavenHome == null )
+ {
+ mavenHome = System.getProperty( MavenConstants.MAVEN_HOME );
+ }
+
+ return mavenHome;
+ }
}
+
1.6 +16 -3 maven-components/maven-core/src/main/java/org/apache/maven/Maven.java
Index: Maven.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/Maven.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- Maven.java 2 Apr 2004 18:37:43 -0000 1.5
+++ Maven.java 4 Apr 2004 17:23:44 -0000 1.6
@@ -18,6 +18,8 @@
import org.apache.maven.plugin.descriptor.PluginDescriptor;
import org.apache.maven.plugin.descriptor.GoalDescriptor;
+import org.apache.maven.project.ProjectBuildingException;
+import org.apache.maven.project.MavenProject;
import java.io.File;
import java.util.List;
@@ -39,10 +41,13 @@
// ----------------------------------------------------------------------
void attainGoal( String goal )
- throws Exception;
+ throws GoalNotFoundException;
+
+ void attainGoal( MavenProject project, String goal )
+ throws GoalNotFoundException;
void attainGoal( File project, String goal )
- throws Exception;
+ throws ProjectBuildingException,GoalNotFoundException;
// ----------------------------------------------------------------------
// Plugin descriptors
@@ -59,4 +64,12 @@
Map getGoalDescriptors();
GoalDescriptor getGoalDescriptor( String goalId );
+
+ // ----------------------------------------------------------------------
+ // Maven home
+ // ----------------------------------------------------------------------
+
+ void setMavenHome( String mavenHome );
+
+ String getMavenHome();
}
1.4 +1 -116 maven-components/maven-core/src/main/java/org/apache/maven/MavenConstants.java
Index: MavenConstants.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/MavenConstants.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- MavenConstants.java 21 Mar 2004 00:33:17 -0000 1.3
+++ MavenConstants.java 4 Apr 2004 17:23:44 -0000 1.4
@@ -16,136 +16,21 @@
* limitations under the License.
*/
-/**
- * MavenSession constants.
- *
- * @author <a href="mailto:jason@zenplex.com">Jason van Zyl</a>
- * @version $Id$
- */
public class MavenConstants
{
- /**
- * This is an internal version for MavenSession self updating
- * procedures. A MavenSession installation can query a MavenSession
- * installation distributor to see if it is up-to-date
- * and self-update if required.
- */
public static final int MAVEN_VERSION = 3;
- /**
- * This is the version of the POM that this version of
- * MavenSession operates with. If a descrepancy is found between
- * the version of the POM being used and the version of
- * the POM that this version of MavenSession can deal with then
- * the POM will be transformed into compliance.
- */
public static final int POM_VERSION = 3;
- /** Online tag. */
public static final String ONLINE = "maven.mode.online";
- /** Jar Override tag. */
- public static final String JAR_OVERRIDE = "maven.jar.override";
-
- /** Jar Override property tag. */
- public static final String JAR_OVERRIDE_PROPERTY = "maven.jar.";
-
- /** Local Repository tag. */
public static final String REPO_LOCAL = "maven.repo.local";
- /** Local Repository tag. */
public static final String REPO_REMOTE = "maven.repo.remote";
- /** Local Repository enabled tag. */
public static final String REPO_REMOTE_ENABLED = "maven.repo.remote.enabled";
- /** Proxy host tag. */
- public static final String PROXY_HOST = "maven.proxy.host";
-
- /** Proxy port tag. */
- public static final String PROXY_PORT = "maven.proxy.port";
-
- /** Proxy user name tag. */
- public static final String PROXY_USERNAME = "maven.proxy.username";
-
- /** Proxy password tag. */
- public static final String PROXY_PASSWORD = "maven.proxy.password";
-
- /** Snapshot JAR signifier tag. */
- public static final String SNAPSHOT_SIGNIFIER = "SNAPSHOT";
-
- /** Driver properties */
- public static final String DRIVER_PROPERTIES = "driver.properties";
-
- /** Project build file name. (maven.xml) */
- public static final String BUILD_FILE_NAME = "maven.xml";
-
- /** Defaults properties */
- public static final String DEFAULTS_PROPERTIES = "defaults.properties";
-
- // Context tags.
-
- /** MavenSession home context tag **/
- public static final String MAVEN_HOME = "maven.home";
-
- /** MavenSession home local context tag **/
- public static final String MAVEN_HOME_LOCAL = "maven.home.local";
-
- /** MavenSession unpacked plugins context tag **/
- public static final String MAVEN_UNPACKED_PLUGINS_DIR = "maven.plugin.unpacked.dir";
-
- /** MavenSession build file url context tag **/
- public static final String MAVEN_BUILD_FILE_URL = "maven.project.buildFile.url";
-
- /** MavenSession ant project context tag **/
- public static final String MAVEN_ANT_PROJECT = "maven.ant.project";
-
- /** MavenSession POM context tag **/
- public static final String MAVEN_POM = "pom";
-
- /** MavenSession goalDescriptors context tag **/
- public static final String MAVEN_GOALS = "maven.goalDescriptors";
-
- /** MavenSession project verifier context tag **/
- public static final String MAVEN_PROJECT_VERIFIER = "maven.project.verifier";
-
- /** Werkz project context tag **/
- public static final String WERKZ_PROJECT = "org.apache.commons.jelly.werkz.Project";
-
- /** Reactor projects context tag **/
- public static final String REACTOR_PROJECT = "maven.reactorProjects";
-
- /** Plugin Manager tag. */
- public static final String PLUGIN_MANAGER = "maven.plugin.manager";
-
- /** Jelly XMLOutput tag. */
- public static final String XML_OUTPUT = "maven.xmlOutput";
-
- /** MavenSession debug flag tag. */
public static final String DEBUG_ON = "maven.debugOn";
- /** MavenSession debug flag tag. */
- public static final String EMACS_MODE_ON = "maven.emacsModeOn";
-
- /** Descriptor directory tag. (project.xml) */
- public static final String DESCRIPTOR_DIRECTORY = "maven.descriptorDirectory";
-
- /** Project build file tag. (maven.xml) */
- public static final String BUILD_FILE = "maven.projectBuildFile";
-
- /** Project descriptor file tag. (project.xml) */
- public static final String DESCRIPTOR_FILE = "maven.descriptorFile";
-
- /** Dependency classpath tag. */
- public static final String DEPENDENCY_CLASSPATH = "maven.dependency.classpath";
-
- /** Dependency classpath tag. */
- public static final String MAVEN = "maven.session";
-
- /** Maven compile sourceroots. */
- public static final String COMPILE_SOURCEROOTS = "compile.sourceroots";
-
- /** Maven test compile sourceroots. */
- public static final String TEST_COMPILE_SOURCEROOTS = "test.compile.sourceroots";
-
+ public static final String MAVEN_HOME = "maven.home";
}
1.1 maven-components/maven-core/src/main/java/org/apache/maven/GoalNotFoundException.java
Index: GoalNotFoundException.java
===================================================================
package org.apache.maven;
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
public class GoalNotFoundException
extends Exception
{
private String goalName;
public GoalNotFoundException( String goal )
{
super( "Unknown goal \"" + goal + "\"" );
this.goalName = goal;
}
public String getGoalName()
{
return this.goalName;
}
}
1.1 maven-components/maven-core/src/main/java/org/apache/maven/MavenCommandLineFrontEnd.java
Index: MavenCommandLineFrontEnd.java
===================================================================
package org.apache.maven;
/*
* Copyright 2001-2004 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.apache.commons.cli.CommandLine;
import org.apache.commons.cli.CommandLineParser;
import org.apache.commons.cli.HelpFormatter;
import org.apache.commons.cli.OptionBuilder;
import org.apache.commons.cli.Options;
import org.apache.commons.cli.ParseException;
import org.apache.commons.cli.PosixParser;
import org.codehaus.classworlds.ClassRealm;
import org.codehaus.classworlds.ClassWorld;
import org.codehaus.plexus.embed.Embedder;
import org.codehaus.plexus.i18n.I18N;
import java.io.File;
import java.net.URL;
import java.util.Iterator;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id: MavenCommandLineFrontEnd.java,v 1.1 2004/04/04 17:23:44 jvanzyl Exp $
*/
public class MavenCommandLineFrontEnd
{
public static final String POM_FILE_NAME = "project.xml";
private static final String WORK_OFFLINE = "o";
private static final String SET_SYSTEM_PROPERTY = "D";
private static final String DEBUG = "X";
public static void main( String[] args, ClassWorld classWorld )
throws Exception
{
CLIManager cliManager = new CLIManager();
CommandLine commandLine = cliManager.parse( args );
initializeSystemProperties( commandLine );
Embedder embedder = new Embedder();
URL url = MavenCommandLineFrontEnd.class.getResource( "plexus.xml" );
embedder.setConfiguration( url );
ClassRealm rootClassRealm = classWorld.getRealm( "root" );
embedder.setClassLoader( rootClassRealm.getClassLoader() );
embedder.addContextValue( "rootClassRealm", rootClassRealm );
File projectFile = new File( System.getProperty( "user.dir" ), POM_FILE_NAME );
if ( projectFile.exists() )
{
if ( projectFile.length() == 0 )
{
I18N i18n = (I18N) embedder.lookup( I18N.ROLE );
throw new Exception( i18n.format( "empty.descriptor.error", projectFile.getName() ) );
}
}
embedder.start();
Maven maven = (Maven) embedder.lookup( Maven.ROLE );
for ( Iterator i = commandLine.getArgList().iterator(); i.hasNext(); )
{
maven.attainGoal( projectFile, (String) i.next() );
}
}
public static void initializeSystemProperties( CommandLine commandLine )
{
// Options that are set on the command line become system properties
// and therefore are set in the session properties. System properties
// are most dominant.
if ( commandLine.hasOption( DEBUG ) )
{
System.setProperty( MavenConstants.DEBUG_ON, "true" );
}
else
{
System.setProperty( MavenConstants.DEBUG_ON, "false" );
}
if ( commandLine.hasOption( WORK_OFFLINE ) )
{
System.setProperty( MavenConstants.ONLINE, "false" );
}
else
{
System.setProperty( MavenConstants.ONLINE, "true" );
}
if ( commandLine.hasOption( SET_SYSTEM_PROPERTY ) )
{
String[] defStrs = commandLine.getOptionValues( SET_SYSTEM_PROPERTY );
for ( int i = 0; i < defStrs.length; ++i )
{
setCliProperty( defStrs[i] );
}
}
}
private static void setCliProperty( String property )
{
String name = null;
String value = null;
int i = property.indexOf( "=" );
if ( i <= 0 )
{
name = property.trim();
value = "true";
}
else
{
name = property.substring( 0, i ).trim();
value = property.substring( i + 1 ).trim();
}
System.setProperty( name, value );
}
static class CLIManager
{
private Options options = null;
CLIManager()
{
options = new Options();
options.addOption( OptionBuilder
.withLongOpt( "nobanner" )
.withDescription( "Suppress logo banner" )
.create( 'b' ) );
options.addOption( OptionBuilder
.withLongOpt( "define" )
.hasArg()
.withDescription( "Define a system property" )
.create( 'D' ) );
options.addOption( OptionBuilder
.withLongOpt( "dir" )
.hasArg()
.withDescription( "Set effective working directory" )
.create( 'd' ) );
options.addOption( OptionBuilder
.withLongOpt( "exception" )
.withDescription( "Produce exception stack traces" )
.create( 'e' ) );
options.addOption( OptionBuilder
.withLongOpt( "goalDescriptors" )
.withDescription( "Display available goalDescriptors" )
.create( 'g' ) );
options.addOption( OptionBuilder
.withLongOpt( "help" )
.withDescription( "Display help information" )
.create( 'h' ) );
options.addOption( OptionBuilder
.withLongOpt( "offline" )
.withDescription( "Build is happening offline" )
.create( 'o' ) );
options.addOption( OptionBuilder
.withLongOpt( "version" )
.withDescription( "Display version information" )
.create( 'v' ) );
options.addOption( OptionBuilder
.withLongOpt( "debug" )
.withDescription( "Produce execution debug output" )
.create( 'X' ) );
}
public CommandLine parse( String[] args ) throws ParseException
{
CommandLineParser parser = new PosixParser();
return parser.parse( options, args );
}
public void displayHelp()
{
HelpFormatter formatter = new HelpFormatter();
formatter.printHelp( "maven [options] [goal [goal2 [goal3] ...]]", "\nOptions:", options, "\n" );
}
}
}
1.1 maven-components/maven-core/src/main/java/org/apache/maven/MavenHomeNotDefinedException.java
Index: MavenHomeNotDefinedException.java
===================================================================
package org.apache.maven;
/**
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
* @version $Id: MavenHomeNotDefinedException.java,v 1.1 2004/04/04 17:23:44 jvanzyl Exp $
*/
public class MavenHomeNotDefinedException
extends Exception
{
public MavenHomeNotDefinedException( String message )
{
super( message );
}
public MavenHomeNotDefinedException( Throwable cause )
{
super( cause );
}
public MavenHomeNotDefinedException( String message, Throwable cause )
{
super( message, cause );
}
}
1.8 +16 -15 maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/DefaultPluginManagerManager.java
Index: DefaultPluginManagerManager.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/DefaultPluginManagerManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- DefaultPluginManagerManager.java 2 Apr 2004 18:33:13 -0000 1.7
+++ DefaultPluginManagerManager.java 4 Apr 2004 17:23:44 -0000 1.8
@@ -16,7 +16,7 @@
* limitations under the License.
*/
-import org.apache.maven.UnknownGoalException;
+import org.apache.maven.GoalNotFoundException;
import org.apache.maven.plugin.PluginExecutionRequest;
import org.apache.maven.plugin.PluginExecutionResponse;
import org.apache.maven.plugin.descriptor.GoalDescriptor;
@@ -47,16 +47,24 @@
private ClassRealm rootClassRealm;
+ // ----------------------------------------------------------------------
// Components
+ // ----------------------------------------------------------------------
protected Map pluginManagers;
+ // ----------------------------------------------------------------------
// Configuration
+ // ----------------------------------------------------------------------
protected String mavenHome;
protected String mavenLocalHome;
+ // ----------------------------------------------------------------------
+ //
+ // ----------------------------------------------------------------------
+
protected DAG dag = new DAG();
protected Map goalDescriptors;
@@ -79,25 +87,15 @@
}
// ----------------------------------------------------------------------
- //
+ // Plugin execution
// ----------------------------------------------------------------------
public PluginExecutionResponse attainGoal( MavenProject project, String goal )
- throws Exception
{
PluginManager pluginManager = (PluginManager) pluginManagers.get( "plexus" );
PluginExecutionResponse response = null;
- if ( !goalDescriptors.containsKey( goal ) )
- {
- response = new PluginExecutionResponse();
-
- response.setException( new UnknownGoalException( goal ) );
-
- return response;
- }
-
if ( dag.getChildLabels( goal ).size() == 0 && dag.getParentLabels( goal ).size() == 0 )
{
response = attainGoal( pluginManager, project, goal );
@@ -125,7 +123,6 @@
}
private PluginExecutionResponse attainGoal( PluginManager pluginManager, MavenProject project, String goal )
- throws Exception
{
System.out.println( "[" + goal + "]" );
@@ -143,7 +140,7 @@
}
// ----------------------------------------------------------------------
- //
+ // Plugin descriptors
// ----------------------------------------------------------------------
public Map getPluginDescriptors()
@@ -156,6 +153,10 @@
return (PluginDescriptor) goalToPluginMap.get( goalName );
}
+ // ----------------------------------------------------------------------
+ // Goal descriptors
+ // ----------------------------------------------------------------------
+
public Map getGoalDescriptors()
{
return goalDescriptors;
@@ -200,7 +201,7 @@
}
// ----------------------------------------------------------------------
- //
+ // Plugin discovery
// ----------------------------------------------------------------------
public void componentDiscovered( ComponentDiscoveryEvent event )
1.5 +2 -3 maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PluginManager.java
Index: PluginManager.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PluginManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- PluginManager.java 21 Mar 2004 00:33:17 -0000 1.4
+++ PluginManager.java 4 Apr 2004 17:23:44 -0000 1.5
@@ -33,8 +33,7 @@
{
static String ROLE = PluginManager.class.getName();
- void attainGoal( PluginExecutionRequest request, PluginExecutionResponse response )
- throws Exception;
+ void attainGoal( PluginExecutionRequest request, PluginExecutionResponse response );
List getGoals();
1.6 +2 -3 maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PluginManagerManager.java
Index: PluginManagerManager.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/manager/PluginManagerManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PluginManagerManager.java 2 Apr 2004 18:33:13 -0000 1.5
+++ PluginManagerManager.java 4 Apr 2004 17:23:44 -0000 1.6
@@ -39,8 +39,7 @@
// Plugin execution
// ----------------------------------------------------------------------
- PluginExecutionResponse attainGoal( MavenProject project, String goal )
- throws Exception;
+ PluginExecutionResponse attainGoal( MavenProject project, String goal );
// ----------------------------------------------------------------------
// Plugin processing
1.6 +15 -11 maven-components/maven-core/src/main/java/org/apache/maven/plugin/plexus/PlexusPluginManager.java
Index: PlexusPluginManager.java
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/java/org/apache/maven/plugin/plexus/PlexusPluginManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PlexusPluginManager.java 21 Mar 2004 00:33:17 -0000 1.5
+++ PlexusPluginManager.java 4 Apr 2004 17:23:44 -0000 1.6
@@ -23,15 +23,13 @@
import org.apache.maven.plugin.plexus.executor.PluginExecutor;
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.personality.plexus.lifecycle.phase.Contextualizable;
/**
- *
- *
* @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
- *
* @version $Id$
*/
public class PlexusPluginManager
@@ -51,19 +49,25 @@
}
public void attainGoal( PluginExecutionRequest request, PluginExecutionResponse response )
- throws Exception
{
- String id = request.getPluginDescriptor().getId();
+ try
+ {
+ String id = request.getPluginDescriptor().getId();
- Object plugin = container.lookup( Plugin.ROLE, id );
+ Object plugin = container.lookup( Plugin.ROLE, id );
- request.setPlugin( plugin );
+ request.setPlugin( plugin );
- String mode = request.getPluginDescriptor().getMode();
+ String mode = request.getPluginDescriptor().getMode();
- PluginExecutor pluginExecutor = (PluginExecutor) container.lookup( PluginExecutor.ROLE, mode );
+ PluginExecutor pluginExecutor = (PluginExecutor) container.lookup( PluginExecutor.ROLE, mode );
- pluginExecutor.execute( request, response );
+ pluginExecutor.execute( request, response );
+ }
+ catch ( ComponentLookupException e )
+ {
+ response.setException( e );
+ }
}
// ----------------------------------------------------------------------
1.4 +14 -10 maven-components/maven-core/src/main/resources/org/apache/maven/plexus.xml
Index: plexus.xml
===================================================================
RCS file: /home/cvs/maven-components/maven-core/src/main/resources/org/apache/maven/plexus.xml,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- plexus.xml 20 Mar 2004 23:32:33 -0000 1.3
+++ plexus.xml 4 Apr 2004 17:23:44 -0000 1.4
@@ -51,14 +51,8 @@
<requirement>
<role>org.codehaus.plexus.i18n.I18N</role>
</requirement>
- </requirements>
- </component>
- <component>
- <role>org.apache.maven.verifier.LocalSettingsVerifier</role>
- <implementation>org.apache.maven.verifier.DefaultLocalSettingsVerifier</implementation>
- <requirements>
<requirement>
- <role>org.codehaus.plexus.i18n.I18N</role>
+ <role>org.apache.maven.wagon.managers.WagonManager</role>
</requirement>
</requirements>
</component>
@@ -74,9 +68,6 @@
<implementation>org.apache.maven.plugin.manager.DefaultPluginManagerManager</implementation>
<requirements>
<requirement>
- <role>org.apache.maven.verifier.DependencyVerifier</role>
- </requirement>
- <requirement>
<role>org.apache.maven.plugin.manager.PluginManager</role>
<field-name>pluginManagers</field-name>
</requirement>
@@ -121,6 +112,19 @@
<role>org.apache.maven.plugin.plexus.executor.PluginExecutor</role>
<role-hint>integrated</role-hint>
<implementation>org.apache.maven.plugin.plexus.executor.IntegratedPluginExecutor</implementation>
+ </component>
+
+ <!-- Wagon -->
+
+ <component>
+ <role>org.apache.maven.wagon.managers.WagonManager</role>
+ <implementation>org.apache.maven.wagon.managers.DefaultWagonManager</implementation>
+ <requirements>
+ <requirement>
+ <role>org.apache.maven.wagon.Wagon</role>
+ <field-name>wagons</field-name>
+ </requirement>
+ </requirements>
</component>
</components>
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org